Skip to content

Instantly share code, notes, and snippets.

@lonewarrior556
Last active December 21, 2019 02:09
Show Gist options
  • Save lonewarrior556/12c5a434d162c59527cdd717bd24e3fd to your computer and use it in GitHub Desktop.
Save lonewarrior556/12c5a434d162c59527cdd717bd24e3fd to your computer and use it in GitHub Desktop.
Install joomla
#!/bin/bash
USERNAME=username
PASSWORD=password
# get packages list
apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
# utils
apt-get install unzip
# apache
apt-get install apache2 -y
# php 7.4
apt install php7.4 libapache2-mod-php7.4 php7.4-common php7.4-mysql php7.4-gmp php7.4-curl php7.4-intl php7.4-mbstring php7.4-xmlrpc php7.4-gd php7.4-xml php7.3-cli php7.3-zip -y
echo "
file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 256M
upload_max_filesize = 100M
post_max_size = 101M
max_execution_time = 360
date.timezone = America/New_York" >> /etc/php/7.4/apache2/php.ini
# mysql
debconf-set-selections <<< "mysql-server mysql-server/root_password password root"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password root"
apt-get install -qq mysql-server
apt-get install php7.0-mysql -y
# root n n y y y y
/usr/bin/mysql_secure_installation
# setup
mysql -u root -proot -e "CREATE DATABASE joomla;"
mysql -u root -proot -e "GRANT ALL PRIVILEGES on joomla.* to '$USERNAME'@'localhost' identified by '$PASSWORD';"
mysql -u root -proot -e "FLUSH PRIVILEGES;"
# joomla
cd /var/www/html
rm index.html
wget https://downloads.joomla.org/cms/joomla3/3-9-14/Joomla_3-9-14-Stable-Full_Package.zip
wget https://www.akeebabackup.com/download/akeeba-kickstart/6-0-2/kickstart-core-6-0-2-zip.zip
unzip Joomla_3-9-14-Stable-Full_Package.zip
unzip kickstart-core-6-0-2-zip.zip
mv htaccess.txt .htaccess
chown -R www-data.www-data /var/www/html
chmod -R 755 /var/www/html
systemctl restart apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment