As of this point in time, PartKeepr is stale and is not receiving updates.
CPU Cores | 2 |
Memory | 2GB-4GB |
Storage | 16GB |
OS | Debian 10 |
2021/05/21
We need to install PHP7.1 due to compatibility issues with the current version. Add the Sury repo to gain access to the older packages.
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php7.list
wget -O /etc/apt/trusted.gpg.d/sury-repo.gpg https://packages.sury.org/php/apt.gpg
Install required packages
apt install apache2 apache2-doc curl mariadb-server mariadb-client ntp php7.1 php7.1-apcu php7.1-apcu-bc php7.1-curl php7.1-gd php7.1-intl php7.1-ldap php7.1-mysql php7.1-xml
1. Run the secure installation. Set a secure root password.
mysql_secure_installation
2. Login to MariaDB with the MariaDB root user we just created.
mysql -u root
3. Create DB user for PartKeepr.
CREATE USER 'partkeepr'@'localhost' IDENTIFIED BY 'secure-password-here';
4. Create a new DB for PartKeepr.
CREATE DATABASE PartKeepr CHARACTER SET UTF8;
5. Set privileges for new DB user.
GRANT USAGE ON *.* TO 'partkeepr'@'localhost';
GRANT ALL PRIVILEGES ON PartKeepr.* TO 'partkeepr'@'localhost';
6. Flush privileges and exit.
FLUSH PRIVILEGES;
exit
1. Create a new unix user for PartKeepr
adduser partkeepr --disabled-password
2. Download PartKeepr. I like to keep all the downloads in the user account home directory.
cd /home/partkeepr
wget https://downloads.partkeepr.org/partkeepr-1.4.0.tbz2
3. Extract PartKeepr
tar -xjvf partkeepr-1.4.0.tbz2 -C /var/www
4. Set ownership on the PartKeepr directory.
chown -R partkeepr:www-data /var/www/partkeepr-1.4.0
5. Change the permissions of all directories and files.
find /var/www/partkeepr-1.4.0 -type d -exec chmod 770 {} +
find /var/www/partkeepr-1.4.0 -type f -exec chmod 660 {} +
1. Enable required modules.
a2enmod userdir rewrite
2. Create a new vhost for PartKeepr
vim /etc/apache2/sites-available/partkeepr.conf
Use this configuration
<VirtualHost *:80>
ServerName partkeeper.mydomain.com
DocumentRoot /var/www/partkeepr-1.4.0/web
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerSignature Off
<Directory /var/www/partkeepr-1.4.0>
AcceptPathInfo on
Require all granted
AllowOverride All
</Directory>
</VirtualHost>
3. Enable the new site, disable the default site.
a2ensite partkeepr.conf
a2dissite 000-default.conf
systemctl reload apache2.service
1. Edit the PHP Apache2 config file.
vim /etc/php/7.1/apache2/php.ini
2. Change the following settings:
max_execution_time = 120
date.timezone = America/Denver
Make sure to uncomment this line. (Set to your timezone)3. Restart Apache to apply the changes.
systemctl restart apache2.service
1. Navigate to http://[IP-or-Hostname-of-server]/setup
in your browser.
2. Click ‘Next'
3. On ‘Prerequisites’, if you have all greens, click ‘Next’.
4. On ‘Authentication Key’, the auth key at /var/www/partkeepr-1.4.0/app/authkey.php
needs to be verified.
cat /var/www/partkeepr-1.4.0/app/authkey.php
5. We have no existing configuration, click ‘Next’ past ‘Existing Configuration’.
6. On ‘Database Parameters’, set ‘Database Type’ to ‘MySQL’.
Click ‘Next'.
7. On ‘Setup (1/2)’, if you have all greens, click ‘Next’. (It will say no existing users found because this is a new installation)
8. On ‘User Data', create a new user to be the administrator. Use the ‘Authentication Method’ that fits your needs best.
9. On ‘Setup (2/2)’, if you have all greens, click ‘Next’.
10. On ‘Setup Complete’, PartKeepr will display a line of CRON config. That config needs to be set in a new config file.
vim /etc/cron.d/partkeepr
Modify this config if you installed in a different directory and/or with different users.
0 0,6,12,18 * * * www-data /usr/bin/php /var/www/partkeepr-1.4.0/app/console partkeepr:cron:run
This means: At minute 0 of hours 0, 6, 12, and 18, on all days of the month, on all months, on all days of the week, execute the file /var/www/partkeepr-1.4.0/app/console in the PHP interpreter under the www-data user's account.
11. Click ‘Submit’ to complete the setup.