因为需要在我的主机上支持J2EE和ROR,所以我就选择安装Apache,虽然有lighttpd这个选择,但我觉得还是Apache更稳定,毕竟我们公司都是用YApache的。
安装Apache
先把 Apache 2.0.59 下载到 /home/用户目录/Devtools 下,然后加压缩到/usr/local/src/目录
1 shell> cd /usr/local/src 2 shell> tar -zxvf httpd-2.0.59.tar.gz view plain | print | copy to clipboard | ? shell> cd /usr/local/src
shell> tar -zxvf httpd-2.0.59.tar.gz 然后进入httpd目录新建一个编译脚本,方便维护和以后升级。每次执行下面的setup.sh就可以安装了(前提是安装libxml2库、zlib库)
1 #!/bin/bash 2 ./configure --prefix=/opt/apache 3 --enable-so 4 --enable-rewrite 5 --enable-dav 6 --enable-info 7 --enable-cgid 8 --enable-mime-magic 9 --enable-alias 10 --enable-access 11 --enable-deflate 12 --enable-proxy 13 --enable-proxy-http 14 --enable-forward 15 16 make 17 make install view plain | print | copy to clipboard | ? #!/bin/bash
./configure --prefix=/opt/apache
--enable-so
--enable-rewrite
--enable-dav
--enable-info
--enable-cgid
--enable-mime-magic
--enable-alias
--enable-access
--enable-deflate
--enable-proxy
--enable-proxy-http
--enable-forward
make
make install
这样就可以把制定的模块静态编译到Apache里,而且也支持动态加载模块。
把Apache当作服务启动
1 shell> cp /opt/apache/bin/apachectl /etc/rc.d/init.d/httpd 2 shell> chmod 700 /etc/rc.d/init.d/httpd 3 shell> chkconfig –add httpd 4 shell> chkconfig –level 345 httpd on 5 shell> service httpd start 6 shell> netstat -atln view plain | print | copy to clipboard | ? shell> cp /opt/apache/bin/apachectl /etc/rc.d/init.d/httpd
shell> chmod 700 /etc/rc.d/init.d/httpd
shell> chkconfig –add httpd
shell> chkconfig –level 345 httpd on
shell> service httpd start
shell> netstat -atln
现在可以看到80端口已经开始监听了,访问自己的ip也可以看到Apache的欢迎界面:)
http://www.zhangzhang.net/articles/2006/09/03/Linux-Installs-Apache2
安装Apache
先把 Apache 2.0.59 下载到 /home/用户目录/Devtools 下,然后加压缩到/usr/local/src/目录
1 shell> cd /usr/local/src 2 shell> tar -zxvf httpd-2.0.59.tar.gz view plain | print | copy to clipboard | ? shell> cd /usr/local/src
shell> tar -zxvf httpd-2.0.59.tar.gz 然后进入httpd目录新建一个编译脚本,方便维护和以后升级。每次执行下面的setup.sh就可以安装了(前提是安装libxml2库、zlib库)
1 #!/bin/bash 2 ./configure --prefix=/opt/apache 3 --enable-so 4 --enable-rewrite 5 --enable-dav 6 --enable-info 7 --enable-cgid 8 --enable-mime-magic 9 --enable-alias 10 --enable-access 11 --enable-deflate 12 --enable-proxy 13 --enable-proxy-http 14 --enable-forward 15 16 make 17 make install view plain | print | copy to clipboard | ? #!/bin/bash
./configure --prefix=/opt/apache
--enable-so
--enable-rewrite
--enable-dav
--enable-info
--enable-cgid
--enable-mime-magic
--enable-alias
--enable-access
--enable-deflate
--enable-proxy
--enable-proxy-http
--enable-forward
make
make install
这样就可以把制定的模块静态编译到Apache里,而且也支持动态加载模块。
把Apache当作服务启动
1 shell> cp /opt/apache/bin/apachectl /etc/rc.d/init.d/httpd 2 shell> chmod 700 /etc/rc.d/init.d/httpd 3 shell> chkconfig –add httpd 4 shell> chkconfig –level 345 httpd on 5 shell> service httpd start 6 shell> netstat -atln view plain | print | copy to clipboard | ? shell> cp /opt/apache/bin/apachectl /etc/rc.d/init.d/httpd
shell> chmod 700 /etc/rc.d/init.d/httpd
shell> chkconfig –add httpd
shell> chkconfig –level 345 httpd on
shell> service httpd start
shell> netstat -atln
现在可以看到80端口已经开始监听了,访问自己的ip也可以看到Apache的欢迎界面:)
http://www.zhangzhang.net/articles/2006/09/03/Linux-Installs-Apache2
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/579/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2007-8-6 10:21
评论列表