Apache 学习笔记
来源:互联网 发布:java程序代码及结果 编辑:程序博客网 时间:2024/05/20 17:07
命令节
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学习笔记
- Apache学习笔记
- Apache学习笔记
- Apache学习笔记
- apache学习笔记
- Apache学习笔记 车东
- Apache学习笔记
- Apache学习笔记
- [转载]apache学习笔记
- Apache Log4j 学习笔记
- Apache Log4j 学习笔记
- Apache学习笔记
- Apache CXF 学习笔记
- apache POI 学习笔记
- Apache Log4j 学习笔记
- Apache Log4j 学习笔记
- Apache Log4j 学习笔记
- Apache Log4j 学习笔记
- 常用互动方法
- 必须要知道的Delegate
- Android.mk 样例
- Git使用
- 2015,那些用在智能家居里的技术
- Apache 学习笔记
- 2015高教社杯全国大学生数学建模竞赛题目
- 通过C#代码实现空间离散点的克里金(kriging)插值(二) 代码实现
- Python爬虫——爬取网页中的图片小试牛刀
- BaseModel
- 秒杀多线程第七篇 经典线程同步 互斥量Mutex
- SDL2.0学习笔记——事件处理
- JavaScript的那些坑之变量提升
- 【南理oj】14 - 会场安排问题(贪心算法)