Solved

Is it possible to let Apache serve an IP address?

Posted on 2003-11-29
26
405 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
ID: 9846260
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
ID: 9846271
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
ID: 9846325
see Listen and BindAddress directives in httpd.conf
0
 

Author Comment

by:NanZhong
ID: 9846352
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
ID: 9846370
> 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
ID: 9846389
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
ID: 9846410
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
ID: 9846432
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
ID: 9846743
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
ID: 9846842
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
ID: 9847186
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
ID: 9847435
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
ID: 9849655
> 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 15

Expert Comment

by:samri
ID: 9851381
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
ID: 9853259
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
ID: 9856769
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
ID: 9861701
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
ID: 9867741
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
ID: 9870008
.. and to complete samri's list, try last 2 from your other (windows?) client
0
 

Author Comment

by:NanZhong
ID: 9870065
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
ID: 9870221
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
ID: 9870231
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
ID: 9875800
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
ID: 9875817
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
ID: 9878002
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
ID: 9881311
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

912 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

17 Experts available now in Live!

Get 1:1 Help Now