#############################
##### LAMP CONFIGURATION ####
#Created By : JINO JOSEPH ###
#Created Date : 23-10-2010 ##
#############################
### CONFIGURING APACHE ###
1. Go to the directory where the downloaded packages reside. In my case it is at/usr/src
# cd /usr/src
Now uncompress and extract the file httpd-2.0.44.tar.gz
# tar -zxvf httpd-2.0.44.tar.gz
This will create a folder httpd-2.0.44
# cd httpd-2.0.44
# ./configure --prefix=/lamp --enable-so
# make
# make install
# /lamp/bin/apachectl start
### CONFIGURING MYSQL ###
# groupadd mysql
# useradd -R mysql mysql
# cd /usr/src
# tar -zxvf mysql-5.1.tar.gz
# cd mysql-5.1
# ./configure --prefix=/lamp/mysql
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
Here an option file is created. If you want to configure support for InnoDB tables you should edit the /etc/my.conf files remove the '#' character before the option lines that start with innodb_ and modify the option value to what u want.
# cd /lamp
# chown -R mysql mysql
# chgrp -R mysql mysql
This will change the owner and group of the directory mysql as mysql
# bin/mysql_install_db --user=mysql
This will create the mysql data directory /var in the /lamp directory.
# chown -R root mysql
# /lamp/bin/mysqll_safe --user=mysql &
This will start the mysql daemon.
# cd /usr/src/mysql-5.1
# cp support-files/mysql.server /etc/rc.d/init.d/mysql
# chmod +x /etc/rc.d/init.d/mysql
# chkconfig mysql on
These command will help you to start the mysql automatically when u boot up the system.
# /etc/rc.d/init.d/mysql start
Note:
Inorder to run the mysql commands from anyplace without having to specify the long path /lamp/mysql/bin.....
# ln -s /lamp/mysql/bin/$* /usr/bin/$*
This will create a symbolic link of all files residing in the /lamb/mysql/bin pointing to /usr/bin/
now you can run the mysqladmin command from the root dir itself.
# mysqladmin -u root password
# mysql -u root -p
Enter the previously given password.
U r in the mysql shell
mysql> show database;
quit;
That is it.. :-)
### CONFIGURING PHP ###
# cd /usr/src/
# tar -zxvf php-4.3.0.tar.gz
# cd php-4.3.0
# ./configure --prefix=/lamp/php --with-apxs2=/lamp/bin/apxs --with-config-file-path=/lamp/php --with-mysql
The second option --with-apxs2 point to the apxs file in the apache.
# make
# /lamp/bin/apachectl stop
# make install
This will install php module to Apache's modules sub-directory /lamp/modules and add a line like this "LoadModule php5_module /lamp/modules/libphp5.so" to the /lamp/conf/httpd.conf. This line allows apache to automatically load PHP modules when Apache starts.
Now add the line "AddType application/x-httpd-php .php" to /lamp/conf/httpd.conf so that Apache invokes php parser whenever a file with extension (.php) is accessed.
Now create a file with extension phpinfo.php in the directory /lamp/htdocs
and enter the below code:
phpinfo();
?>
# /lamp/bin/apachectl start
Now open the browser and check the url http://localhost/phpinfo.php
There you can see all the information about apache, php and mysql and lot more.
:-)
##### LAMP CONFIGURATION ####
#Created By : JINO JOSEPH ###
#Created Date : 23-10-2010 ##
#############################
### CONFIGURING APACHE ###
1. Go to the directory where the downloaded packages reside. In my case it is at/usr/src
# cd /usr/src
Now uncompress and extract the file httpd-2.0.44.tar.gz
# tar -zxvf httpd-2.0.44.tar.gz
This will create a folder httpd-2.0.44
# cd httpd-2.0.44
# ./configure --prefix=/lamp --enable-so
# make
# make install
# /lamp/bin/apachectl start
### CONFIGURING MYSQL ###
# groupadd mysql
# useradd -R mysql mysql
# cd /usr/src
# tar -zxvf mysql-5.1.tar.gz
# cd mysql-5.1
# ./configure --prefix=/lamp/mysql
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
Here an option file is created. If you want to configure support for InnoDB tables you should edit the /etc/my.conf files remove the '#' character before the option lines that start with innodb_ and modify the option value to what u want.
# cd /lamp
# chown -R mysql mysql
# chgrp -R mysql mysql
This will change the owner and group of the directory mysql as mysql
# bin/mysql_install_db --user=mysql
This will create the mysql data directory /var in the /lamp directory.
# chown -R root mysql
# /lamp/bin/mysqll_safe --user=mysql &
This will start the mysql daemon.
# cd /usr/src/mysql-5.1
# cp support-files/mysql.server /etc/rc.d/init.d/mysql
# chmod +x /etc/rc.d/init.d/mysql
# chkconfig mysql on
These command will help you to start the mysql automatically when u boot up the system.
# /etc/rc.d/init.d/mysql start
Note:
Inorder to run the mysql commands from anyplace without having to specify the long path /lamp/mysql/bin.....
# ln -s /lamp/mysql/bin/$* /usr/bin/$*
This will create a symbolic link of all files residing in the /lamb/mysql/bin pointing to /usr/bin/
now you can run the mysqladmin command from the root dir itself.
# mysqladmin -u root password
# mysql -u root -p
Enter the previously given password.
U r in the mysql shell
mysql> show database;
quit;
That is it.. :-)
### CONFIGURING PHP ###
# cd /usr/src/
# tar -zxvf php-4.3.0.tar.gz
# cd php-4.3.0
# ./configure --prefix=/lamp/php --with-apxs2=/lamp/bin/apxs --with-config-file-path=/lamp/php --with-mysql
The second option --with-apxs2 point to the apxs file in the apache.
# make
# /lamp/bin/apachectl stop
# make install
This will install php module to Apache's modules sub-directory /lamp/modules and add a line like this "LoadModule php5_module /lamp/modules/libphp5.so" to the /lamp/conf/httpd.conf. This line allows apache to automatically load PHP modules when Apache starts.
Now add the line "AddType application/x-httpd-php .php" to /lamp/conf/httpd.conf so that Apache invokes php parser whenever a file with extension (.php) is accessed.
Now create a file with extension phpinfo.php in the directory /lamp/htdocs
and enter the below code:
phpinfo();
?>
# /lamp/bin/apachectl start
Now open the browser and check the url http://localhost/phpinfo.php
There you can see all the information about apache, php and mysql and lot more.
:-)
Comments