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>:80
or 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 namevirtualhost
and caused apache intepret virtualhosts wrong.
this might page read also: http://httpd.apache.org/docs/2.2/vhosts/name-based.html
Comments
Post a Comment