[b]步骤[/b]
shell> cp httpd-2.2.17.tar.bz2 /usr/local
shell> cd /usr/local
shell> tar -jxvf httpd-2.2.17.tar.bz2
shell> cd httpd-2.2.17
shell> ./configure --prefix=/usr/local/apache --enable-so
# --enable-rewrite --enable-mods-shared=most
说明:
--enable-so选项:让Apache可以支持DSO模式,注意,这里采纳使用地是Apache2.0地 语法。如果你地Apache是1.3版本,应改为--enable-module=so。
--enable-mods-shared=most选项:告诉编译器将所有标准模块都编译为DSO模块。你要是用地是Apache1.3,改为--enable-shared=max就可以。
--enable-rewrite选项:支持地址重写功能,运用1.3版本地朋友请将它改为--enable-module=rewrite。
shell> make
shell> make install
shell> apachectl start
启动apache 完整地命令为:/usr/local/apache/bin/apachectl start
现在测试一下,http://IP ,你会看到apache地默认界面
shell>htmlview 127.0.0.1
[b]修改apache的端口[/b]
shell>cd /etc/httpd/conf
shell>vi httpd.conf
修改listen 80 为 listen 8080
修改servername localhost:8080
[b]apache开机启动[/b]
shell>cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
shell>vi /etc/init.d/httpd
在在#!/bin/sh后面加入下面两行
#chkconfig:345 85 15
#description: Start and stops the Apache HTTP Server.
shell>chmod +x /etc/rc.d/init.d/httpd
shell>chkconfig --add httpd
然后可以用setup命令进入服务设置,设置为开机启动
shell> cp httpd-2.2.17.tar.bz2 /usr/local
shell> cd /usr/local
shell> tar -jxvf httpd-2.2.17.tar.bz2
shell> cd httpd-2.2.17
shell> ./configure --prefix=/usr/local/apache --enable-so
# --enable-rewrite --enable-mods-shared=most
说明:
--enable-so选项:让Apache可以支持DSO模式,注意,这里采纳使用地是Apache2.0地 语法。如果你地Apache是1.3版本,应改为--enable-module=so。
--enable-mods-shared=most选项:告诉编译器将所有标准模块都编译为DSO模块。你要是用地是Apache1.3,改为--enable-shared=max就可以。
--enable-rewrite选项:支持地址重写功能,运用1.3版本地朋友请将它改为--enable-module=rewrite。
shell> make
shell> make install
shell> apachectl start
启动apache 完整地命令为:/usr/local/apache/bin/apachectl start
现在测试一下,http://IP ,你会看到apache地默认界面
shell>htmlview 127.0.0.1
[b]修改apache的端口[/b]
shell>cd /etc/httpd/conf
shell>vi httpd.conf
修改listen 80 为 listen 8080
修改servername localhost:8080
[b]apache开机启动[/b]
shell>cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
shell>vi /etc/init.d/httpd
在在#!/bin/sh后面加入下面两行
#chkconfig:345 85 15
#description: Start and stops the Apache HTTP Server.
shell>chmod +x /etc/rc.d/init.d/httpd
shell>chkconfig --add httpd
然后可以用setup命令进入服务设置,设置为开机启动