Advertise

 
Saturday, November 5, 2011

Howto: Install LAMP (Apache, PHP & MYSQL) In Linux Using YUM

0 comments
Once you’ve set up for linux operating system you may want to turn your server into a web server, to do this you need to install Apache, PHP and if your sites require databases then you will also need MYSQL.
To install Apache open a new terminal and type in the following: (follow on screen instructions for installation)
yum install httpd
Once the installation has finished you can then move onto installing PHP, in the terminal window type the following:
yum install php
Much like the apache installation it will be done automatically by YUM, you then need to type the following to install mysql:
yum install mysql-server mysql
Once the whole setup is complete you then need to start the services by typing the following:
Start the Apache service:
service httpd start
Start the MYSQL server:
service mysqld start
When both services are running you should be able to navigate to the IP of your site via the browser, you should see an Apache test page; Congratulations you have yourself a working webserver. The default folder for the sites files can be found in /var/www/html/ to test that PHP is installed and working correctly you need to create a new file in the /var/www/html/ folder using the vi command:
vi /var/www/html/index.php
Add to the new file the following code:
<?php phpinfo(); ?>
Close and save the file (Press escape, type wq and press enter), Then refresh the website in the browser and you should see a PHP test page, if this is showing you are now ready to set up a website on the server.

Leave a Reply

 
techklog © 2011 DheTemplate.com & Main Blogger. Supported by Makeityourring Diamond Engagement Rings

You can add link or short description here