Obviously you will first need to boot the laptop or machine from the Centos Live CD and log in, so this presumes you have already burned it to a disk and done that.
Once you are up and running, first you will need Httpd web server, which is the newer name for the Apache, so install it with the following command.
$ sudo yum -y install httpd
Start it up with
$ sudo service httpd start
We do not set to start on reboot for the obvious reason that the Live CD is not persistant, so this is a one use scenario and as of writing you will need to keep the machine on or in sleep mode and not switch it off before you have finished what you are doing.
$ sudo yum -y install mysql-server
and again start it with
$ sudo service mysqld start
And enter your preferences at the prompt
At this point you can check the installation with firefox if it is installed.
And you should see a screen such as the one below.
To use php you need to make a couple of small adjustments in the configuration files.
$ sudo vi /etc/httpd/conf.d/welcome.conf
Scroll down to comment out or remove the block as indicated,
$ sudo vi /etc/httpd/conf/httpd.conf
Scroll down to ‘DirectoryIndex’ and add the line ‘index.php’
Now add the final php component
$ sudo yum -y install php php-mysql
Which will give the basics for php use
You can create an info file in the web directory
$ sudo vi /var/www/html/info.php
and add the line
Close and save the file then restart the httpd server
$ sudo service httpd restart
Then again browse to http://localhost
So, if you are on the move but need quick access to a webserver, whatever the machine is loaded up with, you can still use Centos with a basic (or more advanced) Lamp stack in minutes.
This is especially useful for anyone using CMS such as WordPress, Joomla or similar which rely upon the PHP component of the stack