J'utilise Apache 2.2.15, dans une machine virtuelle sur CentOS 6, j'ai un projet de symfony qui fonctionne ici et mon patron veut charger un site WordPress dans le même serveur sur un sous-domaine. Subdomain ne fonctionne pas, je l'ai essayé beaucoup de configurations, c'est le dernier utilisé:VirtualHost Apache retourne toujours le même site Web non sous-domaine
mysite.cl.conf (dans le dossier /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>
mes hôtes fichier (dans/etc dossier)
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
myip mysite.cl mysubdomain.mysite.cl
et mon hosts.conf
multi on
lorsque je tente MYS ite.cl il montre le site Web de symfony, mais quand j'essaye mysubdomain.mysite.cl, il me donne le "This site can't be reached
" ou "ERR_NAME_NOT_RESOLVED
".
Si je supprime le premier bloc VirtualHost, il affiche le site Web wordpress (même en utilisant ServerName mysubdomain.mysite.cl
). Ai-je manqué une configuration ou quelque chose ??
comme vous l'avez dit, ce n'était pas un problème d'Apache, le système n'autorisera pas les caractères génériques dans les enregistrements a – ericksho