Link to home
Start Free TrialLog in
Avatar of NanZhong
NanZhong

asked on

Is it possible to let Apache serve an IP address?

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.

Avatar of ahoffmann
ahoffmann
Flag of Germany image

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.
Avatar of NanZhong
NanZhong

ASKER

Yeah I understand that, I want to know if it can serve and IP address that I provide and if it can how.
see Listen and BindAddress directives in httpd.conf
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.
> 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).
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...
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?
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.
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
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
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
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.
> 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.
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.
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
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.
I'm sorry it was a typo, there should ony be one 4. So it should be: 24.192.169.144
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.
.. and to complete samri's list, try last 2 from your other (windows?) client
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.
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.
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.
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.
SOLUTION
Avatar of samri
samri
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial