Apache 配置
来源:互联网 发布:linux hba卡 编辑:程序博客网 时间:2024/06/07 22:25
apache安装目录下的 conf 文件夹下的 httpd.conf(主配置文件,全局配置文件),vhosts.conf(虚拟主机配置文件,优先级高)
一、httpd.conf全局配置文件中:
1、DocumentRoot "E:\WWW" #用来指定网站的根目录。注释必须要另起一行,单独占一行。
2、DirectoryIndex index.html index.php index.htm l.php #用来指定网站的默认首页,多个首页之间用空格隔开。
3、Listen 80 #监听端口号,也可以监听一个或多个ip、ip网段。
4、<Directory /> #设置外部客户端的访问权限
Options -Indexes +FollowSymLinks +ExecCGI #如果首页不存在,是否显示列表(None,All,Indexes)
AllowOverride All
Order allow,deny #指定Deny(禁用)和Allow(允许)的执行顺序
Deny from all #禁止所有ip访问
Allow from all #允许所有ip访问
Require all granted
</Directory>
5、NameVirtualHost *:80 #指定虚拟主机
Include conf/vhosts.conf #虚拟主机的配置文件的位置
二、vhosts.conf虚拟主机配置文件中
1、配置本地的DNS文件——hosts文件 (C:\Windows\System32\drivers\etc\hosts)
127.0.0.1 www.域名.com
2、配置Apache的主配置文件——httpd.conf
Listen 80 #监听80端口,这个端口必须和下面vhosts.conf文件中的*:80端口对应。
3、配置Apache的虚拟主机——vhosts.conf
DocumentRoot "E:\WWW\web1"
ServerName www.123.com
DirectoryIndex index.html index.php
ServerAlias
<Directory "D:\phpStudy\WWW\web1">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
阅读全文
0 0
- apache配置
- Apache配置
- apache配置
- 配置 apache
- apache配置
- Apache配置
- apache配置
- Apache配置
- apache配置
- Apache配置
- apache配置
- apache配置
- Apache配置
- Apache配置
- apache配置
- apache配置
- apache配置
- Apache配置
- 第一次机房收费系统--模块(三)
- Codeforces Round #427 (Div. 2)B. The number on the board
- Linux中vim编辑器
- RxJava2.0 基本使用,和场景
- python导入caffe时出现python caffe报错:No module named google.protobuf.internal
- Apache 配置
- 基于servlet的验证码实现
- ACM-素数专题(持续更新)
- Ionic3学习笔记(八)使iOS端、Android端 Navbar 透明化
- qdoor/images
- postgresql 常用知识点总结列表
- LeetCode刷题(43)--Combinations
- Java并发之Executors简介
- LeNet详解