Jump to content

Problem with virtual hosts


Ciekawy

Recommended Posts

I have a weird problem that i cannot find answer for anywhere.

I have a DYNDNS domain (somedomain.selfip.org) with wildcards enabled that points to a router/firewall/NAT running Tomato (a.somedomain.selfip.org). On the router i have a forwarding of port 80 enabled pointing to a host on a local network (b.somedomain.selfip.org), that is running a Apache 2.2 server. On that server i would like to host following domains:

 

1. somedomain.selfip.org, www.somedomain.selfip.org, b.somedomain.selfip.org, b

    pointing to /var/www/apache2-default

2. user1.somedomain.selfip.org, user2.somedomain.selfip.org

    pointing to /var/www/user12

 

My current config is:

In /etc/apache2/httpd.conf

NameVirtualHost *:80

<IfModule mod_ssl.c>
    NameVirtualHost *:443
</IfModule>

 

In /etc/apache2/sites-available/default

<VirtualHost *:80>
    ServerName somedomain.selfip.org
    ServerAlias somedomain.selfip.org b.somedomain.selfip.org b
    ServerAdmin root@somedomain.selfip.org
    DocumentRoot /var/www/apache2-default/

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/default/error.log
    LogLevel debug

    CustomLog /var/log/apache2/default/access.log combined
    ServerSignature On
</VirtualHost>

 

In /etc/apache2/sites-available/user12

<VirtualHost *:80>
    ServerName user1.somedomain.selfip.org
    ServerAlias user2.somedomain.selfip.org
    ServerAdmin user12@mail-host.com
    DocumentRoot /var/www/user12/

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory /var/www/user12/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/user12/error.log
    LogLevel debug

    CustomLog /var/log/apache2/user12/access.log combined
    ServerSignature On
</VirtualHost>

 

The problem is that whatever subdomain i enter:

user1.somedomain.selfip.org

user1.somedomain.selfip.org

(even a non-existent ones line - idontexist.somedomain.selfip.org) i get the site form first virtual host.

What could be the problem.

 

Ciekawy

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.