Solved

Is it possible to let Apache serve an IP address?

Posted on 2003-11-29
26
403 Views
Last Modified: 2010-03-04
Is it possible to let Apache serve an IP address so the public can view my site? I'm pretty sure it can because my friend uses the same ISP as me and everything works fine for him...

I'm currently running WinXP Pro with Apache Server 2.0.48 my ISP is Rogers Cable.

If you need more info please ask and hopefully I can get an answer soon.

0
Comment
Question by:NanZhong
  • 12
  • 8
  • 4
  • +1
26 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
apache can either listen on all configured IPs, or on selected/configured IPs.
It's up to your operating system or WinXP to provide the IP, apache can't do that.
0
 

Author Comment

by:NanZhong
Comment Utility
Yeah I understand that, I want to know if it can serve and IP address that I provide and if it can how.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
see Listen and BindAddress directives in httpd.conf
0
 

Author Comment

by:NanZhong
Comment Utility
I found the Listen directives and changed it to: Listen 192.168.0.XXX:80
but the BindAddress directive couldn't be found.

One more question, my comp isn't hooked up directly to the internet it is hooked up to a network hub that provides the internet. Would the IP address of my comp or my hub be the one I should use? Because some tutorials have talked about something like that.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> Would the IP address of my comp or my hub be the one I should use?
you *have* to use the address you configured.

> I found the Listen ..
that's ok

you need NAT at the firewall/router to have your server being reached from internet.
The admin of this firewall/router must configure a port-forwarding to your configured IP (if you use a virtual IP too).
0
 

Author Comment

by:NanZhong
Comment Utility
I'm kinda confused by your answer... as you can see I'm much of a newb.
So what do you mean by "configured" and about my firewall, it's the Windows XP firewall and it is set to let anything on port 80 to pass. And I don't think that my network hub has any built in firewalls...
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
ok, more detailled description:
 your private (RFC)-IP 192.168.0.x will not be routed by your ISP, but your ISP assigns a valid IP to you when you connect.
The device which connects to your ISP (DSL, or whatever) then is the router i mentioned above.
This router is configured for NAT, somtetimes also called masquerading.

If this is all done so far, as I assume 'cause you're still able to serv in the internet, then you don't need to do more configuration.
Just tell everyone who wants to reach your server, the IP you get from your ISP.

Is this what you need?
0
 

Author Comment

by:NanZhong
Comment Utility
So basically, under the Listen directive I use the 192.168.0.x but when the public wants to view my site, they should use the IP that I get from my ISP?

If that is correct, it sill doesn't work because when I type 244.192.169.144 into the internet explorer's address bar it says it cannot be found.
0
 

Expert Comment

by:littleg
Comment Utility
you have to log into your router and set it to forward a port to your servers ip the 192.168.0.xxx.

your apache serve needs to be configured to listen on that port .
and the servername should be set the the external ip.(is can be seen when you log into your router as well)

that should get the information needed throught to your server.

lates,
littlegiant
0
 

Author Comment

by:NanZhong
Comment Utility
Is there a difference between a router and a hub, because I'm not too sure if I can log in to my hub... My hub is a NETGEAR 4 Port Ethernet hub Model 104TP
0
 

Expert Comment

by:littleg
Comment Utility
how does you internet propogate to your network?
does it plug into your "hub",
do you have a computer with 2 network cards running ics?
or do you only have 1 computer?

LG
0
 

Author Comment

by:NanZhong
Comment Utility
Sorry about not responding, I have 2 computers the one I'm not using have the Cable modem hooked up to it, it is them hooked up to the hub and the hub links my compt to the internet.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> Is there a difference between a router and a hub
yes, for shure

> .. it says cannot be found.
this sound more like a routing and/or DNS problem

All in all, this question goes far bejond its initial question about apache configuration, 'cause you seem to have more nedd to get used to networking rather tah apache.

As you said, that aou're a newbe, could you please tell us which with wich terms you're familar?
  NIC, IP, hub, router, DNS, ISP, DHCP, NAT, masquerading, port-forwarding, subnet, netmask, etc. etc.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 15

Expert Comment

by:samri
Comment Utility
hi NanZhong,

* just to add to what you had been thru with ahoffmann.

Perhaps it would be best to leave apache running as it is -- default, since it is configure to listen on all available interface port 80.

so far, what I can understand is that ;

- two machine, machineA and machineB, both are connected to a HUB.
- you are using machineA, and machineB has a connection to Cable Modem.
- both machineA and machineB has NIC which is configure to be in 192.168.x network (let machineA to have 192.168.1.1 and machineB to be 192.168.1.2)
- machine will have additional IP address, which is given by the ISP (in this case Rogers Cable).
- you can access Apache on machineB, by http://192.168.1.2/
- you need to have apache on machineB to be accessible from Internet.

If the assumption are correct;  Find out what is the other IP address on machineB (which is assigned by Rogers Cable -- hint: it's not 192.168.x) Try to get somebody on the Internet to try to do http://that-ip-address/


give it a shot.
0
 

Author Comment

by:NanZhong
Comment Utility
To ahoffmann, I understand basically all the terms you listed as I got a brief description on networking from a friend.
To samri, I did exactly what you said already but It doesn't seem to work. The IP Address that Rogers gives me is 244.192.169.144. I'm pretty sure that it doesn't work because I've had friends try it. Give it try to confirm and any other suggestions are welcome.

If things really don't work, I'll get a professional in and I'll split the points among all who participated.

Thanks in advance and please give me more help. ;P
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
As said before: this sound more like a routing and/or masquerading problem than apache.
Also: 244.192.169.144 is a invalid IP in internet, this look s more like a private IP of your ISP.
Could you please check with your ISP.
0
 

Author Comment

by:NanZhong
Comment Utility
I'm sorry it was a typo, there should ony be one 4. So it should be: 24.192.169.144
0
 
LVL 15

Expert Comment

by:samri
Comment Utility
NanZhong/All,

if you were to be on the machine where Apache is running; could you try to browse to the following  (and feedback any that OK/failed).

http://localhost/
http://127.0.0.1/
http://192.168.1.2/  (or whatever your internal IP address is?)
http://24.192.169.144/ (or whatever Rogers assign it)

* I started to agree with ahoffmann too... but it;s worh a try.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
.. and to complete samri's list, try last 2 from your other (windows?) client
0
 

Author Comment

by:NanZhong
Comment Utility
Ok, Thanks all! Out of samri's list, the first two work fine, it directs me to the index page, the Internal IP gives me a cannot find server error and for the last one, the status bar in IE says done with a picture of the earth and a magifying glass on it, but there is no page shown. I still need access to my other computer for it is currently being used... I'll post the result as soon as possible.
0
 

Author Comment

by:NanZhong
Comment Utility
I just tried them again on the computer running Apache. Now when I type in the IP given to me by rogers it sometimes gives me a "cannot find server" error, and sometimes the error I describe in the last post.
0
 

Author Comment

by:NanZhong
Comment Utility
I just tried them again on the computer running Apache. Now when I type in the IP given to me by rogers it sometimes gives me a "cannot find server" error, and sometimes the error I describe in the last post.
0
 
LVL 15

Expert Comment

by:samri
Comment Utility
hi NanZhong,

when tested on the machine running apache:
The first two IP would be fine since it is only loopback interface.

192.168.1.2 (or whatever your internal IP) still failed -- did confused me.

Did your web browser is configure to use proxy?  If yes, disable it.
Is the machine (apache machine) is running any firewall software?  make sure that it is configured properly?  or maybe disable it for a while, and test.

try to do a "telnet 192.168.1.2 80" when you got a blank screen, type in anything, and hit enter twice.

Check your default gateway.

Do a "netstat -rn", and check the line that begins with "0.0.0.0" (or since you already posted the IP here - might as well post the output of netstat -rn here.  Reason is - if your machine is configure to use Roger IP as the default gateway -- chance are the packet just get "lost".

try those first.
0
 
LVL 15

Assisted Solution

by:samri
samri earned 125 total points
Comment Utility
sorry.. can both machine talk to each other in the first place?  Try to ping machineA from machineB, and then ping machineB from machineA.

machineA ping machineB ==> result
machineB ping machineA ==> result

0
 

Author Comment

by:NanZhong
Comment Utility
Thanks for your help, first of all, I'm not using proxy. Second of all, telnet 192.168.0.89 80 did not work. ComputerA, the one running the server can ping 24.192.168.144. ComputerB cannot ping my computer at 192.168.0.89. It times out.

The following info is what I got from the netstat -rn:
Route Table
=====================
Interface List
0x1.....................................MSMS TCP Loopback interface
0x2...00 b0 d0 99 21 5e........3Com Integrated Fast Ethernet Controller <3c905c-TX Compatible> -Packet Scheduler Miniport
========================
===========================
Active Routes:
Network Destination            Netmask               Gateway                  Interface         Metric
0.0.0.0                               0.0.0.0             192.168.0.1                192.168.0.89            30
127.0.0.0                        255.0.0.0             127.0.0.1                         127.0.0.1            1
192.168.0.0                     255.255.255.0      192.168.0.89              192.168.0.89            30
192.168.0.89                   255.255.255.255   127.0.0.1                    127.0.0.1                30
192.168.0.255               255.255.255.255     192.168.0.89                192.168.0.89           30
224.0.0.0                         224.0.0.0             192.168.0.89                192.168.0.89        30
255.255.255.255           255.255.255.255      192.168.0.89                192.168.0.89          1
Default Gateway:             192.168.0.89
=================================
Persistent Routes: None
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 125 total points
Comment Utility
routing and/or firewall problem as we assumed
You forst need to fix your network problems, then we can go back to apache.

please post from all participating hosts:
   netstat -rn
   ifconfig -a  # Linux
   ipconfig -all # Windoze

disable all firewalls on all hosts, then try ping from both ends to each other.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now