virtual machine - Multi apache2 websites wont work -


i try make 2 websites on same ip. have understand on research possible if use domain , subdomains.

right made in default config file apache2 on ubuntu:

namevirtualhost prem2.trixia.dk:80 namevirtualhost srv6.trixia.dk:80 <virtualhost prem2.trixia.dk:80>     servername prem2.trixia.dk     serveradmin webmaster@localhost     documentroot /var/www/html     errorlog ${apache_log_dir}/error.log     customlog ${apache_log_dir}/access.log combined </virtualhost> <virtualhost srv6.trixia.dk:80>     servername srv6.trixia.dk      serveradmin webmaster@localhost     documentroot /var/www/host523.trixia.dk      errorlog ${apache_log_dir}/error.log     customlog ${apache_log_dir}/access.log combined </virtualhost> 

what wonna is, if go website srv6.trixia.dk, goes folder /var/www/host523.trixia.dk , if prem2.trixia.dk, default webpage.

right if go srv6.trixia.dk goes /var/www/html. have done wrong?

i assume use apache 2.2 or lower, in 2.4 namevirtualhost deprecated.

it recommended put ip-address namevirtualhost optional port argument, this:

namevirtualhost 123.123.123.123:80 

on server have written this:

namevirtualhost *:80 

that says apache can have virtualhosts on of servers ip-adresses. replace namevirtualhost <servername>:80 namevirtualhost <ip-address>:80or namevirtualhost *:80

next rewrite virtualhost blocks this:

<virtualhost *>  servername prem2.trixia.dk  serveradmin webmaster@localhost  documentroot /var/www/html  errorlog ${apache_log_dir}/error.log  customlog ${apache_log_dir}/access.log combined </virtualhost> <virtualhost *>  servername srv6.trixia.dk   serveradmin webmaster@localhost  documentroot /var/www/host523.trixia.dk   errorlog ${apache_log_dir}/error.log  customlog ${apache_log_dir}/access.log combined </virtualhost> 

that is, replace <virtuahost>part of each of them.

i think error did 2 namevirtualhostand caused apache intepret virtualhosts wrong.

this might page read also: http://httpd.apache.org/docs/2.2/vhosts/name-based.html


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -