CentOS Release 6.5 (Final) x86_64
Apache:
wget http://archive.apache.org/dist/httpd/httpd-2.2.27.tar.gz
Tar CD
./configure--prifix=/application/apache2.2.27--enable-deflate--enable-expires--enable-headers--enable-modules= Most--enable-so--with-mpm=worker--enable-rewrite
Yum Install-y zlib-devel
Make && make install
Ln-s/application/apache2.2.27//application/apache
Ll/application/apache/conf/httpd.conf
/application/apache/bin/apachectl-t
/application/apache/bin/apachectl Graceful
Ps-ef|grep httpd
Mqsql
wget https://downloads.mysql.com/archives/get/file/mysql-5.1.68.tar.gz
Tar CD
./configure--prefix=/application/mysql5.1.68/--with-unix-socket-path=/application/mysql5.1.68/tmp/mysql.sock-- Localstatedir=/application/mysql5.1.68/data--enable-assembler--enable-thread-safe-client--with-mysqld-user= MySQL--with-big-tables--without-debug--with-pthread--enable-assembler--with-extra-charsets=complex-- With-readline--with-ssl--with-embedded-server--enable-local-infile--with-plugins=partition,innobase-- With-mysqld-ldflags=-all-static--with-client-ldflags=-all-static--with-plugin-plugin
echo $?
Yum Install-y ncurses-devel
Make && make install
/home/oldboy/mysql-5.1.68/support-files/my-small.cnf/etc/my.cnf
/application/mysql/bin/mysql_install_db--basedir=/application/mysql--datadir=/application/mysql/data--user= Mysql
/home/oldboy/mysql-5.1.68/support-files/mysql.server/etc/init.d/mysqld
Login MySQL Test
Php
1.php Dependency Package
Yum install-y zlib libxml libpng libjpeg freetype gd Curl libiconv zlib-devel libxml2-devel Libpng-devel libjpeg-devel fr Eetype-devel gd-devel curl-devel libcronv-devel openssl-devel libcurl-devel libxslt-devel
2.php Pack
Http://php.net/get/php-5.3.27.tar.gz/from/a/mirror to local, upload to user home directory
Tar XF php-5.3.27.tar.gz
CD php-5.3.27
./configure--prefix=/application/php5.3.27--with-apxs2=/application/apache/bin/apxs--with-mysql=/application/ MySQL--with-xmlrpc--with-openssl--with-zib--with-freetype-dir--with-gd--with-jpeg-dir--with-png-dir-- With-iconv=/usr/local/libiconv--enable-short-tags--enable-sockets--enable-zend-multibyte--enable-soap-- Enable-mbstring--enable-gd-native-ttf--with-curl--with-xsl--enable-ftp--with-libxml-dir
Make
Make install
Ln-s/application/php5.3.27/application/php
CP Php.ini-production/application/php/lib/php.ini
/application/apache/conf/httpd.conf Modify Apache's
· LoadModule Php5_module modules/libphp5.so
· User www
· Group www
· ServerName 127.0.0.1:80
· DirectoryIndex index.php index.html
Useradd-m-s/sbin/nologin www
/application/apache/bin/apachectl Graceful
Test browser--index.html>>apache--index.php>>php--php Script >>mysql
PHP script Content
<?php
$link _id=mysql_connect (' localhost ', ' root ', ' 123456 ') or mysql_error ();
if ($link_id) { echo "php-->mysqk successful"; }else{ echo "php ->mysql error()"; }
?>
linux-apache-mysql-php