650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/46/41/wKiom1Pw65biGPJNAAEYuxkAyMg214.jpg "title=" image 016. PNG "alt=" wkiom1pw65bigpjnaaeyuxkaymg214.jpg "/>
Installing the Web (compiled and installed here) 1, httpd-2.4.2 requires a newer version of APR and Apr-util, so it needs to be upgraded beforehand. There are two ways to upgrade, one is to compile the installation through the source code, one is to upgrade the RPM package directly, download the installation package and then use "RPM-UVH" to upgrade. Here you choose to make the source code compiled and installed.
Note: Do not forget to install the development environment before installing these packages
Yum-y Groupinstall "Development Tools"
Yum-y Groupinstall "Development Libraries"
Compile and install Apr and Apr-util
Tar XF apr-1.4.6.tar.bz2
./configure--PREFIX=/USR/LOCAL/APR
Make && make install
Tar XF apr-util-1.4.1.tar.bz2
./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR
Make && make install
Yum Install Pcre-devel Openssl-devel
Compiling and installing httpd-2.4.2.tar.bz2
Tar XF httpd-2.4.2.tar.bz2
CD httpd-2.4.2
./configure--prefix=/usr/local/apache--enable-so--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util
Make && make install
In order to save time, there are not so many parameters to add.
Learn more about compiling parameters please./configure--help to view
Third, compile and install PHP
Tar XF php-5.4.4.tar.bz2
CD php-5.4.4
./configure--prefix=/usr/local/php--with-mysql=/usr--enable-mbstring--with-freetype-dir--with-jpeg-dir-- With-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--with-apxs2=/usr/local/apache/bin/apxs-- With-config-file-path=/etc--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2
Make && make install
Provide a configuration file for PHP
CP Php.ini-production/etc/php.ini
Edit Apache config file, let Apache support PHP
Vim/etc/httpd/httpd.conf
Check if the Libphp5.so module is added and open
Find the <ifmodule mime_module> module and add it inside
AddType application/x-httpd-php. php
Position to: DirectoryIndex index.html
Modified to: DirectoryIndex index.php index.html
Add a virtual host edit httpd.conf configuration file you need to modify the following
Vim/usr/local/apache/conf/httpd.conf
LoadModule Log_config_module modules/mod_log_config.so
Include/etc/httpd/extra/httpd-vhosts.conf
#DocumentRoot "/usr/local/apache/htdocs"/Add a # to the front, comment out/
Save exit
Vim/usr/local/apache/conf/extra/httpd-vhosts.conf
<virtualhost *:80>
ServerName www.test.com
Documentroot/www
<directory "/www" >
Options indexes
allowoverride None
Require all granted
</Directory>
</VirtualHost>
Restart httpd command:/usr/local/apache/bin/apachectl restart
Write a PHP test script: Echo "<?php phpinfo ();?>" >/www/index.php
Test result http://172.16.0.22/index.php
The following NFS configuration is then used to mount the following commands:
Mount-t NFS 172.16.0.24:/www/users/test.com/www
Second, server2:172.16.0.23 (Mysql)