OpenSUSE Leap 42: Install Joomla

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

set -e

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

opensuse_install_mysql()
{
  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
}

opensuse_install_phpmyadmin()
{
  sudo zypper -n in phpMyAdmin
}

opensuse_install_joomla()
{
  # php is configured with --with-curl.
  sudo zypper -n in php5-mysql php5-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 /srv/www/joomla
  sudo tar jxf Joomla_3-7.2-Stable-Full_Package.tar.bz2 -C /srv/www/joomla
  rm -f Joomla_3-7.2-Stable-Full_Package.tar.bz2
}

opensuse_install_apache()
{
  sudo zypper -n in apache2 apache2-mod_php5
  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/server.crt
  SSLCertificateKeyFile /etc/apache2/ssl.key/server.key

  Alias /joomla /srv/www/joomla

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

  for t in FW_CONFIGURATIONS_EXT FW_CONFIGURATIONS_DMZ FW_CONFIGURATIONS_INT; do
    sudo sed -e "s/^${t}=\"\(.*\)\"/${t}=\"\1 apache2 apache2-ssl\"/g" \
         -i /etc/sysconfig/SuSEfirewall2
  done
  sudo systemctl restart SuSEfirewall2

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

opensuse_main()
{
  opensuse_install_mysql
  opensuse_install_phpmyadmin
  opensuse_install_joomla
  opensuse_install_apache
}

opensuse_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