Jump to content

Apache me mustra solo un sitio


yetrus

Recommended Posts

Hola Amigos

 

tengo un problema, si coloco http:/localhost , se me va al primer virtualhost que coloque, en vez de ir a la url que corrsponde.

 

si pongo la url del 2º me sale la pagina del 1º

 

tengo esta configuracion en el httpd-vhosts.conf

ayuda please !!

 

<VirtualHost *:80>
   ##ServerAdmin [email protected]
   DocumentRoot "C:\WEB\www\webmail"
  ServerName webmail.MiDominio.cl
   ##ServerAlias www.dummy-host.localhost
   ##ErrorLog "logs/dummy-host.localhost-error.log"
   ##CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost>
<VirtualHost *:80>
   ##ServerAdmin [email protected]
  DocumentRoot "C:\WEB\www\Sitio"
  ServerName MiDominio.cl
   ##ServerAlias www.dummy-host.localhost
   ##ErrorLog "logs/dummy-host.localhost-error.log"
   ##CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost>

Link to comment
Share on other sites

Si pongo la IP del Server me sale el priemro, si coloco la ruta del 2º me sale el priemer sitio

si, los cambio orden, me sale la otra pagina.

 

<VirtualHost *:80>
##ServerAdmin [email protected]
DocumentRoot "C:/WEB/sitio/www"
ServerName www.MiDominio.cl
##ServerAlias www.dummy-host2.localhost
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>
<VirtualHost *:80>
##ServerAdmin [email protected]
DocumentRoot "C:/WEB/Sitio/webmail"
ServerName http://webmail.MiDominio.cl
##ServerAlias www.dummy-host.localhost
##ErrorLog "logs/dummy-host.localhost-error.log"
##CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost>

Link to comment
Share on other sites

Para lectura

http://httpd.apache.org/docs/2.2/vhosts/examples.html

 

Mira el ítem

Using the ServerPath directive

 

NameVirtualHost 172.20.30.40

 

<VirtualHost 172.20.30.40>

# primary vhost

DocumentRoot /www/subdomain

RewriteEngine On

RewriteRule ^/.* /www/subdomain/index.html

# ...

</VirtualHost>

 

<VirtualHost 172.20.30.40>

DocumentRoot /www/subdomain/sub1

ServerName www.sub1.domain.tld

ServerPath /sub1/

RewriteEngine On

RewriteRule ^(/sub1/.*) /www/subdomain$1

# ...

</VirtualHost>

 

<VirtualHost 172.20.30.40>

DocumentRoot /www/subdomain/sub2

ServerName www.sub2.domain.tld

ServerPath /sub2/

RewriteEngine On

RewriteRule ^(/sub2/.*) /www/subdomain$1

# ...

</VirtualHost>

Link to comment
Share on other sites

excelente compipa!!

funciono de esta manera

esto en el httpd.conf

 

ServerName Ip-Publica:80

 

esto en el httpd-vhost.conf

NameVirtualHost MiIpPublica:80


<VirtualHost MiIpPublica:80>
##ServerAdmin [email protected]
DocumentRoot "C:/WEB/Sitio/www"
ServerName www.sitiocorporativo.cl
##ServerAlias www.dummy-host2.localhost
##ErrorLog "logs/dummy-host2.localhost-error.log"
##CustomLog "logs/dummy-host2.localhost-access.log" combined
</VirtualHost>

<VirtualHost 200.54.159.139:80>
##ServerAdmin [email protected]
DocumentRoot "C:/WEB/Sitio/webmail"
ServerName webmail.sitioCorporativo.cl
##ServerAlias www.dummy-host.localhost
##ErrorLog "logs/dummy-host.localhost-error.log"
##CustomLog "logs/dummy-host.localhost-access.log" combined
</VirtualHost> 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...