我正在使用apache 2.2.15,在CentOS 6上的一个虚拟机中,我有一个symfony项目在这里工作,我的老板想在同一服务器的子域中加载一个wordpress网站。
mysite.cl.conf(在/etc/httpd/conf.d文件夹中)
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html/symfonyProyect/web
ServerName mysite.cl
ServerAlias mysite.cl
ErrorLog /var/log/httpd/symfonyProyect_error.log
CustomLog /var/log/httpd/symfonyProyect_access.log combined
<Location />
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /app.php [L]
</IfModule>
DirectoryIndex app.php
</Location>
</VirtualHost>
<VirtualHost *:80>
ServerName mysubdomain.mysite.cl
DocumentRoot /var/www/html/mysubdomain
<Directory /var/www/html/mysubdomain>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/mysubdomain_error.log
CustomLog /var/log/httpd/mysubdomain_access.log combined
</VirtualHost>
我的主机文件(在/etc文件夹中)
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
myip mysite.cl mysubdomain.mysite.cl
还有我的hosts.conf
multi on
当我尝试mysite时。cl显示symfony网站,但当我尝试mysubdomain.mysite时。cl,它给了我“
This site can't be reached
“或”
ERR_NAME_NOT_RESOLVED
".
ServerName mysubdomain.mysite.cl
).
我是不是遗漏了一些配置??