Apache HTTP Server使用指南,apache使用指南


 

Apache HTTP Server使用指南 1       修改历史

版本 修改历史  作者 描述 开发时间(h)
0.1 2007-8-7 LevinSoft 创建文档得基本结构、基本流程 1
0.2 2007-8-21 LevinSoft 增加启动方式 0.1
2       介绍 本文介绍Apache HTTP Server基本概念、代理功能配置步骤、操作注意事项和相关的参考资源。 3       基本概念 The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Apache has been the most popular web server on the Internet since April 1996. The November 2005 Netcraft Web Server Survey found that more than 70% of the web sites on the Internet are using Apache, thus making it more widely used than all other web servers combined. The Apache HTTP Server is a project of the Apache Software Foundation. 4       Apache HTTP Server代理功能配置 Apache HTTP Server具有IP代理的功能,这可以转换外网IP可以访问到内网IP。 4.1    安装步骤和相关配置 4.1.1            安装 在linux、unix下安装。 #tar -vzxf httpd-2.0.50.tar.gz #cd httpd-2.0.50 #./configure --prefix=/usr/local/apache2 --enable-track-vars --enable-proxy --enable-cgi --enable-so --enable-mods-shared=all --with-config-file-path=/usr/local/apache2/conf  #make #make install 4.2    配置步骤 这个以Window 2000为例,Linux的配置也类似。 4.2.1            设置apache动态代理服务器(Windows 2000) 假设apache安装在C:/ApacheGroup/Apache2下 打开conf目录下的httpd.conf文件 1)找到 #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so 把#去掉使动态代理模块生效 2)在文件的最后,添加如下配置选项 <VirtualHost 60.190.200.11:80>     ServerAdmin wangzm@channelsoft.com     DocumentRoot C:/ApacheGroup/Apache2/htdocs     ServerName 60.190.200.11     ProxyRequests Off     ProxyPass /test http://192.168.100.100:8080/test     ProxyPassReverse /test http://192.168.100.100:8080/test     ErrorLog logs/channelsoft.com-error_log     CustomLog logs/channelsoft.com common </VirtualHost> 说明: 60.190.200.11代表动态代理服务器apache的地址 ProxyPass和ProxyPassReverse代表当用户在浏览器中敲入test时跳转到内网的 Web服务器上. 4.2.2            设置内网web服务器 以Resin 应用服务器为例: 1.    开起内网web服务器的防火墙。运行setup->防火墙配置->启用 2.    修改resin.conf文件配置 打开resin应用服务器的resin.conf文件, 找到: <http port='8080'/> 修改为:<http host=’内网IP地址’ port='8080'/> 找到: <srun host='127.0.0.1' port='6803'/> 修改为: <srun host='内网IP地址' port='6803'/> 4.2.3            启动服务 1./usr/local/apache2/bin/./apachectl stop, start, restart 2.ps -ef|grep apache2 查看运行情况 4.2.4            检测配置是否生效 重新启动apache代理服务器和内网web服务器即可. 通过http:// 60.190.200.11/test(动态代理服务器)即可访问http://192.168.100.100:8080/test(内网web服务器)的内容。 4.3    常见问题解答和注意事项 1.Apache http server在unix,linux,windows有不同的版本。 2.一台主机上,允许有两个网卡,可以配置内网和外网ip。例如:外网IP是:60.190.247.11;内网ip地址是:192.168.1.11为,端口号是:8080, 3.配置时,一定要设置带proxy的so文件。 4.可以在配置文件中的virtualhost标签内部,设置循环代理的操作,就是有一个代理路径调转到,另外的一个新的proxy服务器! 5.Apache http server当前只能代理http,不能代理ftp。 4.4    配置实例 <VirtualHost 134.96.71.120:80>     ServerAdmin wangzm@channelsoft.com     DocumentRoot /usr/local/apache2/htdocs     ServerName 134.96.71.120    ProxyRequests Off     ProxyPass /test http://134.96.71.27:8080/boss     ProxyPassReverse /test http://134.96.71.27:8080/boss     ProxyPass /vpm http://134.96.71.28/vpm     ProxyPassReverse /vpm http://134.96.71.28/vpm     ErrorLog logs/test_error.log     CustomLog logs/test.log commom </VirtualHost> 5       总结和展望 a)      简单的总结前面知识 b)      今后的提高部分 6       参考资料 1.    http://httpd.apache.org/ 2.      7       术语和附录

相关内容

    暂无相关文章