Installing LAMP in OpenSuSE 12.2

 

"LAMP is a solution stack of free, open source software. The acronym LAMP refers to the first letters of Linux (operating system), Apache HTTP Server, MySQL (database software) and PHP -- principal components to build a viable general purpose web server." -- LAMP wiki article

Though, the letters M and P could also stand for MariaDB, Perl and Python respectively, this was made as a guide to install and configure Apache, MySQL and PHP on OpenSuSE 12.2.



Installing Apache webserver

1. Go to Activities > Applications > (scroll down) and click on Xterm

2. Type su to access root / admin privileges, and input your password.

3. Type the following command: zypper in apache2

4. Upon installation, restart your apache webserver by typing the following comand: rcapache2 restart.

5. You can check if apache2 is running by typing the following command: service apache2 status -- it should say "active (running)..".. if otherwise, type rcapache2 start -- that should start apache.

6. Now to verify (again) if your server is running, go to /srv/www/htdocs/ by typing cd /srv/www/htdocs/ and type nano index.html .

7. In the text editor, type any message you want, press ctrl X (to exit), and save your file.

8. In your browser, type localhost and -- you will see the text you have placed in your index.html file! (you can verify these methods, by stopping your apache2 server, and accessing localhost again in your browser). When you see index.html's contents, you have successfully installed the apache web server.


Installing MySQL

1. Go to Activities > Applications > (scroll down) and click on Xterm

2. Type su to access root / admin privileges


3. Type the following command: zypper in mysql mysql-client mysql-community-server


4. Upon MySQL's installation, type reboot (to restart your machine).


5. Now, go back to your terminal (still in root privileges), and start MySQL by typing systemctl enable mysql.service and systemctl start mysql.service


6. Secure your MySQL installation by typing mysql_secure_installation


7. On the password question, just press enter.


8. Set up your root password (press y), and type in your new MySQL root password (twice for verification) Note: please choose an easy to recall password.


9. Remove anonymous users, disallow remote root login and remove test db's and access by pressing y for the three questions. (you can press n - no - for some of these questions, but for this guide, this is my method.)


10. Reload privilege tables by pressing y. At this point, you have successfully installed - and - configured MySQL on OpenSuSE



Installing PHP

1. Go to Activities > Applications > (scroll down) and click on Xterm


2. Type su to access root / admin privileges, and input your password.


3. Type the following command: zypper in php5 apache2-mod_php5 .. Then type rcapache2 restart after installation.


4. Now to verify if your php is installed, go to /srv/www/htdocs/ by typing cd /srv/www/htdocs/ and type nano info.php .


5. In the text editor, type <?php phpinfo(); ?> and save your file.


6. Go to your browser and type localhost/info.php you should be able to see your php version, and the various plug-ins it came with upon installation.



At this point you have successfully installed LAMP on OpenSuSE congratulations.