Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have set up a local domain on my Apache server.

Then I added the following line in my /etc/hosts file

::1                     exampledomain.local

After I trying to navigate to it, (I tried Firefox and Chromium) I got a server not found error.

Then I tried ping6 and it worked:

dan@danny:~$ ping6 exampledomain.local
PING exampledomain.local(exampledomain.local) 56 data bytes
64 bytes from exampledomain.local: icmp_seq=1 ttl=64 time=0.032 ms

If I replace ::1 with 127.0.0.1 in my hosts file, it works fine. I'm not sure if this is relevant but this is my Virtual Host configuration in Apache2:

<VirtualHost *:80>
        ServerAlias exampledomain.local
        DocumentRoot /home/dan/sites/exampledomain

        <Directory /home/dan/sites/exampledomain>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/exampledomain-error.log

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

        CustomLog ${APACHE_LOG_DIR}/exampledomain-access.log combined

</VirtualHost>

My question is: How can I make it work with the IPv6 address?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If you can ping it then there is nothing wrong in the hosts file and i would think its something to do with the Apache config.

  • Check your Document root is correct and all the files are in correct place.
  • This link here for apache shows that the IPV6 must be in square brackets.
  • Any firewalls/IPtables blocking IPV6 packets?

Bill

share|improve this answer
    
I changed Listen 80 to Listen *:80 it works now. That was very weird. I changed it back to Listen 80 it still works. I guess after Apache started, something must have been listening to the [::]:80 address. So Apache couldn't bind to it. –  Dan Jun 6 '12 at 9:23
    
You just had to restart it as I think it picks up new /etc/hosts upon startup. –  edvinas.me Mar 10 at 22:19

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.