LAMP Package Setup

Here's a job you'll get often as a systems administrator: install and configure a new server with LAMP software package: Apache + MySQL/MariaDB + PHP, including apache mod_ruid2.
To be honest with you, it's not very exciting but let's dig in anyway.

Let’s assume that we have freshly installed CentOS 6 server that needs to be configured.
You probably want to run the updater first and wait for it to finish:

[root@ServerSuitTest ~]# yum update

Then we need to install apache2 package:

[root@ServerSuitTest ~]# yum install httpd

Let’s add ServerName directive to the Apache config file, allow Apache daemon launch at server boot and start it immediately:

[root@ServerSuitTest ~]# chkconfig httpd on
[root@ServerSuitTest ~]# echo ServerName *:80 >> /etc/httpd/conf/httpd.conf
[root@ServerSuitTest ~]# service httpd start

If you try to open the default Apache page right now, however, you'll likely see a connection error page in your browser. The problem is that CentOS's default iptables configuration restricts any connections to the server except SSH connections and ICMP protocol packages.
So you need to add iptables rule for HTTP protocol and save iptables config:

[root@ServerSuitTest ~]# iptables -A INPUT 1 -p tcp --dport 80 -j ACCEPT
[root@ServerSuitTest ~]# iptables-save > /etc/sysconfig/iptables

We also need to install apache mod_ruid2 package, which requires some prerequisite packages itself:

[root@ServerSuitTest ~]# yum install httpd-devel gcc libcap-devel

After that, download the latest version of Apache mod_ruid2 from, compile and install it:

[root@ServerSuitTest ~]# tar xvf mod_ruid2-0.9.8.tar.bz2
[root@ServerSuitTest ~]# cd mod_ruid2-0.9.8
[root@ServerSuitTest mod_ruid2-0.9.8]# apxs -a -i -l cap -c mod_ruid2.c 

That's the end of the setup; mod_ruid is compiled and will be loaded after Apache2 restarts.
You should now check to make sure it's configured correctly by running the commands shown below:

[root@ServerSuitTest ~]# cat /etc/httpd/conf/httpd.conf | grep ruid2
LoadModule ruid2_module /usr/lib64/httpd/modules/ 

[root@ServerSuitTest ~]# service httpd restart 
Stopping httpd: [ OK ] 
Starting httpd: [ OK ]

Now, let’s install MariaDB server:
We’ll need to add a MariaDB repository first, by editing the file /etc/yum.repos.d/MariaDB.repo and adding in following lines to it:

[root@ServerSuitTest ~]# nano /etc/yum.repos.d/MariaDB.repo

name = MariaDB
baseurl =

[root@ServerSuitTest ~]# yum install MariaDB-server MariaDB-client

Just as we did with Apache daemon, we need to allow MariaDB server to start at boot. We also need to manually start it up the first time we run it:

[root@ServerSuitTest ~]# chkconfig mysql on
[root@ServerSuitTest ~]# service mysql start

And finally install PHP:

[root@ServerSuitTest ~]# yum install php php-mysql php-common php-mcrypt \
php-xml php-gd php-devel

Then we’ll need to restart Apache daemon so our changes takes effect:

[root@ServerSuitTest ~]# service httpd restart

Now you can test that it’s working:

[root@ServerSuitTest ~]# echo "<?php phpinfo(); ?>" > /var/www/html/index.php

You can go to http://<your server IP address>/index.php and see PHP configuration info page:

PHP Version 5.3.3 preview ServerSuit

Basic installation and configuration of LAMP is complete.
I really hope this was more fun for you than it was for me.

You can go through these steps everytime you need to setup LAMP.  I got to let you know, though, that ServerSuit has the whole LAMP stack pre-configured!

Once you add your server to the dashboard, you just need to select the LAMP package, and click install. Does it make it more fun? Unlikely, but it does make it faster and easier, which is still a win for everyone.

ServerSuit server administration dashboard preview

Go to ‘Software’ tab, choose ’LAMP package’, and click to ‘Install LAMP Package’ button.
That’s it.

Within minutes, depending of your server bandwidth, you’ll have completely configured LAMP server. Don't forget to follow us @serversuit to keep up with new articles and updates.

March 01 2016

Add or review comments

Please leave your comment

Existing comments

Comments 4

Carrie Underwood is my favourite US singer. She is young, beautiful and charming woman in her 30s. Her strong voice takes me away from all troubles of this planet so I can enjoy my life and listen songs created by her. Now the singer is on a Cry Pretty 360 Tour started in May of 2019. The concerts scheduled for this year, up to the last day of October. Tickets are available for all men and women with different income. If you are a country music lover as me, then you must visit at least one Carrie's concert. All tour dates are available at the [url=]Carrie Underwood tour Cleveland[/url]. Open the website and make yourself familiar with all Carrie Underwood concerts in 2019!
Today anybody has an iOS phone. iPhones are so widespread that this has led to developing a tons of apps that provide servises such as games, entertainment and many others. To download this applications a user must get an account at Apple Store. But not all programs are available there as they don't meet the Apple rules. To avoid this a new app was developed named TutuApp. This helper works on iOS run phones and it has the biggest market of apps and games. We name a few: Minecraft, Fortnite, Pokemon and others. They come with zero ads and locked content! Whant to know more? Visit [url=][/url] to download TutuApp for free on your iOS device. Installation instructions for TutuApp Helper are available there.
Today almost everyone uses Youtube or any other service to upload and watch entertaining videos, free movies and other stuff. But sometimes you want to download a movie or a video and the service doesn't allow you to do so. It's where Vidmate is coming to help you out. It helps you to get a movie from may services, including YT, Facebook, Facebook and many other hosting services. To perform this you simply need to find a video and click download button. Plus, Vidmate is completely free of charge and very easy in use with your Android! Download Vidmate APK from [url=][/url] now and start downloading very entertaining videos to share them with your family and friends!
In this age people share videos so many times a day they need a high quality and 100% safe app to do this task. Xender is one of them. With the app you can send your files everywhere you want, from your Android to iPhone and vice versa. You can [url=]download Xender app[/url] for free!

Get notified about new publications and product updates.
Please note we do not share information to anyone.