반응형

Installation

To install, we first need to extract each package. To do this, go into the directory containing the 
files you have just downloaded. Then type the following command:

# tar -xzvf apache_1.3.xx.tar.gz (http://www.apache.org/dist/) 

# tar -xzvf mysql-3.23.xx.tar.gz (http://www.mysql.com/) 

# tar -xzvf php-4.x.x.tar.gz (http://www.php.net/) 

Next, We need to compile PHP and Apache. In this article we are going to opt for the fastest and best 
way to run PHP and Apache. That is by compiling them together into one executable. To do this, go into 
the apache directory and type the following:

# ./configure -prefix=/usr/local/apache

Next, Back out of the apache directory and go into the php directory. Then type the following:

# ./configure --with-mysql --with-xml --enable-track-vars --with-apache=../apache

# make 

# make install

Then, Back out again and go back into the apache directory and type:

# ./configure --prefix=/usr/local/apache --enable-module=rewrite --activate-module=src/modules/php4/libphp4.a

# make

# make install

This will compile and install Apache and PHP into the /usr/local/apache directory.

Now we need to compile and install the MySQL software. To do this, go into the mysql directory and type 
the following:

#./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-maintainer-mode --
with-mysqld-user=mysql --enable-large-files -without-debug

# make 

# make install 

This will compile MySQL and install its files to /usr/local/mysql. Next, We need to create the user 
account 'mysql'. This user account is the account mysql runs as. To do this type the following:

# groupadd mysql 

# useradd -g mysql mysql 

Then we need to install the database files and make some minor ownership changes as follows:

# ./scripts/mysql_install_db 

# chown -R root:mysql /usr/local/mysql 

# chown -R mysql:mysql /usr/local/mysql/data 

Then add the line to your '/etc/ld.so.conf' file:

/usr/local/mysql/lib/mysql 

Next we run the mysql daemon. To do this, type the following:

# cd /usr/local/mysql/bin 

# ./safe_mysqld --user=mysql & 

Finally, we set the root password of the mysql database. To do this, type the following:

# ./mysqladmin -u root password new_password

We should now have Apache, PHP, and MySQL compiled and installed. We now just need to configure them.

Configuration

To configure PHP, copy the php.ini-dist from the php directory to '/usr/local/lib/php.ini'. This file 
contains most of the settings you would want but you may want to edit it. The one setting you might want 
to enable is 'register_globals' to 'On' since a lot of PHP scripts use global variables for form data. 
Other than you may leave it unchanged.

NOTE: SimpleData v3.0 users should set the register_globals feature on for SimpleData to work properly.

Next we configure Apache. To do this open the file '/usr/local/apache/conf/httpd.conf ' and add the 
following line right after the line 'AddType image/x-icon .ico':

AddType application/x-httpd-php .php

Then we start the Apache daemon. To do this, type the following:

# /usr/local/apache/bin/apachectl start

To test our PHP and Apache setup create a file in the '/usr/local/apache/htdocs' directory called 
test.php and put the following code:

<? phpinfo(); ?>

Finally, Fire-up your web browser and point it to 'http://localhost/test.php' and you should see a php 
info webpage complete with settings of php.

Apache, MySQL, and PHP are all configured now and are ready to go!

Conclusion

Hopefully you found this article helpful. Please check back for our next tutorial.


'Tech: > Linux·PHP' 카테고리의 다른 글

Linux VMWare 설치  (0) 2008.06.26
PHP 암호화 모듈 설치  (0) 2008.06.26
기타 유용한 정보들  (0) 2008.06.26
XMLHttp 구현하기  (0) 2008.06.26
SAX(Simple Application for XML) 구현하기  (0) 2008.06.26


Posted by 떼르미
,
반응형


자바스크립트를 허용해주세요!
Please Enable JavaScript![ Enable JavaScript ]