OpenSUSE Leap 15: 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/apache2/conf.d/joomla.conf.
  • JOOMLA_PASSWD is password of joomla user in MySQL.
#!/bin/sh -e


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

mysql_install()
{
  sudo zypper -n in mariadb
  sudo systemctl enable mysql
  sudo systemctl start mysql

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

phpmyadmin_install()
{
  sudo zypper -n in phpMyAdmin
}

joomla_install()
{
  # php is configured with --with-curl.
  sudo zypper -n in php7-mysql php7-json php7-zlib
  JOOMLA3=https://downloads.joomla.org/cms/joomla3

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

apache_install()
{
  sudo zypper -n in apache2 apache2-mod_php7
  sudo gensslcert

  sudo chown -R wwwrun:root /srv/www/joomla

  cat <<EOF | sudo tee /etc/apache2/conf.d/joomla.conf
<VirtualHost _default_:443>
  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl.crt/$(hostname -f)-server.crt
  SSLCertificateKeyFile /etc/apache2/ssl.key/$(hostname -f)-server.key

  Alias /joomla /srv/www/joomla

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

  sudo firewall-cmd --add-service=https --permanent
  sudo firewall-cmd --reload

  sudo a2enflag SSL
  sudo a2enmod ssl
  sudo a2enmod php7
  sudo systemctl enable apache2
  sudo systemctl restart apache2
}

joomla_main()
{
  mysql_install
  phpmyadmin_install
  joomla_install
  apache_install
}

joomla_main

2 Access to Joomla

Access to the following URL and setup Joomla. Username of database is joomla and password of database is JOOMLA_PASSWD value.

https://<server>/joomla

0001_Joomla.png