Wednesday, January 15, 2014

How to create a Lamp in Centos

Linux Apache MySQL PHP (LAMP)

1.) Go to Centos "http://centos.org/" and download a copy of centos and then install is by burning an image.  If you do not know how to burn an image you may go to: "http://www.imgburn.com/" and download imgburn and follow the install directions.  Be sure not to agree to install junk software.

1.5.) you will need to ensure your command prompt has a: # before issuing any commands.  If it does not just type: sudo su then type your password

2.) Apply all Centos updates with the command:

yum update

3.) Agree by selecting yes or no.  You could typed command: yum update -y  to default all answers to yes.  However some people want to see what is going to be installed.

4.) Next you will need to install Apache:

yum install httpd

5.) Now to ensure there are no issues with your apache install, you need to start it:

service httpd start 

6.) Now to ensure apache is working from the outside you need to lower some firewall rules:

setup 

if the "setup" feature does not work please install it with:

1yum –y install setuptool
2yum –y install system-config-network*
3yum -y install system-config-firewall*
4yum –y install system-config-securitylevel-tui
5yum –y install system-config-keyboard

For system services utility install ntsysv 
1yum -y install ntsysv

chkconfig httpd --level 2345 on

7.)  Go to Firewall configuration and run the tool:

service iptables stop

Look for (DNS,FTP, www, Secure www) ensure the boxes are checked

Say ok and go back to the menu and select services

Look for (mysqld, httpd, network) and place check marks next to them. 

8.) Now save your changes by saying clicking ok and exiting out.

9.) reboot your server by typing:

reboot 

10.)  Next you need to install php by issuing the command: 

yum install php php-mysql
 
11.) Now we need to ensure php is working by creating an info file:


nano /var/www/html/info.php

 12.) A black screen will apear and you now need to type:

<?php

phpinfo();

?>

13.) Next you will hold down the ctrl button and press the letter o

14.) Agree to write file by pressing enter

15.) Next you will hold down the ctrl button and press the letter x

16.)  reboot your server

 17.) Now install mysql:

 yum install mysql-server 

service start mysqld

chkconfig mysqld --level 2345 on  

18.)  Now configure mysql by typing: 

sudo /usr/bin/mysql_secure_installation 

19.) There is no password so you need to press enter and then put in your password that you wish to make on it and finally Type "y" to everything it asks and at the end it will say enjoy

20.) Finally  you are done so you need to type:

ifconfig

21.) look where it says ip, and copy it down and type it into another computer's internet browser

12.34.56.78

22.) next put your ip with a slash and info.php

12.34.56.78/info.php

23.) if you see a purple screen with information about your server...  you are finished with your LAMP.