Fedora 27: Install Joomla for CMS

This article will describe installing Joomla which is a content management system.

1 Install Joomla

  • This article uses default SSL/TLS certicication file for https. Please change your SSL/TLS certification file.
  • If you use http instead of https, change 443 to 80 and delete SSLXXX directive in /etc/httpd/conf.d/joomla.conf.
  • JOOMLA_PASSWD is password of joomla user in MySQL.
#!/bin/sh

set -e

[ -z "${JOOMLA_PASSWD}" ] && \
  JOOMLA_PASSWD=joomla_passwd

mysql_install()
{
  sudo dnf install -y mariadb-server
  sudo systemctl enable mariadb
  sudo systemctl start mariadb

  cat<<EOF | sudo mysql -u root
grant all privileges on joomla.* to joomla@localhost
  identified by '${JOOMLA_PASSWD}';
exit
EOF
}

phpmyadmin_install()
{
  sudo dnf install -y phpMyAdmin
}

joomla_install()
{
  # php is configured with --with-curl.
  sudo dnf install -y php-mysqlnd php-json
  JOOMLA3=https://downloads.joomla.org/cms/joomla3

  wget -q ${JOOMLA3}/3-7-2/Joomla_3-7.2-Stable-Full_Package.tar.bz2
  sudo mkdir -p /var/www/joomla
  sudo tar jxf Joomla_3-7.2-Stable-Full_Package.tar.bz2 -C /var/www/joomla
  rm -f Joomla_3-7.2-Stable-Full_Package.tar.bz2
}

apache_install()
{
  sudo dnf install -y httpd mod_ssl

  sudo chown -R apache:root /var/www/joomla

  cat <<EOF | sudo tee /etc/httpd/conf.d/joomla.conf
<VirtualHost _default_:443>
  SSLEngine on
  SSLCertificateFile /etc/pki/tls/certs/localhost.crt
  SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

  Alias /joomla /var/www/joomla

  <Directory /var/www/joomla>
    Options FollowSymLinks
    Require all granted
  </Directory>
</VirtualHost>
EOF

  sudo setsebool -P httpd_unified 1
  sudo systemctl enable httpd
  sudo systemctl restart httpd
  sudo firewall-cmd --add-service=https --permanent
  sudo firewall-cmd --reload
}

joomla_main()
{
  mysql_install
  phpmyadmin_install
  joomla_install
  apache_install
}

joomla_main

2 Access to Joomla

Access to the following URL and setup Joomla. Accept this page's certification to browser.

Username of database is joomla and password of database is JOOMLA_PASSWD value.

https://<server>/joomla

0001_Joomla.png