Forum Moderators: phranque

Message Too Old, No Replies

Apache in new web server

Apache

         

jadedev

1:35 pm on Oct 22, 2007 (gmt 0)

10+ Year Member



HI,

I was reading dslwebserver.com that I could set up a web server at home. So I:

a, bought a second hand pc (that's all the money I had)

b, subscribed to an ADSL plan from an ISP (which is working ok and I can surf the web fine). I am on a satic ip plan.

The ISP provided me a modem. To configure this modem, I start IE and type in an IP address and login screen come up. I configured it as instructed.

c, I downloaded apache and installed it on my pc. I didn't change the conf file. Everything is default, using port 80

The only thing I changed is Documentroot and I cerated a "hello world" index.html file in nwe root directory. I start IE and typed in localhost and "hello world" appeared, alsso worked when I type in 127.0.0.1

d, used whatismyip.com to get my IP adddress

e, bought a doman name and registered it on a commercial DNS using the IP address in step "d".

f. Doman name is approved and everything is ready to go.

g. start IE and type in the URL that I have registered and I don't get the html file but instead I get the modem configuration page.

This is odd, I am at a total lost. Can anybody please help?

jdMorgan

1:54 pm on Oct 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's good news that you got the modem config page, since that indicates that your ISP is not blocking incoming requests on port 80 -- many do. I also indicates that your domain and DNS are properly set up.

You will need to look into configuring the modem --and any routers between it and your LAN-- to "port forward" incoming port 80 requests to the proper LAN IP address for your server (e.g. 192.168.0.2). It is possible that your modem won't support this, in which case, you'll need to buy one that does, and that works with your ISP.

As implied by the above, your server will need to have a fixed IP address on your LAN; If you use DHCP for everything else, be sure that the DHCP host (often your router or modem) 'knows' not to assign your server's IP address as part of the dynamic address pool. If it can't be configured to not do that, then use fixed addresses for all LAN hosts.

Many router manufacturers' help pages include info on port forwarding if you need more background info.

Jim

jadedev

11:00 pm on Oct 22, 2007 (gmt 0)

10+ Year Member



HI,

Thanks for your prompt response.

When I get home tonight, I shall assign a fixed IP address to my server.

1. in the dos prompt, type in IpConfig and write everything down.

2. I am running windows XP, so I go control panel, networks, TCP/IP, Properties. Change "Obtain an IP address automatically" to "use the following IP addresses".

3. Copy everything from step 1. into the three fields.

4. Click OK.

5. Turn off PC and power down modem. Start PC and modem.

Next step is to config the modem. It has a port forwarding setting, had a brief look last night, totally lost me, will look again.

By the way, the modem I am using is "Netcomm NB1 ADSL2+ Single Ethernet Modem Router".

jdMorgan

12:04 am on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't forget to either disable DHCP (probably in the modem) or to tell the DHCP host not to assign your server's fixed IP address to another computer -- The server's IP address must be removed from the 'pool' of addresses from which DHCP-assigned addresses are allocated.

[added] On Win XP, you should not have to restart the machine after making TCP/IP changes. You did have to restart on previous versions of Windows such as Win 95/Win 98, but XP can restart its TCP/IP protocol stack without a full computer restart. [/added]

Jim

[edited by: jdMorgan at 12:06 am (utc) on Oct. 23, 2007]

jadedev

12:21 am on Oct 23, 2007 (gmt 0)

10+ Year Member



My set up is one PC and one modem connected to the phone line. No other computers involved. So looks like I have to turn off DHCP in the modem.

How do I know I've done this successfully? Can I reboot my PC and do an IPConfig to see if the static IP addresses remained the same?

MatthewHSE

4:37 am on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like you're kind of new to running a server, so if that's true, may I suggest that you do some research on security first before leaving your computer exposed to the Internet like this? It's no light task to run a server securely, and it's becoming more important every day.

jadedev

5:00 am on Oct 23, 2007 (gmt 0)

10+ Year Member



Hi,

I am new to all this and need plenty of help. This is my first attempt, so there is so much to read at the moment.

As for security, I am aware plenty of stuff needs to be done, but my main aim is to get the web server going (that's the goal of the whole exercise).

jadedev

12:21 pm on Oct 23, 2007 (gmt 0)

10+ Year Member



Hi guys,

I am having problem with my NetComm NB1 modem/router. I've gone into the port forwarding page to customize a new port forwarding. After I have populated all the fields, I click apply and bottom half of the page shows my entry. All looks good. I click apply a few more times but nothing happens. if I log out now, my new customised port forwarding disappears. As that is the case, I cannot apply the new rule.

Help

jdMorgan

12:44 pm on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Part of the "art" is choosing the best way to get the info you need:

so after viewing the quite good tutorials at netcomm web site I found that one has to go to the - advanced/tools/system commands page to "save all" and restart modem/router.

Relevant search [google.com]
Netcomm NB1 modem page [netcomm.com.au]

Jim

jadedev

1:09 pm on Oct 23, 2007 (gmt 0)

10+ Year Member



I must have missed that whist reading the modem user guide.

anyhow, this port forwarding thing is still not working for me. I've followed the example in the user guide.

Say the static IP given to me by the ISP is 222.211.111.13. This is the address that I have used in the DNS.

From the user guide, I should set the Source IP Address to 0.0.0.0 because I don't know where request could be coming from.

Source netmask: I've used 0.0.0.0 again

Destination IP address is the static address of my server. The internal IP address. 192.168.x.x

destination netmask is set to 255.255.255.255, cannot change it

I've set source, destination and port map to "80"

Can you guys see anything mistakes?

jdMorgan

1:19 pm on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Source netmask must be 255.255.255.255 if you want any requests to be recognized!

Technically, the destination netmask should be 255.255.255.0 for a small LAN configured with 254 hosts, but this may not matter. Try configuring the source netmask, and see if that doesn't help first.

Jim

jadedev

12:43 pm on Oct 24, 2007 (gmt 0)

10+ Year Member



Hi,

I've tried everything but nothing works. There is even a built in port forwarding rule for web servers.

But when I type in the domain name, I still get the modem config page rather than my html file. Could my Apache config file be wrong?

jadedev

1:29 pm on Oct 24, 2007 (gmt 0)

10+ Year Member



would it help if I post my apache config file?

jdMorgan

2:04 pm on Oct 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're getting the modem config page, then the Apache config is irrelevant -- The problem is almost surely in the modem/router configuration.

Note that in the quoted forum post above, the poster observes that the 'save settings' function on the modem config pages does not work as expected, and that he had to go to the 'advanced settings' page to actually save the settings.

Jim

jadedev

10:48 pm on Oct 24, 2007 (gmt 0)

10+ Year Member



HI,

I am able to save the changes successfully. I do the save and then click on the restart button to rerestart the modem. It will connect to the Internet OK and I can open web pages but just not mind.

Just want to clarify. I've created a file called Index.html in the documentroot directory. I can open this page when I type in 127.0.0.1. If everything is working properly, when I type in the domain name, Apache by default should serve this HTML file right?

jdMorgan

1:40 am on Oct 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, it should serve that page. When using 127.0.0.1 or "localhost" though, there is a huge difference in the request's path from your browser to the server. 127.0.0.1 and "localhost" are called "loopback" addresses, so the requests to those addresses never technically leave your computer; They are looped back in the TCP/IP stack and don't even go out of the ethernet port.

Therefore, requests for the loopback addresses don't involve your router, modem, ISP, or the internet at all.

It is likely that the problem is that you're trying to use your own computer to connect out to the internet, and then back in again. Since this is one connection, it can't be going in both directions at the same time, so it won't work. Try to get a friend to connect to your domain name and see if that works, or go to a computer outside of your own network to test for yourself.

Jim

jadedev

3:46 am on Oct 25, 2007 (gmt 0)

10+ Year Member



Ah, forgotten about that one. This evening, I shall leave my pc on and get you guys to test it.

See you all in 5 hours.

jadedev

9:06 am on Oct 25, 2007 (gmt 0)

10+ Year Member



Hi,

I amusing a proxy server and I can see index.html that I created.

can you please give it a try, <snip>

[edited by: jdMorgan at 12:34 pm (utc) on Oct. 25, 2007]
[edit reason] No URLs please. See TOS. [/edit]

jadedev

11:50 pm on Oct 25, 2007 (gmt 0)

10+ Year Member



sorry mate, didn't know I wasn't allowed to do that. Thanks for removing it.

So it wasn't too hard to set up a basic web server after all, with your help of course. Install Apache, define static IP address and do the port forwarding.

My next challenge is to set up a second domain name. You see them all the time. example, webmasterworld.com and webmasterSworld.com (see the "S") go to the same place.

So I want to register a second domain and point to the same host. If I understand it correctly, I have to do set up something in apache for this right?

I shall read up on Apache today.