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 https://sourceforge.net/projects/mod-ruid/files/latest/download, 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/mod_ruid2.so 

[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

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1.12/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

[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.
Enjoy!

March 01 2016

Add or review comments

Please leave your comment

Existing comments

Comments 13


CarrieEt
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=https://carrieunderwoodtour.com]Carrie Underwood tour Cleveland[/url]. Open the website and make yourself familiar with all Carrie Underwood concerts in 2019!
TutuEt
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=https://tutuapp-app.com/ios/]https://tutuapp-app.com/ios/[/url] to download TutuApp for free on your iOS device. Installation instructions for TutuApp Helper are available there.
VidmEt
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=https://vidmateapp.pro/apk/]https://vidmateapp.pro/apk/[/url] now and start downloading very entertaining videos to share them with your family and friends!
Xencaurn
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=https://xender-download.com]download Xender app[/url] for free!
VidmEt
Today almost every Internet user visits Youtube or any other video hosting provider to upload and watch entertaining videos, free movies and other content. But sometimes you want to download a movie or a video and the hosting doesn't allow you to do so. That's where Vidmate is coming to help you. It allows you to download a video from may services, including Youtube, Facebook, Facebook and many others. To perform this you simply need to open video page and click "download". Plus, the app is 100% free and easy in use! [url=https://vidmateapp.pro]Download Vidmate[/url] now and start downloading very entertaining video to share them with your family!
Johnnycaurn
I like pop-folk songs! I really do! And my favourite folk band is Johnnyswim! The members Abner Ramirez and Amanda Sudano are about to give more than 40 concerts to their fans in 2019 and 2020! To know more about Johnnyswim in 2019 visit site [url=https://johnnyswimtour.com]Johnnyswim tickets[/url]. You aren't going to miss concerts by Johnnyswim in 2019 if you visit the link!
Johnnycaurn
I like soul songs! I really do! And my favourite soul band is Johnnyswim! The members Amanda Sudano and Abner Ramirez are about to give more than 40 concerts for their fans in 2019 and 2020! To know more about Johnnyswim in 2020 visit site [url=https://johnnyswimtour.com]Johnnyswim tour[/url]. You aren't going to miss any show by Johnnyswim this year if you visit the link!
CarrieEt
Carrie Underwood is my favourite US contry singer. She is young, beautiful and charming woman in her 30s. Her strong voice takes me away from all issues of this planet so I start enjoy my life and listen songs created by her mind. Now the singer is on a Cry Pretty 360 Tour started in May of 2019. The concerts scheduled for this year, up to the 31st of October. Ticket prices are moderate and available for all men and women with different income. If you love country music as mush as I, then you must visit at least one Carrie's concert. All tour dates are available at the [url=https://carrieunderwoodconcerts.com]Carrie Underwood tour Spokane[/url]. Open the website and make yourself familiar with all Carrie Underwood concerts in 2019!
Chaincaurn
I like EDM songs! I really do! And my favourite dance band is The Cheinsmokers! DJs Andrew Taggart and Alex Pall are about to give more than 50 concerts for their fans in 2019 and 2020! To know more about Chainsmokers band in 2019 and 2020 visit site [url=https://chainsmokersconcerts.com]Chainsmokers tour Tampa[/url]. You aren't going to miss any concert in 2019 if you visit the link!
CarrieEt
Carrie Underwood is my favourite US contry singer. She is young, beautiful and charming woman in her 30s. Her voice takes me away from all troubles of this world so I can enjoy my life and listen songs created by her. Now she is on a Cry Pretty 360 Tour started in May of 2019. The concerts scheduled for the whole 2019, up to the 31st of October. Tickets are available for all men and women with different income. If you love contry music, then you must visit at least one of her concert. All tour dates are available at the [url=https://carrieunderwoodconcerts.com]Carrie Underwood tour San Antonio[/url]. Visit the website and make yourself familiar with all Carrie Underwood concerts in 2019!
Chaincaurn
I like EDM bands! I really do! And my favourite EDM band is The Cheinsmokers! DJs Alex Pall and Andrew Taggart are about to give more than 50 concerts for their fans in 2019 and 2020! To know more about Chainsmokers in 2019 visit site [url=https://chainsmokersconcerts.com]The Chainsmokers tour[/url]. You aren't going to miss concerts this year if you click on the link!
BreakEt
Breaking Benjamin is my favourite band of 2000s. They had so many hits! The ones I remember are 'The Diary of Jane', 'Tourniquet' and, of course their hit 'So Cold'. These are real songs, not fake ones like today! And it is awesome that Breaking Benjamin have a tour in 2019-2020! So I'm going to attend Breaking Benjamin concert in 2020. The tour dates is here: [url=https://breakingbenjaminconcerts.com]Breaking Benjamin tour dates 2020[/url]. Check it out and maybe we can even visit one of the Benjamin's together!
Xencaurn
In this age people share videos so many times a day they need a decent and safe app to perform this task. Xender is one of them. With this app you can transfer your images everywhere you want, from your computer to computer and vice versa. You can download Xender from [url=https://xender-download.com]https://xender-download.com[/url] for free!

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