Apache httpd 2.4 alias 别名配置
来源:互联网 发布:去哪里买淘宝店铺 编辑:程序博客网 时间:2024/06/04 23:23
Web网站别名配置是被经常使用的一个特性。这个功能实际上是为站点URI定义一个路径映射关系,其配置和使用也较为简单。以下是基于CentOS 7下实现alias的别名配置,供大家参考。
配置示例
[root@centos7-web ~]# more /etc/redhat-release CentOS Linux release 7.2.1511 (Core) [root@centos7-web ~]# httpd -vServer version: Apache/2.4.6 (CentOS)Server built: Nov 19 2015 21:43:13###关闭selinux[root@centos7-web ~]# setenforce 0[root@centos7-web ~]# vim /etc/httpd/conf/httpd.conf # # 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.Alias /bbs "/forum/htdocs"<Directory "/forum/htdocs"> Options Indexes FollowSymLinks MultiViews AllowOverride all Require all granted</Directory>上述别名的配置,就是说当你基于你的站点访问http://www.yourdoamin.com/bbs目录下的文件时,会直接从服务器/forum/htdocs目录下访问对应的文件。[root@centos7-web ~]# systemctl reload httpd[root@centos7-web ~]# mkdir -pv /forum/htdocs/mkdir: created directory ‘/forum/htdocs/’[root@centos7-web ~]# echo "This is a alias path test.">>/forum/htdocs/index.html[root@centos7-web ~]# curl http://localhost/bbs/index.htmlThis is a alias path test.如果alias路径中指定的尾部目录斜线,如下,应两者匹配Alias /bbs/ "/forum/htdocs/"<Directory "/forum/htdocs/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Require all granted</Directory>
阅读全文
0 0
- Apache httpd 2.4 alias 别名配置
- tomcat 配置别名alias
- Mac 配置mysql 别名 alias
- webpack中alias别名配置
- apache的Alias配置
- Apache alias目录配置
- Day1 - alias 配置指令的别名
- mac下.gitconfig配置别名alias
- Ubuntu使用alias配置命令别名
- Alias 别名
- 别名--alias
- Apache httpd安装配置
- httpd-apache服务器配置
- apache httpd.conf 配置
- apache httpd.conf配置
- Apache,Tomcat别名配置
- linux下的apache在httpd.conf配置目录别名和include引入自配置文件配置的方法
- Linux系统下Apache设置Alias别名的相关问题
- 从零开发B/S机架应用程序(四)-TCP
- Spring注入复杂类型属性
- 文章标题
- 关于VB.NET中多窗体之间的调用与关闭
- 从上往下打印出二叉树的每个节点,同层节点从左至右打印。
- Apache httpd 2.4 alias 别名配置
- win8.1由于系统更新,以致无法上网,简单粗暴的解决方法
- pip之python库安装
- Untiy AR开发 环境配置
- Ant 设置代理服务器(Windows和Linux)
- 一对多广播,Fragment延迟加载
- 还原bak后缀的数据库文件如何操作
- HC9S12X 定义及访问直接寻址区
- 160. Intersection of Two Linked Lists