apache httpd搭建
最近负责开发一个项目,简单点说就是服务器端建立流程,通过页面设计器生成页面,android客户端下载服务器端生成的页面访问,android端使用phonegap开发。如果要开发整个项目,开发人员需要安装JDK,tomcat,eclipse,svn,mysql,navicat for mysql,android的开发环境等,这对于仅仅开发WEB端的人员来说就是梦魇,并且页面极难调试。后来,我考虑将WEB端的东西抽离出来,WEB开发人员仅仅关注页面展示就行了。我的做法是,在每个人机器上安装一个apache httpd服务器,然后在svn上建立文件夹,里面配好使用的js,css,images等,仅供静态页面开发的东西(目录、文件和服务器端开发的环境一样),这样就可以通过apache的服务器,直接访问自己制作的页面,而不用通过打包成apk在手机端看了,通过wifi,手机浏览器也可以访问本机的页面,调试也很方便。WEB开发人员调试没问题后,可以直接上传至SVN,服务器端开发人员可以直接使用这些页面,无需关注细节。
我安装的apache httpd服务器是windows版的,下载地址:
http://apache.fayea.com/apache-mirror//httpd/binaries/win32/
修改了apache安装目录下的httpd.conf
我的安装路径 E:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
[*] 修改服务器端口,我的改成了8091:
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8091
2. 修改服务访问的项目路径
"H:/webfront/trunk/test"就是我checkout的SVN的文件夹,test是静态页面项目
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "H:/webfront/trunk/test"
<Directory "H:/webfront/trunk/test">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
3.保存修改好的httpd.conf,重启服务器,在浏览器地址栏内http://localhost:8091/
就会打开test文件下得index.html等自己设置的首页
页:
[1]