How To Install LAMP Stack (Apache, MariaDB, PHP, phpMyAdmin) On openSUSE 13.1/13.2/42.1

If you get output like above. There is no index file on apache directory /srv/www/htdocs. So, just create index.html file and add the content as you wish to test it.

Congratulation you have successfully installed and configured Web Server on openSUSE Leap 42.1

how-to-install-lamp-stack-on-opensuse-42-1-image-2
Now, You have successfully installed and configured apache on your openSUSE Leap 42.1 box.

2a) Enabling public access to web server

By default web server is only accessible in localhost. If you want to access publicly you need to open Port=80 for http in firewall, also edit /etc/sysconfig/SuSEfirewall2 file and allow apache.

[Allow apache to firewall]
$ sudo nano /etc/sysconfig/SuSEfirewall2
FW_CONFIGURATIONS_EXT="apache2"

[Restart firewall]
$ sudo systemctl restart SuSEfirewall2.service

3) Install MariaDB

MariaDB is a drop-in replacement for MySQL. Now a days all the OS didn’t included MySQL as default & some of the OS removed the MySQL package also. MariaDB is open-source relational database management system (RDBMS) which is supporting database access. It’s robust, scalable, and reliable SQL server for high availability databases as free of cost.

[Install MariaDB]
$ sudo zypper in mariadb mariadb-tools

[Start, enable & check the status of MariaDB service]
$ sudo systemctl start mysql.service
$ sudo systemctl enable mysql.service
$ sudo systemctl status mysql.service

[Set root password for MariaDB[
$ sudo mysqladmin -u root password NEWPASSWORD

If you set the MySQL root password using above method, it wont remove the test DB and didn’t secure other settings too. You can see the below output, still the test DB is there.
how-to-install-lamp-stack-on-opensuse-42-1-image-5

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...