[英]Apache not serving subdomain images
我的服务器上安装了“ Apache 2.4.6(Ubuntu)”和“ PHP 5.5.4-1(cli)”,并且我已经设置了可以正常运行的子域,可以运行PHP脚本,但是没有图像显示起来 我已经在网络浏览器中输入了图像的URL,并且它已经加载了很长时间。
我一直在玩我的网站可用的配置文件,但似乎无法显示它们。 我没有.htaccess文件阻止图像或类似内容。
这是我的subdomain.domain.com.conf文件(已编辑为不提供任何详细信息):
# domain: subdomain.domain.com
# public: /home/username/public/domain.com/subdomain/public
<VirtualHost subdomain.domain.com:80>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/home/username/public/domain.com/subdomain/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@domain.com
ServerName www.subdomain.domain.com
ServerAlias subdomain.domain.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/username/public/domain.com/subdomain/public
# Log file locations
LogLevel warn
ErrorLog /home/username/public/domain.com/log/error.log
CustomLog /home/username/public/domain.com/log/access.log combined
</VirtualHost>
当我尝试查看时:subdomain.domain.com/elements/img/test.png
浏览器只是坐在他们的负载...
我在找对地方解决这个问题吗? 我应该检查其他配置文件吗? 我的domain.com.conf文件是否以某种方式与子域混淆?
谢谢,谢谢您的帮助!
我认为您的问题是您不使用基于名称的虚拟主机。 除非每个主机都有单独的IP?
尝试将虚拟主机更改为:
<VirtualHost *:80>
您可能还需要更改您的主要主机,但Apache docs中对此进行了全部说明。
希望它能帮助您前进。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.