visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Web :: General :: Need help with IP aliasing and Apache Virtual Hosting


By: thepreacher Great Britain  Date: 30/06/2009 18:17:19  English French  Points: 20 Status: Answered
Quality : Excellent
I really need your help with this. Its been two weeks now and still stuck. All i need to do is this:

I have a 2wire router, 5 static IP addresses and 10 domains to host. On the router i have configured the public gateway ip and also assigned a static ip to my ubuntu 8.04 server. The server is also configured with the same static ip. It works because the default apache page displays over the internet. I am also able to now connect via sftp and putty romotely.

My problem starts when i add ip aliases to current NIC - eth0. The reason for the ip alising is that on the one NIC we want to host 3 domains which must all have SSL and apart from adding more NICards IP alising is the other alternative which does not cost us money.

The issue is that I have tried to configure the sites on apache2 as best as I know and at the moment none of the sites can be view from the net. If i disable everything leaving just the one site, it works. I have attached detailes of my current settings hoping that someone can help.

Details of the Interfaces file:

root@pmctserver1:/etc/apache2/sites-enabled# nano /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 217.20.29.17
netmask 255.255.255.248
broadcast 217.37.29.23
gateway 217.37.29.22

auto eth0:0
iface eth0:0 inet static
name Ethernet alias LAN card
address 217.20.29.18
netmask 255.255.255.0
broadcast 217.37.29.23

auto eth0:1
iface eth0:1 inet static
name Ethernet alias LAN card
address 217.20.29.19
netmask 255.255.255.0
broadcast 217.37.29.23



Details of the Vhost configuration for a domain all the other domains are copies of this with the right changes made to the servername, documentroot etc..:

root@pmctserver1:/etc/apache2/sites-available# nano domain1.org

<VirtualHost *:80>
ServerName www.domain1.org
ServerAlias domain1.org
DocumentRoot /var/www/domain1.org/
<Directory /var/www/domain1.org/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>




Details of the Interfaces file:

root@pmctserver1:/etc/apache2# nano ports.conf

#Listen 80
Listen 217.20.29.17:80
Listen 217.20.29.18:80
Listen 217.20.29.19:80

NameVirtualHost 217.20.29.19:80

<IfModule mod_ssl.c>
Listen 443
</IfModule>




root@pmctserver1:/etc/apache2# nano /etc/hosts

127.0.0.1 localhost
# 127.0.1.1 pmctserver1.gateway.2wire.net pmctserver1
217.20.29.17 pmctserver1.gateway.2wire.net pmctserver1

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts



root@pmctserver1:/etc/apache2# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1e:4f:3b:40:4f
inet addr:217.37.29.17 Bcast:217.37.29.23 Mask:255.255.255.248
inet6 addr: fe80::21e:4fff:fe3b:404f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4907 errors:0 dropped:0 overruns:0 frame:0
TX packets:964 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:353197 (344.9 KB) TX bytes:129100 (126.0 KB)
Interrupt:16

eth0:0 Link encap:Ethernet HWaddr 00:1e:4f:3b:40:4f
inet addr:217.37.29.18 Bcast:217.37.29.23 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:16

eth0:1 Link encap:Ethernet HWaddr 00:1e:4f:3b:40:4f
inet addr:217.37.29.19 Bcast:217.37.29.23 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:16

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:169 errors:0 dropped:0 overruns:0 frame:0
TX packets:169 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12778 (12.4 KB) TX bytes:12778 (12.4 KB)



Sorry if i've provided too much info i just didn't know what to leave out.
By: thepreacher Date: 30/06/2009 23:50:08 English  Type : Comment
Sorry I made a mistake in the last section of the post. The following is the correct code

root@pmctserver1:/etc/apache2# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1e:4f:3b:40:4f
inet addr:217.20.29.17 Bcast:217.20.29.23 Mask:255.255.255.248
inet6 addr: fe80::21e:4fff:fe3b:404f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4907 errors:0 dropped:0 overruns:0 frame:0
TX packets:964 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:353197 (344.9 KB) TX bytes:129100 (126.0 KB)
Interrupt:16

eth0:0 Link encap:Ethernet HWaddr 00:1e:4f:3b:40:4f
inet addr:217.20.29.18 Bcast:217.20.29.23 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:16

eth0:1 Link encap:Ethernet HWaddr 00:1e:4f:3b:40:4f
inet addr:217.20.29.19 Bcast:217.20.29.23 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:16

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:169 errors:0 dropped:0 overruns:0 frame:0
TX packets:169 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12778 (12.4 KB) TX bytes:12778 (12.4 KB)

By: VGR Date: 01/07/2009 19:25:43 English  Type : Answer
yo

First quick & dirty idea : I wouldn't do this : (for each domain)


VirtualHost *:80



but rather :


VirtualHost 217.20.29.17:80



(for instance)

By: VGR Date: 16/08/2009 15:52:14 French  Type : Comment
titre gras en bleu vers la page le nom saisi et une image : un texte simple
By: OpConsole Date: 03/04/2011 19:12:29 English  Type : Comment
force close

Do register to be able to answer

EContact
browser fav
page generated in 95.851900 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page