How do I install LAMP on my new basic server?

Important Notes:

This guide will show you how to install Apache, mySQL, and PHP from the Linux command line.

Getting Started:

  1. Log into your server using SSH

  2. First, we'll install apache. Issue the following command to install apache:

     

      [root@server] yum install httpd mysql-server php mysql php-mysql

       
  3. Next, we need to make sure that the firewall is configured to save its settings when stopped or restarted:

    Edit /etc/sysconfig/iptables-config and make sure following variables are set to “yes”:

     

 IPTABLES_SAVE_ON_STOP = “yes”
 IPTABLES_SAVE_ON_RESTART = “yes”

 
  1. Finally, we need to add the firewall rules allowing access to the HTTP and HTTPS ports and set SELinux to be permissive:


[root@server] iptables -I INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 80 -j ACCEPT
[root@server] iptables -I INPUT -p tcp -m state --state NEW,ESTABLISHED --dport 443 -j ACCEPT
[root@server] service iptables restart
[root@server] echo 0 >/selinux/enforce

The LAMP stack should now be fully functional and accessible on your server.



Related Articles

No related articles were found.

Attachments

No attachments were found.

Visitor Comments

No visitor comments posted. Post a comment

Post Comment for "How do I install LAMP on my new basic server?"

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.

   Name:
   Email:
* Comment:
* Enter the code below:

 

Article Details

Last Updated
1st of March, 2011

See also:
Getting started with your server.

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

 Subscribe me

Subscribe me  Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF


User Opinions

No users have voted.

How would you rate this answer?




Thank you for rating this answer.

Continue