Hello, I have a hard time understanding this virtual host problem. I want an empty subdomain to go to /var/www/www. www as subdomain to the same. www2 subdomain to the /var/www/www2 folder only on port 80 and admin subdomain only on port 88 to /var/www/admin.
Now it happens that I have a couple of more hosts in my DNS. So I can contact eg. mail.student481.linuxkurs.tfe.umu.se:88 to go to the adminpage, or smtp.student481.linuxkurs.tfe.umu.se:80 goes to the /var/www/www folder. Thats not what I want.
Can someone help me out a little?
Code:
root@student481:/etc/apache2/sites-available# cat www
<VirtualHost *:80>
DocumentRoot /var/www/www
ServerName student481.linuxkurs.tfe.umu.se
ServerAlias www.student481.linuxkurs.tfe.umu.se
</VirtualHost>
root@student481:/etc/apache2/sites-available# cat www2
<VirtualHost *:80>
DocumentRoot /var/www/www2
ServerName www2.student481.linuxkurs.tfe.umu.se
ServerAlias www2.student481.linuxkurs.tfe.umu.se
</VirtualHost>
root@student481:/etc/apache2/sites-available# cat admin
<VirtualHost *:88>
ServerName admin.student481.linuxkurs.tfe.umu.se
ServerAlias admin.student481.linuxkurs.tfe.umu.se
DocumentRoot /var/www/admin
DirectoryIndex index.html
<Directory /var/www/admin/>
AllowOverride AuthConfig
</Directory>
</VirtualHost>
Code:
#cat ports.conf
NameVirtualHost *:80
Listen 80
NameVirtualHost *:88
Listen 88