Apache 虚拟目录和默认首页的设置
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 虚拟目录和默认首页的设置的更多相关文章
- 【PHP编程之路-1】设置apache虚拟目录
概述 设置apache虚拟目录 1.开启“虚拟目录配置文件”httpd-vhosts.conf 文件路径:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-v ...
- Apache虚拟目录
Apache虚拟目录 1.打开Apache的配置文件httpd.conf,并去掉#Include conf/extra/httpd-vhosts.conf前面的#! 2.在httpd.conf 末尾 ...
- apache虚拟目录配置实例
apache虚拟目录配置实例 一.首先,开启虚拟主机配置 在文件httpd.conf中找到: include conf/extra/httpd-vhosts.conf #开启 二.对httpd-vho ...
- 在apache虚拟目录配置
在apache虚拟目录配置中 <VirtualHost *:80>xxx xxx xxx</VirtualHost> 不能写成 <VirtualHost *>xxx ...
- Ubuntu 配置Apache虚拟目录
http://blog.csdn.net/spring21st/article/details/6589300 Ubuntu 配置Apache虚拟目录 http://blog.csdn.net/spr ...
- Apache虚拟目录(二)
一.PHP生命周期 二.轻量级的PHP 轻量级PHP产品由lighttpd,nginx等等 Apache是基于模块化设计的 了解Apache源代码可以从main.c开始 操作系统上跑了APR运行库 m ...
- ubuntu18.04LTS配置apache虚拟目录(基于端口)
假设在用户目录下要新建两个虚拟目录web1,web2,分别对应端口8081,8082 $ cd ~ #切换到用户目录 $ mkdir www #新建www文件夹,以后新建的虚拟目录都放在该文件夹下 $ ...
- apache 虚拟目录
补充:必须使用80端口才能正常使用 C:\Windows\System32\drivers\etc\hosts 最后添加上: 127.0.0.1 shenyi.com 127.0.0.1 offli ...
- apache虚拟目录设置
<VirtualHost *:80> DocumentRoot "/xampp/htdocs/f" ServerName f.e-elitech.net</Vir ...
随机推荐
- Word中向左缩进
除了调节标线外(有时候不知道会不会改动其他),还可以shift+tab.
- python笔记14-读取yaml配置文件(pyyaml)
yaml简介 1.yaml [ˈjæməl]: Yet Another Markup Language :另一种标记语言.yaml 是专门用来写配置文件的语言,非常简洁和强大,之前用ini也能写配置文 ...
- Netty游戏服务器之六服务端登录消息处理
客户端unity3d已经把消息发送到netty服务器上了,那么ServerHandler类的public void channelRead(ChannelHandlerContext ctx, Obj ...
- 翻译:Spring-Framework-Reference Document:15.2-DispatcherServlet
写在前面的话: 最近被项目的代码折腾的死去活来的,其实框架也没有那么难理解,只是自己的Web基础太差,被Request和Response这一对神雕侠侣坑到泪流满面!今天捣腾了一下Spring We ...
- Code Simplicity
https://www.codesimplicity.com/post/code-simplicity-the-science-of-software-development/ 下载地址: https ...
- jQuery中,选择器既匹配开头又匹配结尾
jQuery中,选择器既匹配开头又匹配结尾的方法: [attr^=val]attr$=val [attr^=val][attr$=val]
- [转]Oracle connection strings
本文转自:http://www.connectionstrings.com/oracle/ Standard Data Source=MyOracleDB;Integrated Security=ye ...
- [转]SQL Server 2005 Integration Services (SSIS) (3) - Business Intelligence Development Studio
本文转自:http://blog.csdn.net/me_online/article/details/1546281 三,SQL Server Integration Services 开发环境– ...
- [转]使用VS2010的Database 项目模板统一管理数据库对象
本文转自:http://www.cnblogs.com/shanyou/archive/2010/05/08/1730810.html Visual Studio 2010 有一个数据库项目模板:Vi ...
- 用ACE来写代码
写在前面 在很多时候,我们想用一个支持高亮的WEB编辑器来做规则配置.代码编辑等,此时ACE应该是一个不错的选择,简单的用法如下: <!DOCTYPE html> <html lan ...