// shall I write some keywords here to boost search engine ranking?

Monday, August 22, 2005

Setup LAMP

Finally I had setup LAMP (Linux + Apache + MySQL + PHP) on my work station. Below is my short note. Hope you will find it useful.

Linux
Since my workstation already installed MS Windows 2000, I had create a Logical partition of 9 GB in my harddisk for Linux with Partition Magic 7.0.

Then I boot from Fedora Core 3 (FC3) Disc 1 to start my installation. I take 512MB of my 9 GB as swap partition. I choose not to select the Apache HTTPD and MySQL bundle with FC3 because I would like to take the chance to install them by myself.

Installation of FC3 is smooth with it wizard-like GUI and I get a Linux box after 15 minutes.

Apache + MySQL + PHP
The sequence to install them does matter. Apache and MySQL must installed before PHP. I have face some difificulties in integrating PHP and MySQL if MySQL is install via RPM.

Installing Apache, PHP and MySQL on a Linux/Unix server


So I install MySQL 4.1 by source. The steps in details can be found link above. I have make a mistake in the installation, I use root user to install MySQL. This cause MySQL failed to start with command mysqld_safe. To solve this, I had change the owner of mysql/var/ folder to 'mysql'.

Install of Apache is relatively simple. just followed the steps in page above will do. After both Apache and MySQL is installed. Installed PHP 5 as teach in page above.

Make Everything Autostart on Boot
For production server, manually startup MySQL and Apache is really do not make sense. To auto start MySQL, I followed the steps in MySQL Uer Manual.

To autostart Apache, I use the script in here and add it as service with similar steps as how I did with MySQL. It initially do not work and prompt "apache does not support for chkconfig" message. Then I fixed it by adding some details into the script as teach here. Then it works.

No comments: