This is a PHP application to run a website that will let you rent video games out.
sudo add-apt-repository -y ppa:ondrej/php && sudo apt-get update
sudo apt-get install -y apache2
sudo apt-get install -y php7.2 zip unzip php7.2-curl php7.2-mbstring php7.2-dom php7.2-gd php7.2-mysql php7.2-zip composer mariadb-server
sudo /usr/bin/mysql_secure_installation
sudo nano /etc/apache2/apache2.conf
sudo nano /etc/apache2/sites-available/000-default.conf
sudo a2enmod rewrite
sudo service apache2 restart
mysql -u root -p
(enter the password as needed)CREATE DATABASE gamerental;CREATE USER gamerental;GRANT ALL on gamerental.* to 'gamerental';SET PASSWORD for 'gamerental' = PASSWORD('XXXXXX');EXIT;
cd /var/www/html
sudo rm index.html
chown www-data:www-data /var/www/html
sudo -u www-data git clone https://github.com/useaquestion/andach-gamerental
cd /var/www/html/andach-gamerental
composer install --no-dev
(omit the --no-dev flag if you're setting up a dev environment of course)php artisan key:generate
(and at this point set up the SQL password appropriately)php artisan migrate:refresh --seed
.php artisan storage:link
sudo service apache2 restart
sudo a2enmod ssl
sudo a2ensite default-ssl.conf
sudo nano /etc/apache2/sites-available/default-ssl.conf
and change the DocumentRoot parameter accordingly. sudo service apache2 restart
cd /usr/local sudo git clone https://github.com/letsencrypt/letsencrypt cd /usr/local/letsencrypt sudo ./letsencrypt-auto --apache -d andachgames.co.uk
sudo crontab -e
and add the below line:0 1 1 */2 * cd /usr/local/letsencrypt && ./letsencrypt-auto certonly --apache --renew-by-default --apache -d andachrental.co.uk >> /var/log/andachrental.co.uk-renew.log 2>&1
sudo a2enmod expires
sudo nano /etc/apache2/sites-available/default-ssl.conf
file and paste this at the bottom:<IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 30 seconds" ExpiresByType text/html "access plus 15 days" ExpiresByType image/gif "access plus 1 months" ExpiresByType image/jpg "access plus 1 months" ExpiresByType image/jpeg "access plus 1 months" ExpiresByType image/png "access plus 1 months" ExpiresByType text/js "access plus 1 months" ExpiresByType text/javascript "access plus 1 months" </IfModule>
ServerSignature Off ServerTokens Prod