**## install PartKeepr Ubuntu Server 22**\\
# Add php repo so we can install old version (7.1) of php\\
sudo add-apt-repository ppa:ondrej/php
# Update Apt\\
sudo bin/morning.sh
# Install Apache and MariaDB \\
sudo apt install apache2 apache2-doc curl ntp mariadb-server mariadb-client git cron mlocate htop
# Edit the Apache Conf File\\
sudo vi /etc/apache2/apache2.conf
# Edit the lines below\\
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
# Secure MariaDB\\
sudo mysql_secure_installation
# Log on to MariaDB\\
sudo mysql -u root
# Run the following lines\\
mysql> CREATE USER 'PartKeepr'@'localhost' IDENTIFIED BY 'Dkt8jzsf#';
mysql> CREATE DATABASE PartKeepr CHARACTER SET UTF8;
mysql> GRANT USAGE ON *.* to 'PartKeepr'@'localhost';
mysql> GRANT ALL PRIVILEGES ON PartKeepr.* TO 'PartKeepr'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
# Restart MariaDB\\
sudo systemctl restart mariadb
# Install php 7.1 and required plugins\\
sudo apt install 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-dom php7.1-xml php-pear libgd-tools libgd-dev php7.1-bcmath
# Set Ubuntu to default php 7.1\\
sudo update-alternatives --config php ##set to php7
# Just to make sure we are set to php 7.1
sudo a2enmod php7.1
# Restart Apache\\
sudo systemctl restart apache2
# Change directory to Downloads
cd /home/erik/Downloads
# Get PartKeepr
wget https://github.com/partkeepr/PartKeepr/archive/1.4.0.tar.gz
##OR##\\
cp /mnt/share/Backups/inventory/1.4.0.tar.gz
# Untar it\\
tar xvf 1.4.0.tar.gz
# Make the web site directory\\
sudo mkdir /var/www/html/glock
# Rename parameters file\\
cp PartKeepr-1.4.0/app/config/parameters.php.dist PartKeepr-1.4.0/app/config/parameters.php
# Then copy PartKeepr to it\\
sudo cp -R PartKeepr-1.4.0/* /var/www/html/glock/
#get to the web directory\\
cd /var/www/html
# Set the correct permissions\\
sudo chown -R www-data:www-data glock
sudo find glock -type d -name "*" -exec chmod 775 "{}" \;
sudo find glock -type f -name "*" -exec chmod 664 "{}" \;
# Make sure rewrite is set\\
sudo a2enmod userdir rewrite
# Restart Apache\\
sudo systemctl restart apache2
# Create the Apach configuration file\\
sudo vi /etc/apache2/sites-available/001-glock.conf
# Put this in there\\
ServerName inventory.hohenfels.mylocal
DocumentRoot "/var/www/html/glock/web/"
AcceptPathInfo on
ErrorDocument 403 "Update in progress. Check later.
"
Require all granted
AllowOverride All
## Logging
ErrorLog "/var/log/apache2/partkeepr_glock_error.log"
ServerSignature Off
CustomLog "/var/log/apache2/partkeepr_glock_access.log" combined
# Get into the below directory\\
cd /etc/apache2/sites-available/
# Make our site avaliable\\
sudo a2ensite 001-glock.conf
# Edit some php settings\\
sudo vi /etc/php/7.1/apache2/php.ini
# Find and edit the below\\
max_execution_time = 300
date.timezone = America/Chicago
# Restart Apache\\
sudo systemctl restart apache2
##Download Composer and install globally\\
# Get to Downloads\\
cd /home/erik/Downloads
# And get it\\
wget https://getcomposer.org/download/1.10.22/composer.phar
# Rename the composer file\\
cp composer.phar composer
# Set the correct permissions\\
chmod 755 composer
# Get it to the right spot\\
sudo cp composer /usr/bin/
# Get back to the web directory\\
cd /var/www/html/glock
# Run composer update\\
sudo /usr/bin/php7.1 /usr/bin/composer update
Add the below key:
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
# Run Composer install\\
sudo /usr/bin/php7.1 /usr/bin/composer install
# Set the correct permissions - Again\\
sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 777 /var/www/html/glock/app
sudo chmod -R 777 /var/www/html/glock/
# Finish the setup in your local browser:\\
http://inventory/glock/web/setup/\\
The key needed :\\
cat /var/www/html/glock/app/authkey.php
http basic//