logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: [SOLVED] Apache 2 with IPv4 and IPv6
Author
henkoegema



Joined: 06 Aug 2013
Posts: 5
Location: Netherlands, Lunteren

PostPosted: Thu 08 Aug '13 22:10    Post subject: [SOLVED] Apache 2 with IPv4 and IPv6 Reply with quote

I'm runnung a server with Apache2 (Apache/2.2.16 (Debian 6.0))

I would like Apache2 listen on port 8080 for IPv4 and on port 80 for IPv6.

This is what I have now:

/etc/apache2/ports.conf
Code:
NameVirtualHost *:8080
Listen 8080

NameVirtualHost [2001:7b8:2ff:8469::1]:80
Listen [2001:7b8:2ff:8469::1]:80


/etc/apache2/sites-enabled/000-default
Code:

<VirtualHost *:8080>
..............
</VirtualHost>


<VirtualHost [2001:7b8:2ff:8469::1]:80>
..............
</VirtualHost>


Unfortunately the above code is not correct. Rolling Eyes

Code:

root@asteriskondebian:~# service apache2 restart
Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.1.213 for ServerName
[Thu Aug 08 20:01:38 2013] [error] (EAI 2)Name or service not known: Failed to resolve server name for 2001:7fb:2ff:8469::1 (check DNS) -- or specify an explicit ServerName
[Thu Aug 08 20:01:38 2013] [warn] NameVirtualHost 2001:7b8:2ff:8469::1:80 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.1.213 for ServerName
[Thu Aug 08 20:01:38 2013] [error] (EAI 2)Name or service not known: Failed to resolve server name for 2001:7fb:2ff:8469::1 (check DNS) -- or specify an explicit ServerName
[Thu Aug 08 20:01:38 2013] [warn] NameVirtualHost 2001:7b8:2ff:8469::1:80 has no VirtualHosts
.
root@asteriskondebian:~#


I do have an AAAA record pointing to 2001:7b8:2ff:8469::1

Who can help? Smile


Last edited by henkoegema on Mon 12 Aug '13 21:54; edited 1 time in total
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Fri 09 Aug '13 12:22    Post subject: Reply with quote

You should define a "gobal" ServerName in the httpd.conf

Code:

ServerName localhost

NameVirtualHost *:8080
Listen 8080

NameVirtualHost *:80
Listen [2001:7b8:2ff:8469::1]:80


Code:

<VirtualHost *:8080>
   www.apachehaus.de
   ...
</VirtualHost>


<VirtualHost *:80>
   ServerName ipv6.apachehaus.de
   ...
</VirtualHost>


Since your Listen for port 80 is IPv6 there is no need to define that in the vhost.
Back to top
henkoegema



Joined: 06 Aug 2013
Posts: 5
Location: Netherlands, Lunteren

PostPosted: Fri 09 Aug '13 21:53    Post subject: Reply with quote

First of all thanks for your answer James.
However, I'm a little bit confused.

Should I put both code examples what you suggest in httpd.conf?
At the moment httpd.conf is completely empty.

What should I do with /etc/apache2/ports.conf and /etc/apache2/sites-enabled/000-default ?
Leave them as they originally where?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Sat 10 Aug '13 13:02    Post subject: Reply with quote

Sorry,
I looked into debian default config and it is different to the default layout.

The first part has to be in apache2.conf, but can also be in the ports.conf (it won't make any difference)

The vhost stuff of cause in /etc/apache2/sites-enabled/000-default

Sorry, I thought it would be clear.
Back to top
henkoegema



Joined: 06 Aug 2013
Posts: 5
Location: Netherlands, Lunteren

PostPosted: Mon 12 Aug '13 15:25    Post subject: Reply with quote

Thanks very much for your help James.
It's working now. Very Happy
Back to top


Reply to topic   Topic: [SOLVED] Apache 2 with IPv4 and IPv6 View previous topic :: View next topic
Post new topic   Forum Index -> Apache