四.安装apache的源代码并进行编译安装和调试
1:tar -jxvf httpd-2.2.19.tar.bz2 -C /usr/local/src 对该源码进行解压缩
httpd-2.2.19/server/request.c
httpd-2.2.19/server/config.c
httpd-2.2.19/server/error_bucket.c
httpd-2.2.19/server/gen_test_char.c
httpd-2.2.19/server/mpm_common.c
httpd-2.2.19/server/.indent.pro
cd /usr/local/src
cd httpd-2.2.19
2.[root@ www.linuxidc.com-httpd-2.2.19]#./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-ssl --enable-so --with-z
3:[root@ www.linuxidc.com-httpd-2.2.19]#make 对源码进行编译
/mpm/prefork/libprefork.la os/unix/libos.la -lm /usr/local/src/httpd-2.2.19/srclib/pcre/libpcre.la /usr/local/src/httpd-2.2.19/srclib/apr-util/libaprutil-1.la -lexpat /usr/local/src/httpd-2.2.19/srclib/apr/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl
make[1]: Leaving directory `/usr/local/src/httpd-2.2.19'
4:[root@ www.linuxidc.com-httpd-2.2.19]# make install 对源码进行安装
Installing header files
Installing build system files
Installing man pages and online manual
mkdir /usr/loacl/apache/man
mkdir /usr/loacl/apache/man/man1
mkdir /usr/loacl/apache/man/man8
mkdir /usr/loacl/apache/manual
make[1]: Leaving directory `/usr/local/src/httpd-2.2.19'
5: [root@ www.linuxidc.com ~]# cd /etc/httpd/
[root@ www.linuxidc.com httpd]# ll
total 96
drwxr-xr-x 2 root root 4096 Mar 18 21:35 extra
-rw-r--r-- 1 root root 13422 Mar 18 21:35 httpd.conf
-rw-r--r-- 1 root root 12958 Mar 18 21:35 magic
-rw-r--r-- 1 root root 49815 Mar 18 21:35 mime.types
drwxr-xr-x 3 root root 4096 Mar 18 21:35 original
[root@ www.linuxidc.com httpd]# vim httpd.conf 改写主配置文档



6:测试
cd /usr/local/apache/htdocs
vim index.html

7:修改系统的环境变量
Vim /etc/profile

. /etc/profile 重新读取系统的环境变量的配置文件
[root@ www.linuxidc.com htdocs]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/MySQL/bin:/root/bin:/usr/local/mysql/bin:/usr/local/apache/bin
对库文件进行连接
cd /etc/ld.so.conf/
vim httpd.conf
/usr/local/apache/lib
apachectl stop
apachectl start
[root@ www.linuxidc.com ld.so.conf.d]# netstat -tupln |grep httpd
五:安装php的源码并进行配置和调试
1:tar –jxvf php-5.3.7.tar –C /usr/local/src 对源码进行解压缩
2: cd /usr/local/src/php-5.3.7 切换到php的目录下
3:[root@ www.linuxidc.comphp-5.3.7]#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring=all
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
4:make 进行编译
5:make install 进行安装
6:vim /etc/httpd/httpd.conf 修改主配置文件

