apache服务器设置

服务器目录

目录说明

    bin: apache常用的一些命令

    cgi-bin:存放一些脚本语言命令

    conf:apache配置文件

    error:错误记录

    htodcs存放站点文件

    logs:记录日志

    modules:存放apache模块(动态库)

虚拟目录

指定某个目录为虚拟目录(e:/virtual)

编辑httpd.conf文档

① 指定虚拟目录

<IfModule dir_module>

#欢迎页面,默认访问页面

DirectoryIndex index.php index.php3 index.html index.htm

#站点别名

#D:/  test下有个a.html,则访问方式为www.yourweb.com/test/a.html

Alias  /test  D:/test

</IfModule>

② 设置访问权限

<Directory D:/test>

Order allow,deny

Deny from all //拒绝所有访问者

Allow from localhost //放行localhost

</Directory>

虚拟主机配置

启用虚拟主机设置

Include conf/extra/httpd-vhosts.conf

编辑httpd-vhosts.conf设置虚拟主机

<VirtualHost *:80>

    ServerAdmin webmaster@dummy-host2.hleclerc-PC.ingenidev

    DocumentRoot "E:/PHP/"

//一台服务器上可能有多个虚拟主机

//使用ServerName以便加以区分

ServerName www.dy-pc.com

    <Directory "E:/PHP/">

Options FollowSymLinks

//设置不允许被覆盖

    AllowOverride None

    Order deny,allow

    allow from all

</Directory>

 apache配置命令



转载于:https://www.cnblogs.com/xidongyu/p/6371809.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值