Apache虚拟目录和默认首页的设置,用apache服务器的朋友必须要懂的。

虚拟目录
1.找到"conf/httpd.conf" 文件
2.在节点:<IfModule alias_module>里增加
Alias /aidd2008 "D:/php/web/aidd2008"
其中 aidd2008 是你想要访问的虚拟目录; D:/php/web/aidd2008 为物理路径,以[/]代替[\]"
我们就在</IfModule>后面接着加:
复制代码 代码如下:

<Directory "D:/php/web/aidd2008">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

(*)aidd2008 为虚拟目录名称,一般不用在名称后加"/",若加入,每次都要在虚拟目录后输入"/"才能访问网站 www.jbxue.com。

Alias /gt "D:/PHP/gt"

<Directory "D:/PHP/gt">
  <IfModule php5_module>
    <Files "index.php">
      php_admin_flag safe_mode off
    </Files>
  </IfModule>
  AllowOverride AuthConfig
  Order allow,deny
  Allow from all
</Directory>

3.重启Apache

设置默认页面
方法1 设置全局的:
<IfModule dir_module>

DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml default.php
</IfModule>

方法2 针对某一目录可以这么设置:
Alias /aidd2008 "D:/php/web/aidd2008"

<Directory "D:/php/web/aidd2008">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex default.php
</Directory>

Apache 虚拟目录和默认首页的设置的更多相关文章

  1. 【PHP编程之路-1】设置apache虚拟目录

    概述 设置apache虚拟目录 1.开启“虚拟目录配置文件”httpd-vhosts.conf 文件路径:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-v ...

  2. Apache虚拟目录

    Apache虚拟目录  1.打开Apache的配置文件httpd.conf,并去掉#Include conf/extra/httpd-vhosts.conf前面的#! 2.在httpd.conf 末尾 ...

  3. apache虚拟目录配置实例

    apache虚拟目录配置实例 一.首先,开启虚拟主机配置 在文件httpd.conf中找到: include conf/extra/httpd-vhosts.conf #开启 二.对httpd-vho ...

  4. 在apache虚拟目录配置

    在apache虚拟目录配置中 <VirtualHost *:80>xxx xxx xxx</VirtualHost> 不能写成 <VirtualHost *>xxx ...

  5. Ubuntu 配置Apache虚拟目录

    http://blog.csdn.net/spring21st/article/details/6589300 Ubuntu 配置Apache虚拟目录 http://blog.csdn.net/spr ...

  6. Apache虚拟目录(二)

    一.PHP生命周期 二.轻量级的PHP 轻量级PHP产品由lighttpd,nginx等等 Apache是基于模块化设计的 了解Apache源代码可以从main.c开始 操作系统上跑了APR运行库 m ...

  7. ubuntu18.04LTS配置apache虚拟目录(基于端口)

    假设在用户目录下要新建两个虚拟目录web1,web2,分别对应端口8081,8082 $ cd ~ #切换到用户目录 $ mkdir www #新建www文件夹,以后新建的虚拟目录都放在该文件夹下 $ ...

  8. apache 虚拟目录

    补充:必须使用80端口才能正常使用  C:\Windows\System32\drivers\etc\hosts 最后添加上: 127.0.0.1 shenyi.com 127.0.0.1 offli ...

  9. apache虚拟目录设置

    <VirtualHost *:80> DocumentRoot "/xampp/htdocs/f" ServerName f.e-elitech.net</Vir ...

随机推荐

  1. 如何ping测有端口的网站

    参考:http://jingyan.baidu.com/article/c1a3101e878dcede656deb05.html 参考2:http://www.haoid.cn/post/261 现 ...

  2. CString.Format %s 字符串 要用char *

    CString.Format %s 字符串 错了,应该是:std::string str;CString sql;sql.Format("%s",str.c_str());所以正确 ...

  3. vs2017 新建Class 文件时,自动添加作者版权声明注释

    1.用文本打开,在其头部加上 “C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ItemTempl ...

  4. jquery的表单验证方法,一个function能不能同时捕捉点击事件和按键事件?能不能再优化下,有代码。

    // 该jquery扩展引自 http://www.ghostsf.com/tools/389.html 方法名是作者博客的命名 $.fn.ghostsf_serialize = function ( ...

  5. 用BETTERCAP和RASPBERRY PI ZERO W制作迷你WiFi干扰器

    我并不是一个特别勤快的人,几天前我终于开始将我几周以来的一些想法付诸于实践,即使用Raspberry Pi Zero W制作一个可随身携带的迷你WiFi干扰器.有了它,我就可以随时随地的收集附近无线接 ...

  6. saltstack之mount和umount的用法

    线上很多服务器都需要挂载存储上的公共目录,并实现开机启动(/etc/fstab),比如web的静态文件共享目录,日志远程集中收集等. 一.批量挂载部分. 1.在node1上配置nfs服务器,有关nfs ...

  7. 解决NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

    使用spring3.05 mvc进行开发,使用tomcat容器,通过url映射寻找view的时候,会报错NoClassDefFoundError: javax/servlet/jsp/jstl/cor ...

  8. [Python爬虫] 之十一:Selenium +phantomjs抓取活动行中会议活动信息

    一.介绍 本例子用Selenium +phantomjs爬取活动行(http://www.huodongxing.com/search?qs=数字&city=全国&pi=1)的资讯信息 ...

  9. 在浏览器中体验 Ubuntu

    近日,Canonical将Ubuntu官网中添加了在线导览的功能,你可以在任何地方使用这个Ubuntu 演示版.Ubuntu背后的公司Canonical为 Linux 推广做了很多努力.无论你有多么不 ...

  10. 给ubuntu设置静态ip —— How to set static IP Address in Ubuntu Server 16.04

    原文: http://www.configserverfirewall.com/ubuntu-linux/ubuntu-set-static-ip-address/ ----------------- ...