Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Guides Forum _ Lamp (Linux Apache Mysql Php) Web Server

Posted by: hughesjr May 22 2004, 02:26 PM

This is going to be a LAMP (Linux Apache MySQL PHP) Web server install on WhiteBox Enterprise Linux. The first step is going to be to do a minimal install of WhiteBoxEL. This is accomplishished by selecting a custom install and unchecking everything. This will give you an install with about 540mb of packages. It is the minumum recommended install by RedHat of their Enterprise product.

This install is as lean as possible, and does not contain a GUI. You will need to know how to use an editor in console mode. There are several, I use vi ... nano is also in this install. Either can be used ... please become familiar with a console editor before attempting this install. You will see steps that say edit file /xxx/xxxx ... you should use your perferred editor to do these steps.

All commands are done at the command prompt as root.

Here is the procedure.

1. Install a minimum WBEL (or CentOS, or RHEL) install. Since this is going to be a server, you want to manually assign an ipaddress on your network, and manually assign a domain name. In my test domain, I assigned the address and a name of lamp.home.local. (I use the 192.168.0.x network inside my firewall, and I have a DNS server setup to put names in for the home.local domain, which I use internally for testing).

After the first boot, edit the file /etc/sysconfig/network to verify the domain name is setup... mine says this:


Also look in /etc/hosts and make sure the name is setup ... mine looks like this:
# Do not remove the following line, or various programs
# that require network functionality will fail. localhost.localdomain localhost lamp.home.local

2. For WBEL and CentOS install yum ... this will require the packages libxml2-python and libxml2. How I did this install for WBEL is as follows (all steps below will be on WhiteBoxEL ... CentOS steps would be similar, but the filenames might be slightly different ... as would be the yum repository locations):

After the files were downloaded, I installed them with the command:

rpm -Uvh libxml2-python-2.5.10-5.i386.rpm libxml2-2.5.10-5.i386.rpm yum-2.0.4-2.WB1.noarch.rpm

3. Now, edit the file /etc/yum.conf to add the proper repositories ... my /etc/yum.conf file is here:

4. Update all the packages on the system to the lastest updates with this command:

yum upgrade

5. Reboot the machine on the new kernel...

6. Now we are ready to install all the packages required to have a LAMP server.

yum install perl-DBD-MySQL mysql-server mysql php-mysql mod_auth_mysql openssl-devel openssl mod_ssl php-devel php httpd rpm-build rpm-devel gcc perl-CPAN autoconf automake

7. After the install, we will want to make the all the programs start for future reboots and start them right now ... to do that, use the following commands:

chkconfig httpd on
chkconfig mysqld on

Here is how to start them now ....

/etc/init.d/mysqld start
/etc/init.d/httpd start

8. Now I like to add a page called info.php to the root directory of my site to make sure everything is working. Edit a file named /var/www/html/info.php and paste the following into it and then save it:
 <TITLE>PHP via Enterprise Linux</TITLE>
 <?php phpinfo(); ?>

Now open a webbrowser and go to your website via either it's name or ip address, so in my case it is this:



9. The configuration files are:

For apache - /etc/httpd/conf/httpd.conf (and all items in the directory /etc/httpd/conf.d). (

For PHP - /etc/php.ini (

For MySQL -

Powered by Invision Power Board (
© Invision Power Services (