PartDB: Difference between revisions

From FlowerHouseWiki
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{ContainerInfo
{{ContainerInfo
|image = Froeling.jpg
|Domain = [https://parts.flowerhouse.at parts.flowerhouse.at]
|Domain = [https://parts.flowerhouse.at parts.flowerhouse.at]
|IP = 192.168.88.??
|IP = 192.168.88.16
|MAC = ??
|MAC = 32:22:DA:F2:39:1B
|Privileged = No
|Privileged = No
|OS = Debian Buster
|OS = Debian Bullseye
|RAM = 512MB
|RAM = 512MB
|Cores = 1
|Cores = 1
}}
}}


<p>The PartDB-LXC is reachable under <syntaxhighlight lang="Bash" inline>192.168.88.??</syntaxhighlight> which is located in the ServerVLAN.</p>
<p>The PartDB-LXC is reachable under <syntaxhighlight lang="Bash" inline>192.168.88.16</syntaxhighlight> which is located in the ServerVLAN.</p>
<p>The subdomain is [https://parts.flowerhouse.at parts.flowerhouse.at] which is handled by the [[ReverseProxy]].</p>
<p>The subdomain is [https://parts.flowerhouse.at parts.flowerhouse.at] which is handled by the [[ReverseProxy]].</p>
__TOC__
__TOC__
== Old version ==
== Installation ==
<p>Install the required packages:</p>
[https://docs.part-db.de/installation/installation%20guide-debian.html Installation Guide]
<syntaxhighlight lang="console">
apt install git zip apache2 php php-mysql php-curl libapache2-mod-php php-opcache php-gettext
</syntaxhighlight>


<p>Configure locales:</p>
== Update ==
<syntaxhighlight lang="console">
[https://docs.part-db.de/installation/installation_guide-debian.html#update-part-db Update Guide]
dpkg-reconfigure locales
</syntaxhighlight>


=== Configure Apache ===
Move into Part-DB folder
<p>Open the following file:</p>
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
nano /etc/apache2/apache2.conf
cd /var/www/partdb
</syntaxhighlight>
 
<p>And change this part:</p>
<syntaxhighlight lang="console" line>
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
</syntaxhighlight>
 
<p>to this:</p>
<syntaxhighlight lang="console" line>
<Directory /var/www/>
        Options -Indexes
        AllowOverride All
        Require all granted
</Directory>
</syntaxhighlight>
</syntaxhighlight>


<p>Restart the apache service:</p>
Checkout master branch
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
systemctl restart apache2
git checkout master
</syntaxhighlight>
</syntaxhighlight>


=== Configure PHP ===
Pull latest Part-DB version from GitHub
<p>Edit ''php.ini'':</p>
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
nano /etc/php/7.3/apache2/php.ini
git pull
</syntaxhighlight>
</syntaxhighlight>


<p>Change the following settings:</p>
Checkout the latest version (or use a specific version, like described above)
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
memory_limit = 128M
git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
upload_max_filesize = 100M
post_max_size = 100M
</syntaxhighlight>
</syntaxhighlight>


=== PartDB ===
Apply correct permission
<p>Download and unpack:</p>
<syntaxhighlight lang="console" line>
wget -O part-db.tar.gz https://github.com/jbtronics/Part-DB/archive/master.tar.gz
tar -xzf part-db.tar.gz -C /var/www
rm part-db.tar.gz
</syntaxhighlight>
 
<p>Change folder name to root directory:</p>
<syntaxhighlight lang="console" line>
cd /var/www
rm -r html
mv Part-DB-master html
</syntaxhighlight>
 
<p>Set ownership:</p>
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
chown -R www-data:www-data html
chown -R www-data:www-data .
</syntaxhighlight>
</syntaxhighlight>


<p>Generate composer files:</p>
Install new composer dependencies
<syntaxhighlight lang="console" line>
cd /var/www/html
php composer.phar install -o --no-dev
</syntaxhighlight>
e]smoFA14yF1!.6A
 
== New version ==
<p>Install the required packages:</p>
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
apt install git wget curl gnupg composer apache2 php php-mysql php-gd php-intl php-simplexml php-dom php-zip php-xsl php-bcmath php-curl
sudo -u www-data composer install --no-dev -o
</syntaxhighlight>
</syntaxhighlight>


<p>Install Symfony:</p>
Install yarn dependencies and build new frontend
<syntaxhighlight lang="console">
wget https://get.symfony.com/cli/installer -O - | bash
</syntaxhighlight>
 
<p>Install it globally:</p>
<syntaxhighlight lang="console">
mv /root/.symfony/bin/symfony /usr/local/bin/symfony
</syntaxhighlight>
 
<p>Install Node.js:</p>
<syntaxhighlight lang="console" line>
<syntaxhighlight lang="console" line>
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
sudo yarn install
apt install -y nodejs
sudo yarn build
</syntaxhighlight>
</syntaxhighlight>


<p>Install Yarn:</p>
Apply new database schemas (you should do a backup of your database file /var/www/partdb/var/app.db before)
<syntaxhighlight lang="console" line>
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update
apt install yarn
</syntaxhighlight>
 
<p>Configure locales (languages you want to support):</p>
<syntaxhighlight lang="console">
dpkg-reconfigure locales
</syntaxhighlight>
 
<p>Clone PartDB repository:</p>
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
cd /var/www
sudo -u www-data php bin/console doctrine:migrations:migrate
rm -r html
git clone https://github.com/Part-DB/Part-DB-symfony
mv ./Part-DB-symfony/* ./
</syntaxhighlight>
</syntaxhighlight>


=== Configure Apache ===
Clear Part-DB cache
<p>Change webroot:</p>
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
nano /etc/apache2/sites-available/000-default.conf
sudo -u www-data php bin/console cache:clear
</syntaxhighlight>
 
<p>Change:</p>
<syntaxhighlight lang="console">
/var/www/html -> /var/www/public
</syntaxhighlight>
 
<p>Open the following file:</p>
<syntaxhighlight lang="console">
nano /etc/apache2/apache2.conf
</syntaxhighlight>
 
<p>And change this part:</p>
<syntaxhighlight lang="console" line>
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
</syntaxhighlight>
</syntaxhighlight>


<p>to this:</p>
<syntaxhighlight lang="console" line>
<Directory /var/www/>
        Options -Indexes
        AllowOverride All
        Require all granted
</Directory>
</syntaxhighlight>


<p>Restart the apache service:</p>
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
systemctl restart apache2
</syntaxhighlight>


=== PartDB ===
<p>Create file and paste [https://github.com/Part-DB/Part-DB-symfony/blob/master/.env this]:</p>
<syntaxhighlight lang="console" line>
nano .env
</syntaxhighlight>
<p>Add database to ".env":</p>
<syntaxhighlight lang="console" line>
dsaaf
</syntaxhighlight>
<p>Install composer dependencies and generate autoload files:</p>
<syntaxhighlight lang="console" line>
composer install --no-dev
</syntaxhighlight>
<p>Install client side dependencies and build it:</p>
<syntaxhighlight lang="console" line>
yarn install
yarn build
</syntaxhighlight>
</syntaxhighlight>



Latest revision as of 08:28, 24 August 2023


Network


IP: 192.168.88.16
MAC: 32:22:DA:F2:39:1B
Domain: parts.flowerhouse.at

System


OS: Debian Bullseye
RAM: 512MB
Cores: 1
Privileged: No

The PartDB-LXC is reachable under 192.168.88.16 which is located in the ServerVLAN.

The subdomain is parts.flowerhouse.at which is handled by the ReverseProxy.

Installation

Installation Guide

Update

Update Guide

Move into Part-DB folder

cd /var/www/partdb

Checkout master branch

git checkout master

Pull latest Part-DB version from GitHub

git pull

Checkout the latest version (or use a specific version, like described above)

git checkout $(git describe --tags $(git rev-list --tags --max-count=1))

Apply correct permission

chown -R www-data:www-data .

Install new composer dependencies

sudo -u www-data composer install --no-dev -o

Install yarn dependencies and build new frontend

sudo yarn install
sudo yarn build

Apply new database schemas (you should do a backup of your database file /var/www/partdb/var/app.db before)

sudo -u www-data php bin/console doctrine:migrations:migrate

Clear Part-DB cache

sudo -u www-data php bin/console cache:clear


Sources