Apache 学习笔记
2016-01-06 21:13
741 查看
命令节
1.安装apache服务:
d:\apache2.4\Apache24\bin\httpd -k install
2.停止apache服务:
d:\\apache2.4\Apache24\bin\httpd -k uninstall -n apache2.4
3.启动apache服务:
d:\Software\phptools\apache2.4\Apache24\bin\httpd.exe -w -n "Apache2.4" -k start
配置节
1.配置虚拟目录
从httpd.conf中找到“<IfModule alias_module>”,在其中加入以下代码:
Alias /DemoSite "D:/AppServ/www2"
<Directory "D:/AppServ/www2">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
整个<IfModule alias_module>如下:
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "D:/Software/phptools/apache2.4/Apache24/cgi-bin/"
Alias /DemoSite "D:/AppServ/www2"
<Directory "D:/AppServ/www2">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</IfModule>
站点为“DemoSite”,虚拟路径为“D:/AppServ/www2”。
重启Apache,则会报错,是因为访问权限问题,添加以下配置即可解决。
找到<Directory />节点,在其中加入如下内容:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
Satisfy all
<Directory />节点的配置如下:
<Directory />
# AllowOverride none
# Require all denied
Options FollowSymLinks
AllowOverride None
Order deny,allow
# Deny from all
Allow from all
#允许所有访问
Satisfy all
</Directory>
或者找到<Directory "path">配置项,将其中的“Allow from IP”注释掉即可。
继续完善。。。。。。
1.安装apache服务:
d:\apache2.4\Apache24\bin\httpd -k install
2.停止apache服务:
d:\\apache2.4\Apache24\bin\httpd -k uninstall -n apache2.4
3.启动apache服务:
d:\Software\phptools\apache2.4\Apache24\bin\httpd.exe -w -n "Apache2.4" -k start
配置节
1.配置虚拟目录
从httpd.conf中找到“<IfModule alias_module>”,在其中加入以下代码:
Alias /DemoSite "D:/AppServ/www2"
<Directory "D:/AppServ/www2">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
整个<IfModule alias_module>如下:
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "D:/Software/phptools/apache2.4/Apache24/cgi-bin/"
Alias /DemoSite "D:/AppServ/www2"
<Directory "D:/AppServ/www2">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</IfModule>
站点为“DemoSite”,虚拟路径为“D:/AppServ/www2”。
重启Apache,则会报错,是因为访问权限问题,添加以下配置即可解决。
找到<Directory />节点,在其中加入如下内容:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
Satisfy all
<Directory />节点的配置如下:
<Directory />
# AllowOverride none
# Require all denied
Options FollowSymLinks
AllowOverride None
Order deny,allow
# Deny from all
Allow from all
#允许所有访问
Satisfy all
</Directory>
或者找到<Directory "path">配置项,将其中的“Allow from IP”注释掉即可。
继续完善。。。。。。
相关文章推荐
- Apache Spark 初识
- linux服务器 Apache服务的源码安装与基本配置
- django apache error.log过大
- Apache Spark 1.6发布(新特性介绍)
- 【通信框架】Apache的开源通信框架thrift概述
- org.apache.log4j.Logger用法
- 入门: FreeBSD10.1+Apache2.4+PHP5.4+MySQL5.5
- chapter1 Apache ActiveMQ简介
- apache开源项目 --Struts
- apache开源项目--subversion
- apache开源项目--Syncope
- apache开源项目--Synapse
- apache开源项目 -- tez
- apache开源项目 -- tajo
- apache开源项目 -- tomee
- apache开源项目-- Turbine
- apache开源项目 -- Tuscany
- apache开源项目-- UIMA
- apache开源项目-- Usergrid
- apache开源项目-- Velocity