PDA

View Full Version : Setting up a web server on comp, behind a Belkin router


UED77
07-01-2004, 1:05 PM
I've come to the point where I am sick of ads and spam and etc from hosting sites, and their limited space and bandwidth, so I decided to (try to) set up a web server on my computer.

For this, I downloaded Apache 2.0.49, set it up, and it works wonderfully -- on my internal LAN. But when I enter my IP address, nothing comes up. =/

I tried setting DMZ, I tried rerouting all calls on port 80 to my internal ip, but still no success.

Can somebody who is experienced in the topic please help? :(

Please note that I am aware of the risks of hosting a server on my comp, and that I need no advice concerning that.
But if you happen to know sites that offer free hosting with a reasonable storage space (like 50 - 100 MB) and reasonable bandwidth, please, don't hesitate notifying me :)

UED77

Battlecruiser
07-01-2004, 1:14 PM
Fenguin hosts his site from his computer. He probably knows what the problem is.
But if you happen to know sites that offer free hosting with a reasonable storage space (like 50 - 100 MB) and reasonable bandwidth, please, don't hesitate notifying me :)
Notify me too.

Seal
07-01-2004, 1:26 PM
I used to host a small site on my own comp, but that didn't have a router besides adsl.

Find up your actual IP, no matter how. Configure your router to allow incoming traffic from port 80 (i think it's the right one) and optionally make it route it straight to your comp.

then, get another comp somewhere, and go to your IP (http://(ip here)/), if that works.

If it doesn't, can't help.

WeekendLazyness
07-01-2004, 2:08 PM
Make sure that it is routing to the correct IP on your LAN. You may have to set up a static IP range for that.

UED77
07-01-2004, 2:40 PM
Clicking on "Network Options" in Control Panel, and then viewing LAN properties shows me that DHCP assigned my comp the internal IP 192.168.2.73. When I type that in, I see the apache installation test page. The lease time for DHCP is set to forever.

However, in DMZ, I entered this IP and when I went to my IP in my browser, it couldn't find anything. "Operation timed out". I have port 80 open and routed to 192.168.2.73 as well... but it still doesn't work :(

UED77

Neo
07-01-2004, 4:32 PM
AFAIK 192. ips are ips that are specific to routers/cable modems/etc...

You need to find your actual IP (ie the one that the router is using)

Usually this is found bye going to Windows --> Run --> "command" and typing "ipconfig"

That should give you the real IP... THough if not your going to have to check your router... or whatever.

Also, as an FYI, Hosting a site on your computer may seem like a good idea, but if you have basic DSL or Cable then your only uploading things at maybe 10kb a sec (maybe 15kb or 30kb if your on the peak end of speed) that means instead of hiting the 100kb sec or 500kb sec that most sites do, your visitors are going to suffer, as will your interenet service, becuase youll be uploading stuff everytime someone visits your site...

And I found that when uploading, everyhting else on my internet slows down... specially with broadband.

If you want a good site, just go with something like Tripod, and just choose inline banners. Most places dont force you to use popups.

If you cant afford to pay for a host, your really not going to find a good place to setup a website... its just not going to happen you know?

If on the other hand, you cant find any place, or hosting the site on your computer isnt working out, feel free to contact me in a few weeks... Bye then my host will have upgraded my service, and I will be able to offer a little space on kupatrix... (this would include you know.. .like FTP access, and an sql database if you need, my server is linux/apache, so no wierd funky Windows crap to deal with ^_~)

-Neo

UED77
07-01-2004, 4:48 PM
My comp's internal IP on LAN is 192.168.2.73, and ipconfig verified that.

Alright, thanks anyway.

Neo, btw, my current host works fine most of the time, so it might be a good idea to just keep that. But if it shuts down or anything, I'll know where to turn :)

UED77

Graeme
07-01-2004, 5:42 PM
Well, first I should notify you of the 250 free hosting: http://www.250free.com
250 megs of space, not sure on the bandwidth limit.

Anyway, let's get to business, shall we? I myself have 2 servers running on 2 separate computers under the same LAN. One computer I use primarily for hosting and running IRC bots, the other I use for testing server side scripting languages (a la PHP). This combined with file transfer throughout the 2 computers and my laptop which is also on the LAN (well, I suppose it'd be on a WLAN) has done me very well thus far.

First, I must say good choice on the server ^_^. Apache is both free, and one of the best server clients around. It runs on Linux, Unix and Windows which is an automatic plus, and it is constantly being bombarded with great updates ^_^. Above all that, it's really . . . really easy to configure. Hell, if I didn't have my LinkSys router to piss me off, it probably would have been a 5 minute install job, and that's including configuring it for PHP :p.

Anyway, I ran into a similar problem when I first attempted to set up my first server. No matter what I did, I could not get the IP of the entire network to direct itself to the computer running Apache and load the pages I wished it to :/. It can be really upsetting, and I should warn you that I probably spent over 100 hours troubleshooting this, among other problems, with my router and setting up the server. How's that for a week or two of fun ^_~.

Alright, first thing's first: check your settings in your Apache config file (httpd.conf). Open it up and first scroll down to something that says 'Listen'. Make sure that you have listen set to port 80 (or whichever port you want the server located on). The syntax for this would simply be:
Listen 80
Now, scroll down into section 2. Here is where the beef of the server info is. You can set any email you want for the administrator's email - I just use my hotmail, no big deal. The servername should be YOUR entire network's IP. To figure out what your actual IP is, go here:
http://www.whatismyip.com/
Write that number down, you may need it for later as well. Now, you'll need to insert this into the file, if it isn't already there. I, for safety, also add the port number. I don't believe this is necessary though. It should look something like this (note: the x's stand for numbers, I just generally don't flaunt my IP address ^_^):
ServerName 24.112.1xx.xxx:80

The next thing you should look for is the Document Root. For now, just set it at the default page (may change, depending on where you installed it to):
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
Excellent. That's the barebones of what you need to change in this file. Try not to change anything else for simplicity's sake. If you did change something else, change it back ^_^, and then change it to whatever you want once we get things up and running.

Now, you'll need to redirect whichever port your server is hosted on (for the remainder of this little blurb, I'll assume on port 80), to the computer that is hosting the server - using your router config page or UPnP. I personally prefer UPnP because it's quick and it's easy, but most people don't have it installed. If you want to know how to install UPnP, just give me a PM.

I'll assume that you know how to log into your router page and forward ports, as it seems like you've already attempted to do so. Now, I've never used a Belkin router before, but here's the barebones of what you need to do:

*Open up a command prompt (start => run: command + hit enter) and type in ipconfig/all - after this, a bunch of stuff will be printed on your screen. You're looking for the 'IP Address' somewhere under 'Ethernet Adapter Local Area Net Connection'. I believe you said it was 192.168.2.73, but just double check to be sure.
*Go to your router port forwarding page (if there is a UPnP page, and you have UPnP enabled, all the better - if not, don't worry about it).
*Type in the following values:
name: HTTP, Ext.Port: 80, Protocol: TCP, Int.Port: 80, IPAddress: 192.168.2.73 (or whatever you found on the command prompt), Enable: checked

Click apply, and confirm that the settings have been put in place by going back to the port forwarding page and glancing that the settings are still there. If so, Hoorah, we're almost done!

Now, restart your apache server so all the changed settings take place. If you're using WinXP then you're running Apache as a service and can control it using the Apache monitor. Just hit restart on that. If you're not using WinXP, you must open up Apache using a command prompt. Just close and reopen that apache command prompt using the startmenu.

If you're using XP, make sure apache is running correctly by heading over to services (start - control panel - admin tools - services). Look for a service called 'Apache2'. Make sure that its status is 'started' and its startup type is automatic. If this is all working out fine, we should have a running apache server. Congrats!

Now, open up the internet browser of your choice and type in your real IP (by real IP, I mean the one you got from http://www.whatismyip.com/) and hit enter. If this doesn't work, try the real IP with the port number, like so:

http://24.112.1xx.xxx:80 (where the x's represent real numbers)

This should (hopefully) work, and you should be up and running ^_^. Hoorah, and congrats on getting a webserver up. Trust me, once you host using your own machine, you never go back ^_~.

UED77
07-01-2004, 9:00 PM
*sigh*

Thank you for taking your time explaining all this to me, Radlin, but it appears it doesn't work.

I modified httpd.conf according to your instructions, reconfigured the router settings, the port redirection, restarted apache.... but operation still times out when trying to contact my IP. (68.10.xxx.xxx) -- the IP of the router itself.

I tried switching DMZ on and off, but is had no effect. I even disabled ZoneAlarm but that didn't help either. :(

Anyways, thanks again, I'll try to find some compu-tech forum and post it there.

UED77

bluemicrobyte
07-02-2004, 3:55 AM
===================
Will someone PM me and tell me the risks of using your comp as a webserver? thanks!
===================

WeekendLazyness
07-02-2004, 9:23 AM
Why not post it for all to see?

Risk: People can hack your computer if you set it up poorly.

Graeme
07-02-2004, 9:37 AM
Aww, I was sure it would have worked after that :(. Alright. Well, one last thing I can think of: Have you confirmed that your settings for your router allow port forwarding and/or UPnP? There may be a checkbox you have to click somewhere in the config page.

UED77
07-02-2004, 12:07 PM
Yup, "enabled" is checked... My router doesn't like me.

UED77

Graeme
07-02-2004, 12:14 PM
Yup, "enabled" is checked... My router doesn't like me.

UED77

Hahaha, I definitely know that feeling :(. I remember the one time my router wouldn't direct me to my config page when I typed in the network IP. Reset the entire router, redid everything and it worked, then 2 hours later it didn't. Did this about 5 times before I found out what the problem was . . . I can't recall what the problem is now though . . . damn :P.

Seal
07-02-2004, 2:11 PM
===================
Will someone PM me and tell me the risks of using your comp as a webserver? thanks!
===================
Too lazy to PM :P

Risks are:
Hackers or crackers
Shortage of bandwidth from your internet connection if your site becomes popular somehow (if you have a good line, should be no problem)
DDoS attacks
Some other risks are, but don't remember them right now.

bluemicrobyte
07-02-2004, 10:21 PM
Why not post it for all to see?

Risk: People can hack your computer if you set it up poorly.can't people already hack into your computer?

WeekendLazyness
07-02-2004, 11:12 PM
can't people already hack into your computer?
Yes, but it's easier.

Fenguin
07-03-2004, 3:18 PM
Your problem might just be that your ISP denies access to port 80. Try to set it up on port 8080 or something instead. :) Which ISP do you use?

TimP
07-04-2004, 12:08 PM
I haven't seen this mentioned (if it was, I missed it). Do you have any software firewalls running on the computer? Internet Connection Firewall blocks port 80 by default and you need to open it for your server to work.

As far as the risks for running a web server, Internet Information Services (5.0/5.1) users need to be the most concerned. IIS 5.0 was released before all the big viruses (Slammer, Code Red, etc.) hit and it's often the target of viruses because of its default vulnerabilities. It's pretty easy to secure, though, as long as you have all the service packs and updates. Microsoft released a security profile called hisecweb which configures your computer to be as secure as possible. IIS 6.0 fixed this and is secure out of the box, although I doubt you're running Windows Server 2003. (IIS is tied to the operating system). Apache is generally considered secure, but read up on security issues and don't assume that you're automatically secure from the start.

Never assume you're safe because you didn't tell anyone about the site. My home server is relatively private, but a quick peek at the log reveals over 3,000 attempted Nimda and Code Red attacks in less than a month. From the second your server goes live, you're a target.

Seal
07-04-2004, 2:17 PM
You're a target since you plug your comp to the net... to correct something :P

TimP
07-04-2004, 7:26 PM
That's true. I was talking about server viruses like Nimda, though.