The new version of mysql+apache+php Linux installation guide

  

just saw someone posted the installation steps under win, just today the new server of the company website, spent a morning to install mysql+php+apache.

The new version of the old version is still somewhat different. Now put the steps to install the steps:

1.mysql

Download mysql for linux rpm package on the following page

http://www.mysql.com/downloads /down...3.52-1.i386.rpmhttp://www.mysql.com/downloads/down...3.52-1.i386.rpm

Save to /home/tmp directory

Command list:

cd /home/tmp rpm -ivh mysql-3.23.52-1.i386.rpm //#Install mysql server rpm -ivh mysql-client-3.23.52-1. I386.rpm //#Install mysql client /usr/mysql/safe_mysqld & //#Start mysql server mysql //#Run mysql client and open remote access for root user to debug use mysql update user set host = '%' where user = 'root' and host <> 'localhost'; flush privileges; quit //This mysql installation is complete

2.apache

Download apache on the following page Source package for linux

http://www.apache.org/dist/httpd/apache_1.3.26.tar.gz

Save to /home/tmp directory

Command list: cd /home/tmp tar -zxvf apache_1.3.26.tar.gz mv apache_1.3.26.tar.gz apache cd apache ./configure --prefix= /usr/local/apache --enable-module=so make make install Install apache to /usr/local/apache //and configure apache to support dso mode

3.php

Page download php for linux source package

http://www.php.net/get_download.php?df=php-4.2.3.tar.gz

Save to /home /tmp directory

Command list:

cd /home/tmp tar -zxvf php-4.2.3.tar.gz mv php-4.2.3.tar.gz php cd php ./Configure --prefix=/usr/local/php --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/lib --enable-track-vars --with-xml --with-mysql make make install cp php.ini-dist /usr/local/lib/php.ini

Install php as dso /usr/local/php Set the configuration file directory to /usr/local/lib Open mysql, xml support

4.Configure

vi /usr/local/apache/conf/httpd.conf

Do the following configuration for apache

#Change the line of ServerAdmin [email protected] to your email address #DocumentRoot "/home/httpd/html/" here is the html file Main directory #同上#Options FollowSymLinks MultiViews For security reasons, remove "Indexes" # # DirectoryIndex default.php default.phtml default.php3 default.html default.htm # #Set apache default file name order #AddType application/x- Httpd-php .php .phtml .php3 .inc #AddType application/x-httpd-php-source .phps #Set php file suffix

Save disk exit

vi /usr/local/lib /php.ini

#register-golbals = On //Save and exit

5.Start the service

/usr/local/apache/bin/apachectl start

6.Remarks

The default maximum number of apaches in linux is 256. No matter how you modify httpd.conf, you can't exceed this limit. If you want to increase this limit, edit /home/tmp/apache/src/include/httpd.h before compiling apache, and change the #define HARD_SERVER_LIMIT 256 line to #define HARD_SERVER_LIMIT 2048 and compile apache again,

apache 1.3.26 mod_so seems to be no longer the default module. Compile time need to add --enable-module=so, I did not add this parameter for the first time, the results can not find apxs php compiler

php 4.2.3 The default configuration file path seems to have changed. Compile time need to add --with-config-file-path=/usr/local/lib parameters, I compiled php.ini for the first time put n places are useless. Last resort. Only this parameter can be added.

ps There is no guarantee that the steps described in this article will apply to other versions

Attachment: Download the relevant file

php: http://www.php.net/get_download.php Df=php-4.2.3.tar.gz

apache: http://www.apache.org/dist/httpd/apache_1.3.26.tar.gz

mysql server: Http://www.mysql.com/downloads/down...3.52-1.i386.rpm

mysql client:


http://www.mysql.com/downloads/Down...3.52-1.i386.rpm

Copyright © Windows knowledge All Rights Reserved