配置Apache .conf文件的别名 [英] Configure Apache .conf for Alias

查看:125
本文介绍了配置Apache .conf文件的别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我不能得到一个别名/etc/httpd/conf.d/vhosts.conf的工作,其中包含所有
我的虚拟主机:

So I cant get an alias working in "/etc/httpd/conf.d/vhosts.conf" which contains all of my virtual hosts:

<VirtualHost *> 
    ServerName example.com
    Alias /ncn /var/www/html/ncn
    DocumentRoot /var/www/html/mjp
</VirtualHost>

我希望我的替身工作,所以我可以点example.com/ncn为在/ var / www / html等/ NCN。

I want my alias to work so I can point example.com/ncn to "/var/www/html/ncn".

这工作,如果我有它在/etc/httpd/conf/httpd.conf中,但不是我的/etc/httpd/conf.d/vhosts.conf

This works if I have it in "/etc/httpd/conf/httpd.conf" but not my "/etc/httpd/conf.d/vhosts.conf"

任何想法,为什么?一切似乎工作,即ServerAlias​​的

Any ideas why? Everything else seems to work i.e. ServerAlias's

干杯,彼得

推荐答案

对不起,不知道发生了什么事情这到底工作:

Sorry not sure what was going on this worked in the end:

<VirtualHost *> 
    ServerName example.com
    DocumentRoot /var/www/html/mjp

    Alias /ncn "/var/www/html/ncn"

    <Directory "/var/www/html/ncn">
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

这篇关于配置Apache .conf文件的别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆