apache2.4配置

注册apache2.4为系统服务

切换到bin目录下,运行   httpd -k install

注销系统服务

切换到bin目录下,运行httpd -k uninstall

命令行运行

切换到bin目录下,运行  httpd -t 

1、解压版。

解压至相应目录。

2、修改conf目录下httpd.conf文件

3、修改38、39行

Define SRVROOT "d:/Apache24"

ServerRoot "d:/apache24"

4、修改监听端口,60行

Listen 80

5、去掉所有proxy注释

6、修改ServerAdmin,215行

ServerAdmin [email protected]

7、修改servername ,224行

ServerName www.sjy.net.cn:80

8、修改SRVROOT,248、249行

DocumentRoot "${SRVROOT}/htdocs"

DocumentRoot "d:/apache24/htdocs"

9、修改    ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"  365行

ScriptAlias /cgi-bin/ "d:/apache24/cgi-bin/"

10、利用命令行运行的方式,根据提示,放开权限,去掉注释。

httpd-vhosts.conf配置

1、

DocumentRoot "d:/apache24/htdocs"

2、
        ServerName xxx.xxx.gov.cn
        ServerAlias www.xxx.net.cn
        DocumentRoot "D:/webroot/andacms/export/sjzedu"

AllowOverride none
Require all granted




        ErrorDocument 404 /index.html
        ErrorDocument 403 /index.html


        ProxyPass /edu http://xxx.xxx.xxx.xxx/edu
        ProxyPassReverse /edu http://xxx.xxx.xxx.xxx/edu


        ProxyPass /report_sjy http://xxx.xxx.xxx.xxx:9002/report_sjy
        ProxyPassReverse /report_sjy http://xxx.xxx.xxx.xxx:9002/report_sjy


        ProxyPass /dynamic http://127.0.0.1:8080/andacms/export/sjzedu/dynamic
        ProxyPassReverse /dynamic http://127.0.0.1:8080/andacms/export/sjzedu/dynamic


        DirectoryIndex index.html


你可能感兴趣的:(apache24配置)