#!/bin/sh # NOTE - if changing the user, then the will need to edit apache config also _user="www-data" sudo apt install -y php php-ctype php-fileinfo php-sqlite3 php-cli php-mysql php-zip php-json php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-pdo openssl mariadb-server vim unzip curl sudo mysql -uroot << EOSQL UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User = 'root'; CREATE USER 'october'@'localhost' IDENTIFIED BY 'october'; CREATE DATABASE october; GRANT ALL ON october.* TO 'october'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES; EOSQL sudo apt -y install apache2 libapache2-mod-php mkdir /srv/octobercms && cd /srv/octobercms php -r "eval('?>'.file_get_contents('https://octobercms.com/api/installer'));" sudo chown -R "$_user":"$_user" /srv/octobercms sudo -u "$_user" php artisan october:install cat << 'EOF' > octobercms.conf DocumentRoot /srv/octobercms/ ServerName october.home ServerAlias october.home Options +FollowSymlinks AllowOverride All Require all granted ErrorLog /var/log/apache2/octobercms-error.log CustomLog /var/log/apache2/octobercms-access.log combined EOF sudo mv octobercms.conf /etc/apache2/sites-enabled/ sudo chown root:root /etc/apache2/sites-enabled/octobercms.conf sudo rm /etc/apache2/sites-available/000-default.conf sudo a2enmod rewrite sudo systemctl restart apache2 echo "Now open 'http://localhost/backend/'"