Bye
四、安装Apache
1、下载:apache2.2.11
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget
http://archive.apache.org/dist/httpd/httpd-2.2.11.tar.gz
[root@localhost src]# chmod +x httpd-2.2.11.tar.gz
[root@localhost src]# tar -zxvf httpd-2.2.11.tar.gz
3)设置编译器的编译参数
[root@localhost src]# cd httpd-2.2.11
[root@localhost httpd-2.2.11]# ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite=share --enable-proxy=share --enable-proxy-ajp=share --enable-dav=share --enable-dav-fs
#注解:
--prefix=/usr/local/apache2
设置Apache安装目录。这里设定安装在/usr/local/apache2下,今后如果要卸载或者升级Aapche时,直接删除这个目录即可。
--enable-so
指定允许DSO(动态共享对像)
--enable-rewrite=share
开启Rewrite支持,以实现URL静态化,建议开启。
--enable-dav-fs
开启WebDAV支持,svn服务器等需要。附:《
》
#其它的额外设置请使用./configure --help来查看。
4)编译和安装:
[root@localhost httpd-2.2.4]# make; make install
#如果没有错误的话,那么Apache就已经安装在/usr/local/apache2目录中了
3、启动服务:
[root@localhost httpd-2.2.4]# /usr/local/apache2/bin/apachectl start
4、确定启动状:
[root@localhost apache2]# netstat -utl
tcp 0 0 *:http *:* LISTEN
#看到上面这行就表示你的Apache已经启动。
#用浏览器访问,看到It works!,说明apache已经安装成功了,恭喜您!
4.1:修改默认启动页
vi /usr/local/apache2/conf/httpd.conf
DirectoryIndex index.html 改为
DirectoryIndex index.html index.htm default.htm default.html index.php index.php3 index.jsp
4.2 apache 开机启动的办法
1:#echo "/usr/local/apache/bin/apachectl start" >>/etc/rc.local(系统启动时服务自动启动)
2:创建一个httpd启动脚本,内容如下:
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
在第三行添加以下内容
#chkconfig:345 85 15
#description: Start and stops the Apache HTTP Server.
chmod +x /etc/rc.d/init.d/httpd
chkconfig --add httpd
五、安装PHP
1、下载:php5.2.9
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]#
http://ftp.gamearena.cn/software/php-5.2.9.tar.gz
[root@localhost src]# chmod +x php-5.2.9.tar.gz
[root@localhost src]# tar -zxvf php-5.2.9.tar.gz
2、设置编译器的编译参数
[root@localhost src]# cd php-5.2.9
[root@localhost src]# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr/local/mysql --enable-zip --with-bz2 --with-jpeg-dir --with-png-dir --with-freetype-dir --with-libxml-dir=/usr/local/libxml2 --with-zlib-dir --with-gd --enable-gd-native-ttf --with-curl --with-curlwrappers --with-ttf --with-xsl --with-gettext --with-pear --enable-mbstring --enable-sockets --enable-magic-quotes --disable-debug --with-mime-magic=/usr/share/file/magic.mime --enable-trans-sid --with-xml --enable-short-tags --disable-posix --enable-memory-limit --with-openssl
评论