Hola gente.
Tengo una pregunta:
Como se configuran subdominios en apache?
En 1 mismo <VirtualHost> puedo hacerlo?
Les comento lo que me está pasando:
Yo creo esto:
<VirtualHost *:8081>
ServerAdmin noel_fb@hotmail.com
DocumentRoot "D:/WAMP/www/jose"
ServerAlias *.jose.com
ErrorLog "D:/WAMP/logs/jose/error_log.log"
CustomLog "D:/WAMP/logs/jose/custom_log.log" common
</VirtualHost>
<VirtualHost *:8081>
ServerAdmin noel_fb@hotmail.com
DocumentRoot "D:/WAMP/www/vanimus"
ServerAlias *.vanimus.com
ErrorLog "D:/WAMP/logs/vanimus/error_log.log"
CustomLog "D:/WAMP/logs/vanimus/custom_log.log" common
</VirtualHost>
Y me pasa lo siguiente:
Si ingreso a WWW.vanimus.com, me ingresa bien a la carpeta de Vanimus.
Pero si lo pongo SIN WWW, me ingresa a la carpeta de JOSE (la 1º definida).
Yo creí que con el SERVEALIAS ya es sufiente para definir que "AQUI VIENEN TODOS LOS SUBDOMINIOS". No es así?
O tendré que crear esto?: (CON SERVER NAME)
<VirtualHost *:8081>
ServerAdmin noel_fb@hotmail.com
DocumentRoot "D:/WAMP/www/vanimus"
ServerName vanimus.com
ErrorLog "D:/WAMP/logs/vanimus/error_log.log"
CustomLog "D:/WAMP/logs/vanimus/custom_log.log" common
</VirtualHost>
<VirtualHost *:8081>
ServerAdmin noel_fb@hotmail.com
DocumentRoot "D:/WAMP/www/vanimus"
ServerName www.vanimus.com
ErrorLog "D:/WAMP/logs/vanimus/error_log.log"
CustomLog "D:/WAMP/logs/vanimus/custom_log.log" common
</VirtualHost>
Como hago para decir que TODOS los SUBDOMINIOS vayan ahí? Algo me está resultado raro :/
Aclaro algo:
Estoy haciendolo con WAMP. Wamp tiene un archivo HTTPD desde el cual incluye a otro donde ahí se definen lo virtualhost.
Pero en el HTTPD hay definidas algunas otras cosas al respecto. Tendría que borrarlas?
Este es el HTTP:
ServerRoot "D:/WAMP/bin/apache/apache2.2.21"
Listen 8081
LoadModule actions_module modules/mod_actions.so
(aqui muchos modulos)
LoadModule php5_module "D:/WAMP/bin/php/php5.3.10/php5apache2_2.dll"
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>
ServerAdmin noel_fb@hotmail.com
ServerName localhost:8081
DocumentRoot "D:/WAMP/www/"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "D:/WAMP/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog "D:/WAMP/logs/apache_error.log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "D:/WAMP/logs/access.log" common
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
</IfModule>
# Fancy directory listings
Include conf/extra/httpd-autoindex.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include "D:/WAMP/alias/*"