Skip to content

Instantly share code, notes, and snippets.

@ambiamber
Last active July 16, 2023 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ambiamber/23b3eb529bb10f255ef0d8ef65508d32 to your computer and use it in GitHub Desktop.
Save ambiamber/23b3eb529bb10f255ef0d8ef65508d32 to your computer and use it in GitHub Desktop.
Install Partkeepr 1.0.4 on Ubuntu 22.04.1 Jammy
There is no PHP 7.1 or 7.2 in Ubuntu 22.04 by default, so I use:
Ondřej Surý at https://deb.sury.org/
https://launchpad.net/~ondrej/+archive/ubuntu/php/
Install from ubuntu-22.04.1-live-server-amd64.iso
When you get a message "failed to unmount cdrom" just press the Enter key.
Select the minimal option.
Set time zone
sudo sudo dpkg-reconfigure tzdata
sudo -i
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
exit
sudo apt update
sudo apt upgrade
sudo reboot
sudo apt install cron less whiptail php7.1
sudo update-alternatives --set php /usr/bin/php7.1
sudo apt install php7.1-curl php7.1-gd php7.1-intl php7.1-gd php7.1-bcmath
sudo apt install php7.1-ldap php7.1-mysql php7.1-xml php7.1-apcu-bc
Replace put-a-good-password-here below with a good password.
sudo apt install mariadb-server mariadb-client
sudo mysql
create database partkeepr character set utf8;
grant usage on *.* to admin@localhost identified by 'put-a-good-password-here';
grant all privileges on partkeepr.* to admin@localhost;
FLUSH PRIVILEGES;
exit
wget https://downloads.partkeepr.org/partkeepr-1.4.0.tbz2
tar xf partkeepr-1.4.0.tbz2
sudo cp -a partkeepr-1.4.0 /var/www/PartKeepr
sudo chown -R www-data:www-data /var/www/PartKeepr
sudo a2enmod rewrite
Create /etc/apache2/conf-available/partkeepr.conf
sudo sensible-editor /etc/apache2/conf-available/partkeepr.conf
<Directory /var/www/PartKeepr>
AcceptPathInfo on
Require all granted
AllowOverride All
</Directory>
Create /etc/apache2/sites-available/partkeepr.conf (change the ServerName)
sudo sensible-editor /etc/apache2/sites-available/partkeepr.conf
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/PartKeepr/web
AcceptPathInfo on
ErrorDocument 403 "<h1>Demo Site update in progress. Check back in a few minutes.</h1>"
<Directory /var/www/PartKeepr/web>
Require all granted
AllowOverride All
</Directory>
## Logging
ErrorLog "/var/log/apache2/partkeepr_error.log"
ServerSignature Off
CustomLog "/var/log/apache2/partkeepr_access.log" combined
</VirtualHost>
sudo a2enconf partkeepr
sudo a2ensite partkeepr
sudo a2dissite 000-default
In /etc/php/7.1/apache2/php.ini set these:
date.timezone = UTC
max_execution_time = 60
sudo systemctl restart apache2
Add crontab entry
sudo crontab -e -u www-data
0 0,6,12,18 * * * /usr/bin/php /var/www/PartKeepr/app/console partkeepr:cron:run
Transfer the database, etc. if any:
Create archive files on the original VM
sudo mysqldump partkeepr > partkeepr.sql
copy partkeepr.sql to the new VM
tar cPjf partkeepr-data.tar.xz /var/www/PartKeepr/data/
Copy partkeepr-data.tar.xz from the original VM to the new one.
Extract archive files on the new VM
sudo systemctl stop apache2.service
sudo tar xPf partkeepr-data.tar.xz
sudo mysql partkeepr < partkeepr.sql
sudo systemctl start apache2.service
Change the URL to use your server's name
http://example.com/setup/
When the installation is complete I get an error about the database schema being wack but I just ignore it and things seem OK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment