Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I added ip-based virtual host to sites-availble and created symlink to sites-enabled, but new domain times out.

When i navigate to mynewdomain.com it says connection timed out.

NameVirtualHost 12.12.12.12
<VirtualHost 12.12.12.12>
        ServerAdmin webmaster@localhost
        ServerName newdomain.com

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

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
share|improve this question

2 Answers 2

Did you add 12.12.12.12 to your server as a secondary address to one of its network interfaces? On Debian/Ubuntu, you would need to add lines like the following to your /etc/network/interfaces file (making an assumption about the netmask):

auto eth0:12
iface eth0:12 inet static
 address 12.12.12.12
 netmask 255.255.255.0
 network 12.12.12.0
 broadcast 12.12.12.255

And then run ifup eth0:12 as root.

share|improve this answer
    
And add the port at the end of the IP address in apache configuration like: NameVirtualHost 12.12.12.12:80 and <VirtualHost 12.12.12.12:80> –  Mircea Vutcovici Mar 22 '10 at 3:49

By navigate to mynewdomain.com I'm going to assume you actual mean newdomain.com which is what is mentioned in your example configuration.

1: That being said, make sure newdomain.com actually set in DNS to resolve to 12.12.12.12 and that the change has propagated through DNS. 2: Make sure to completely restart apache to make sure it picks up the new configuration. Do a restart or even better a stop then start.

Do you see any activity from your client's IP in the access log?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.