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)
Start the Apache service:
To install Apache open a new terminal and type in the following: (follow on screen instructions for installation)
yum install httpdOnce the installation has finished you can then move onto installing PHP, in the terminal window type the following:
yum install phpMuch 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 mysqlOnce the whole setup is complete you then need to start the services by typing the following:
Start the Apache service:
service httpd startStart the MYSQL server:
service mysqld startWhen 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.phpAdd 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.