LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2009, 08:30 PM   #1
hifun
LQ Newbie
 
Registered: Dec 2008
Distribution: Fedora 8
Posts: 28

Rep: Reputation: 15
Name and IP based virtual host in Apache


Hi,
I was trying to configure Name and IP based virtual hosts on Apache Web Server in Feodra-8.

I'm having wireless LAN (DHCP)connection. I tried with IP's that were not allocated at that time as wlan0:1 and wlan0:2. But pinging these IP's from another system in same wireless LAN gave "Destination Host Unreachable".
How to configure it so that other systems in LAN can access my site.

In the name based virtual hosts, I named it like "site1.localhost.localdomain". But it is also not working.
HELP

Thanks.
 
Old 06-13-2009, 10:24 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
To be clear, this is an IP question (not an Apache question). You can forget about the application layer until you get the network layer working.

Also, Fedora 8 is history. Get the latest if you can.

Who manages your dhcp server? Are you doing this at work, or is this your home network?

Finally, post the output of:
  • # ifconfig
  • # netstat -rn
  • # iptables -nvL
 
Old 06-13-2009, 11:35 PM   #3
hifun
LQ Newbie
 
Registered: Dec 2008
Distribution: Fedora 8
Posts: 28

Original Poster
Rep: Reputation: 15
anomie,
May be Fedora-8 is history but kernel-2.6.29 is not.
I'm doing this work at college LAN.
DHCP is managed by sysAdmin here in college.

Code:
[$]netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
172.31.84.64    0.0.0.0         255.255.255.192 U         0 0          0 eth0
192.168.122.0   0.0.0.0         255.255.255.0   U         0 0          0 virbr0
172.17.8.0      0.0.0.0         255.255.248.0   U         0 0          0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlan0
0.0.0.0         172.17.8.1      0.0.0.0         UG        0 0          0 wlan0


[$]ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:D4:A0:EF:2A  
          inet addr:172.31.84.83  Bcast:172.31.84.127  Mask:255.255.255.192
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:20 Base address:0xe000 

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:6964 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6964 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:5374022 (5.1 MiB)  TX bytes:5374022 (5.1 MiB)

virbr0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:11296 (11.0 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:18:DE:D0:71:B7  
          inet addr:172.17.9.197  Bcast:172.17.15.255  Mask:255.255.248.0
          inet6 addr: fe80::218:deff:fed0:71b7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:767096 errors:0 dropped:0 overruns:0 frame:0
          TX packets:376911 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:971225499 (926.2 MiB)  TX bytes:32843841 (31.3 MiB)

wlan0:1   Link encap:Ethernet  HWaddr 00:18:DE:D0:71:B7  
          inet addr:172.17.9.198  Bcast:172.17.15.255  Mask:255.255.248.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

wlan0:2   Link encap:Ethernet  HWaddr 00:18:DE:D0:71:B7  
          inet addr:172.17.9.199  Bcast:172.17.15.255  Mask:255.255.248.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

wmaster0  Link encap:UNSPEC  HWaddr 00-18-DE-D0-71-B7-58-58-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

[$]iptables -nVl
Chain INPUT (policy ACCEPT 735K packets, 970M bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     udp  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           udp dpt:53 
    0     0 ACCEPT     tcp  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           tcp dpt:53 
    0     0 ACCEPT     udp  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           udp dpt:67 
    0     0 ACCEPT     tcp  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           tcp dpt:67 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  *      virbr0  0.0.0.0/0            192.168.122.0/24    state RELATED,ESTABLISHED 
    0     0 ACCEPT     all  --  virbr0 *       192.168.122.0/24     0.0.0.0/0           
    0     0 ACCEPT     all  --  virbr0 virbr0  0.0.0.0/0            0.0.0.0/0           
    0     0 REJECT     all  --  *      virbr0  0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable 
    0     0 REJECT     all  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable 

Chain OUTPUT (policy ACCEPT 386K packets, 22M bytes)
 pkts bytes target     prot opt in     out     source               destination
 
Old 06-14-2009, 05:54 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by hifun
May be Fedora-8 is history but kernel-2.6.29 is not.
Fedora 8 is no longer supported. (You can't get official updates.)

Quote:
Originally Posted by hifun
DHCP is managed by sysAdmin here in college.
In that case, the first thing I would suggest is confirming with your sysadmin that the IPs you've used are OK. Do that first.

A couple other things: IIRC, aliases should start with wlan0:0, wlan0:1, etc. It would also be worthwhile to run # tcpdump -i <interface> icmp on your Fedora server while pinging it to see if packets are reaching it. (They're almost certainly not, but let's check.)
 
Old 06-17-2009, 01:00 AM   #5
hifun
LQ Newbie
 
Registered: Dec 2008
Distribution: Fedora 8
Posts: 28

Original Poster
Rep: Reputation: 15
anomie,
Sorry for late reply. I didn;t get a chance to talk to sysAdmin. Before using IP for wlan0:0 and wlan0:1, I tried pinging those IP's they were not allocated to any hosts by DHCP.So it should work, right?
o/p of tcpdump is:
Code:
[root@localhost ~]# !tcpdump
tcpdump -i wlan0:1 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0:1, link-type EN10MB (Ethernet), capture size 96 bytes
11:04:59.090469 IP 172.17.12.122 > ALL-SYSTEMS.MCAST.NET: ICMP echo request, id 1, seq 2704, length 40
11:05:24.438410 IP 172.17.11.210 > ALL-SYSTEMS.MCAST.NET: ICMP echo request, id 0, seq 0, length 40
11:09:58.971906 IP 172.17.12.122 > ALL-SYSTEMS.MCAST.NET: ICMP echo request, id 1, seq 2704, length 40

3 packets captured
10 packets received by filter
0 packets dropped by kernel
[root@localhost ~]# tcpdump -i wlan0:0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0:0, link-type EN10MB (Ethernet), capture size 96 bytes
11:14:59.122675 IP 172.17.12.122 > ALL-SYSTEMS.MCAST.NET: ICMP echo request, id 1, seq 2704, length 40
11:15:24.309680 IP 172.17.11.210 > ALL-SYSTEMS.MCAST.NET: ICMP echo request, id 0, seq 0, length 40

2 packets captured
19 packets received by filter
0 packets dropped by kernel
When I ping these IP's from another m/c , "Destination Host unreachable" error sometimes coming from IP of that m/c only and sometimes from main DHCP server's IP address.
How does then this "tcpdump" is capturing packet ?
 
Old 06-17-2009, 01:06 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by hifun
I didn;t get a chance to talk to sysAdmin. Before using IP for wlan0:0 and wlan0:1, I tried pinging those IP's they were not allocated to any hosts by DHCP.So it should work, right?
Here's the issue: just because you can't ping a host does not mean it isn't active. (Some people filter icmp traffic.) Not only that, you need to get this squared away with your sysadmin, because the dhcp server might issue those IPs to other clients at some point, and then you'll be playing a game of steal the IP from one another.

Quote:
Originally Posted by hifun
When I ping these IP's from another m/c , "Destination Host unreachable" error sometimes coming from IP of that m/c only and sometimes from main DHCP server's IP address.
How does then this "tcpdump" is capturing packet ?
The icmp traffic you captured with tcpdump is originating from other hosts (not yours) and going to ALL-SYSTEMS.MCAST.NET (which is apparently a multicast address for your network).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set apache virtual hosts Host-Based Security? hocheetiong Linux - Newbie 2 01-17-2014 04:20 AM
Adding virtual interface for IP based virtual host pridefc Linux - General 6 03-16-2008 03:52 PM
configuring secured name based virtual host bzlaskar Linux - Security 4 04-19-2007 05:05 AM
How to configure the virtual host based name? gz_xmg Linux - Networking 0 12-28-2004 01:12 AM
Name Based Virtual Host problem helios007 Linux - Networking 6 12-21-2003 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration