问题描述
我刚才已经安装的Apache / PHP /在Ubuntu 12.04 mysql的,我已经创造了我的虚拟目录的别名,这里是我的/ etc / apache2的/ / 000-默认文件中启用的站点 -
I've just setup apache/php/mysql in Ubuntu 12.04, and I've created an Alias for my virtual directory, here's my /etc/apache2/sites-enabled/000-default file:
Alias /demo/ "/home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio"
<Directory "/home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio">
DirectoryIndex index.php
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from all
</Directory>
请注意,我已经申请chown和chmod命令:/家庭/ czetsuya /项目/日食/月食的PHP /演示组合
Note that I've already applied chown and chmod to: /home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio
chown www-data:www-data /home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio -R
chmow 777 /home/czetsuya/projects/eclipse/eclipse-php/demo-portfolio -R
但是,当我访问:_http://本地主机/演示,我得到了一个404未找到错误。看着/var/log/apache2/error.log我发现它仍然位于/ var / WWW /演示指点:
But when I access: _http://localhost/demo, I got a 404 Not found error. Looking at /var/log/apache2/error.log I found that it's still pointing at /var/www/demo:
File does not exist: /var/www/demo
任何想法,为什么别名被忽略?
Any idea why Alias is ignored?
请注意,我已经重新启动并重新加载的Apache2。并重写也被激活。
Note that I already restart and reload apache2. And rewrite is also enabled.
谢谢,
czetsuya
Thanks,
czetsuya
推荐答案
您的问题可以很可能由的;
Your problem can most likely be solved by the mod_alias manual;
请注意,如果你有一个尾随/的URL路径上,则服务器
将需要一个尾随/以扩大的别名。也就是说,如果
您使用
别名/图标/在/ usr /本地/ Apache /图标/那么URL /图标不会
别名,因为它缺乏尾随/.
Alias /icons/ /usr/local/apache/icons/ then the URL /icons will not be aliased, as it lacks that trailing /.
试着改变 /演示/
到 /演示
在你的别名,它应该更好地工作。
Try changing /demo/
to /demo
in your alias, and it should work better.
这篇关于Apache2的别名不Ubuntu的工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!