Forum Moderators: phranque

Message Too Old, No Replies

External access problem

         

Zeety

1:33 am on Oct 27, 2012 (gmt 0)

10+ Year Member



Hello,

I'm attempting to set up a web server using Apache/2.0.64 (win32), and I have internal access using "localhost" but can't get external access by typing in the IP address on another machine with a separate connection. I've used several website guides as well as the Apache help documentation to configure it but I just can't seem to solve this problem.

The error file only shows one error and that's a missing "faveicon.ico" file.

I do have a router but I forwarded the ports. I also set up a static IP address as I was told that was necessary. I'm totally baffled, hope someone can help :)

lucy24

1:49 am on Oct 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The error file only shows one error and that's a missing "faveicon.ico" file.

If that's really how your browser spells it, the error is easy to explain ;)

The error logs only show requests that got as far as the server. Since these requests aren't reaching the server at all, there will be no errors.

What does the other machine's browser say when you ask for the IP address?

Disclaimer: All of the above is just buying time until someone who speaks Apache comes along and says "You doofus, you can't do it that way! You have to ..." et cetera.

Zeety

2:28 am on Oct 27, 2012 (gmt 0)

10+ Year Member



The other machine's browser times out after about 30 seconds and says the server is taking too long to respond.

The error logs show that many processes and services are running, so the installation appears to be good. That's the only reason I mentioned it.

And yea, the spelling sucks when I'm sleepy :p

SevenCubed

2:47 am on Oct 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World Zeety!

I'm thinking this thing out and need more info before I can go further (but it's not impossible that someone else will jump in with a different solution (one of the folks that both lucy and I are waiting on)

1) What's your level of understanding of this in general so we know what technical stuff we can throw at you?
2) Which port numbers have you forwarded on your router?
3) When you say you put in a static IP do you mean an internal one such as 192.168.x.xxx?
4) Is this thing intended to be a development or production server?
5) If a dev server have you considered an alternative such as WAMP that takes a lot of the guess work out of it?
6) Have you been messing around in the httpd.config file?
7) From the machine that you can access it from using localhost -- can you access it from that one using the IP address that's not working on the other one?

Zeety

3:33 am on Oct 27, 2012 (gmt 0)

10+ Year Member



Thank you SevenCubed :)

1) I do have some basic experience with networking and I've set up websites and forums using sql and php. However that was some time ago and my skills are a bit rusty. I'd say I'm pretty much a noob.

2) 80 and 443

3) Yes.

4) I'd say production, but for now I just want to learn how to set up a web server.

5) I have noticed in my research the other web server apps. I just wanted to give Apache a fair shot before giving up too soon.

6) I made changes according to several of those guides i found, they're all pretty much the same. I changed the ServerName and Listen to the external IP address and the DocumentRoot to a directory where a basic index.html and misc other files are located just to test. And of course they work when typing "localhost" into the browser.

7) No, it also times out after about 30 seconds.

Thanks for asking the questions, I really should have included that info in the initial post. I think I'm going to sleep on this and approach it with a clear head in the morning. I've been working on this all day.

phranque

6:48 am on Oct 27, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld Zeety!

have you run a traceroute to your IP address?

SevenCubed

1:49 pm on Oct 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One more thing I forgot. Have you tried bypassing your router? Plug your ethernet cable directly into the PC from your that is running Apache and try accessing it from the browser of that PC using the IP. That way we can eliminate the router configuration as potentially being the issue.

Zeety

1:53 pm on Oct 27, 2012 (gmt 0)

10+ Year Member



phranque, it timed out on the third hop, the fourth and final one shows the IP address of the server. I wonder if that time out means the port isn't forwarding?

SevenCubed

2:05 pm on Oct 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Zeety my last suggestion is based on my assumption that the IP you are using to access is a WAN IP -- the one you get from your ISP right?

Zeety

3:06 pm on Oct 27, 2012 (gmt 0)

10+ Year Member



SevenCubed as far as I know you can't just connect from ethernet port to ethernet port without inserting a hub inbetween, so that's what I did. The two machines are networked and internet sharing is working but the server is running XP while this, my primary machine, is running W7. The only files I can access are MyDocuments and such.

I tried your suggestion using internal and external IPs with this network setup and it also times out. But I can't be sure the hub isn't causing some conflict or port blocking in itself.

The server has a WAN connection while my primary machine is hard wired through another router. I'm just using the wireless as a means of testing the setup.

Zeety

3:39 pm on Oct 27, 2012 (gmt 0)

10+ Year Member



Oh yea, each machine has separate external IPs.

SevenCubed

4:53 pm on Oct 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have internal access using "localhost" but can't get external access


The lines of communication are breaking down here. Maybe it's just me, lets try to sort this out.

I'll use my own setup as an example to try to clarify things. I have an Apache setup too. I use it as my development environment and clients can access my progress on their site development by me granting them access via my httpd.conf file.

While developing I only use 127.0.0.1 (or localhost if you prefer as you are doing) -- that's "internal access" as you state it. Now for me "external access" would be my client across town accessing my dev server via the internet and they would input the IP address 99.204.xxx.xxx into their browser and up would pop their website in progress.

That's my understanding of "external access" -- does that match your version of understanding? I'm beginning to suspect everything you are doing is internal not anything external?

So my suggestion was to remove your router from the equation by running your ethernet cable directly from your ISP modem to your PC that has Apache on it. Then run your command prompt and get your WAN IP address that your ISP has assigned to you. Now put that IP address into your browser and you should see your root doc of your Apache server (assuming you have allowed it in your httpd.config file).

SevenCubed

4:57 pm on Oct 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SevenCubed as far as I know you can't just connect from ethernet port to ethernet port without inserting a hub inbetween, so that's what I did.


Oh yah and concerning that you can -- but you need a cross-over cable not a standard patch cable. But that's not your issue right now so don't worry about that. I just threw it in FYI.

Zeety

7:06 pm on Oct 27, 2012 (gmt 0)

10+ Year Member



Yes, that's what I meant by external access. Sorry I don't know another way to describe it :p

I too have considered removing the hard wired connection from the router in order troubleshoot the problem by the process of elimination. Unfortunately that's just not possible at this time as I would interrupt a few other people's internet connection. Being that it's the weekend everyone is using it now.

I do have access to both router's configuration utility so maybe I'll just switch them around. The other one is a different brand, it's worth a shot.

Zeety

8:58 pm on Oct 27, 2012 (gmt 0)

10+ Year Member



Okay, I plugged the server into my hardwired connection and configured that router for a VM to forward all requests to the server and it works by typing in the external IP address. But it also works by typing in the server's IP (192.168.0.97). So I'm not sure it's only accessing it because both machines are networked.

What I'll do to make sure that isn't the case is reinstall Apache on my primary machine, edit the httpd.conf file, and then use the other machine that I intended to be the server to try it over the internet on separate connection. Then once I'm sure this problem is resolved I can decide how to proceed.

I'll get back with you guys on my progress.

Zeety

11:15 pm on Oct 27, 2012 (gmt 0)

10+ Year Member



Well it's definitely not the router blocking the incoming request, nor is it the firewall on this machine because that's turned off. The only thing it can be is a bad configuration in the httpd file. Here are the changes I made from the default config:

#Listen: set to the server's IP address (192.168.0.98:80)
Listen 80

Also tried using the external, or service provider IP just for S&Gs with the same result.

ServerName 98.xxx.xx.xxx:80 set to the external IP

DocumentRoot is unchanged from default: "C:/Program Files/Apache Group/Apache2/htdocs"

<Directory "C:/Program Files/Apache Group/Apache2/htdocs"> this is left unchanged as well. I put a basic html text file in there for testing purposes, which is of course accessible through 127.0.0.1.

So I have no idea why it won't work.

SevenCubed

12:51 am on Oct 28, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, I plugged the server into my hardwired connection and configured that router for a VM to forward all requests to the server and it works by typing in the external IP address.

Great it works! But then you went on to say that again it doesn't work.

Again you are referring back to your router but I was expecting you to say it was working by bypassing the router and only going directly from your ISP MODEM. I still haven't seen you indicate you ditched the ROUTER for testing purposes. And now you are referring to multiple ROUTERS. Are you also calling your MODEM a ROUTER? For me, your last 2 posts contradict each other.

But it also works by typing in the server's IP (192.168.0.97).

Yes it would because you are on your LAN but it wouldn't work for someone from the WAN. If they type 192.168.0.97 in they would only get their own machine if they had one setup -- not yours. They can only get to yours through your WAN IP.

But if you really think the problem is in your config file then look for something like this:

<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
Order Allow,Deny
Allow from all
</Directory>

And change it to:
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
Order Allow,Deny
Allow from 127.0.0.1 98.xxx.xx.xxx 98.another.wan.ip 98.another.wan.ip
</Directory>

Then reboot your Apache for the change to take place. Also wouldn't hurt to clear your browser cache just to be sure.

Other than that I have to step aside and maybe someone else can come along and pick up the pieces -- a lot of the basics are covered already. It might just need fresh eyes and brain cells.

Zeety

12:24 pm on Oct 28, 2012 (gmt 0)

10+ Year Member



Great it works! But then you went on to say that again it doesn't work.

Again you are referring back to your router but I was expecting you to say it was working by bypassing the router and only going directly from your ISP MODEM.


It only worked because it was on the LAN and getting local access somehow, as soon as I removed it and tried it through the internet it failed. Also, I did address your suggestion about plugging it in directly to the modem and noted that that was not possible then. Today might be a better day for that.

Anyway, both machines have internet connections through a router. One is wireless and the other is hard wired. The wireless connection is only for testing purposes. I feel the probability of it being some kind of port forwarding or router firewall problem is very low now after trying it on two different routers. Especially since the second one has a much better interface, along with onscreen instructions of how exactly to set it up.

I'll try changing the <Directory> setting as you suggested. You make a good point about clearing that browser cache, I had totally forgot about that. The thing is I don't understand why I can't find any comprehensive instructions about this part of the set up anywhere. It's as if it's taken for granted or something. I don't know.

Thanks for all the time and effort you've put into helping me, SevenCubed :)

Zeety

1:51 pm on Oct 28, 2012 (gmt 0)

10+ Year Member



Found another web server app that is more noob-friendly, Abyss. It worked immediately after installation without my having to configure anything.