# I need more help with Apache2.

## Stu L Tissimus

Okay, I'm just trying it out, I'm going to host my own stuff sooner or later. I just copied Yahoo! and saved it as index.html and put it in /home/httpd/htdocs along with index_files. If I do 

```
 links http://localhost
```

 it works. However, if I do 

```
 links http://67.81.44.21
```

 (It's my IP... wow, now I'll probably get hacked to death.) it cannot find it. Is this normal?

----------

## slartibartfasz

do u have a firewall running? it might block the connection atempt from an 'unknown' host

[EDIT] and check the 'allow from' settings in your commonapache2.conf

----------

## Stu L Tissimus

(As stupid as this may sound... I have no idea where my Apache settings are... >_>

----------

## slartibartfasz

/etc/apache2/conf/commonapache.conf

/etc/apache2/conf/apache.conf

/etc/apache2/conf/modules.d/...

/etc/conf.d/apache2

----------

## Stu L Tissimus

This is the part of my commonapache2.conf with that...

```
<IfModule mod_status.c>

    <Location /server-status>

        SetHandler server-status

        <IfModule mod_access.c>

          Order deny,allow

          Deny from all

          allow from 127.0.0.1

          #Allow from .your_domain.com

        </IfModule>

    </Location>
```

Dunno what to set it to to allow everybody.

----------

## Celtis

Are you behind a router / hardware firewall or anything?

----------

## Stu L Tissimus

Yes, I am...

----------

## Stu L Tissimus

The worst thing is that... I can't seem to turn off the firewall. It's a Netgear wireless router with 4 Ethernet ports (and I'm plugged into the ports).

----------

## jamesshuang

you seem to be having the same problem I'm having, even though I think our problems have different origins...

If you have a hardware router, I'd say there should be a way to put the server into the DMZ, where it won't filter any traffic to the server, and it will forward all requests to the server.

I'd like to see how you resolve this...

----------

## Stu L Tissimus

Thanks, this is definitely getting me somewhere. Anyway, it has a box for "Default DMZ Server". I put in 192.168.0.4, but should that work, or should I put in my "real" IP? (Also, just something to know... If I go to http://67.81.44.21, it says the connection was refused. However, if I go to http://smellmyfeetj00smurf.com, which isn't a real website, it says it could not be found. So it knows it exists....

----------

## jamesshuang

I'm assuming the router is assigning the server an IP address through DHCP. You should put the server's assigned DHCP in the DMZ box then, and then it should forward all traffic over to the server. Give that a try, and let me know how it works out...

----------

## Stu L Tissimus

I'll see...

Serving a page should be easier than this! >_>

----------

## Stu L Tissimus

Wow, this is certainly strange.

I checked which devices are connected, and of course, it seems my laptop isn't. The thing is... it is. o_O >_> <_<

----------

## Celtis

I was checking if you were behind a router as I have the same thing. Because you are behind the router it gets kinda confused when you ask it to go to it's own IP address (I'm sure you could Google for a better explaination than that!) I found, in my case that there was 2 solutions:

1. Setup a DNS server and get all the machines in your network to resolve your addresses through that. That would then change the external 67.81.44.21 address to an internal address such as 192.168.0.150 (for example).

2. Edit /etc/hosts and add a line in there to along the lines of

```
192.168.0.150  webserver
```

Now all you need to do is type in http://webserver into your favourite browser and it will resolve internally.

Again, my apologies for the crappy explanation but it's too early in the morning and my brain hasn't kicked in yet  :Very Happy: 

EDIT: http://smellmyfeetj00smurf.com is an excellent name, is that what you'll be hosting?!?!

----------

## slartibartfasz

 *Stu L Tissimus wrote:*   

> This is the part of my commonapache2.conf with that...
> 
> ```
> <IfModule mod_status.c>
> 
> ...

 

thats for the server-status only - u should have a section like

```
<Directory /home/httpd/htdocs>

...

</Directory>
```

this is where u specify options for your document root u should have something like this in it to allow everybody:

```
Order allow,deny

Allow from all
```

----------

## rcxAsh

Regarding the router issue, I don't know if this will help (as some of it has already been mentioned) but these are pretty much the exact steps I took to get my web server viewable from outside my router.

Now, I have a different router than you, so telling you exactly what I clicked on will probably not be of any use, but there is probably an equivelant for your router.

Anyways, first, I enabled my router's DHCP server and reserved an IP address for my computer's unique MAC address. In my case, I chose the address 192.168.2.12.  This is now my computer's IP address on the LAN. 

Next, my router had a settings page for "Virtual Servers."  here, I could forward port requests to a specific IP address on the LAN.  Thus, I told it to forward any requests on port 80 (The webserver port) to 192.168.2.12, my computer's LAN address.  

After saving the settings, typing in my WAN address (ie, the IP address assigned by my ISP), my router forwards the port 80 request to my computer, which returns the web page to the requester.

[quote]Anyway, it has a box for "Default DMZ Server". I put in 192.168.0.4, but should that work, or should I put in my "real" IP?[/qupte]

I didn't didn't use any DMZ settings, but I would assume that you would put in your LAN address, 192.168.0.4.

----------

## Stu L Tissimus

Hmm... I'll try those... Thanks again, guys. Damn, I ****ing HATE this.

P.S. No, I'm not hosting smellmyfeetj00smurf.com...

P.S.S How do I check my MAC address?

----------

## slartibartfasz

 *Stu L Tissimus wrote:*   

> P.S.S How do I check my MAC address?

 

'ifconfig' displays it as HWaddr

----------

## Stu L Tissimus

Thanks.

----------

## Stu L Tissimus

Does anybody else have a Netgear here?

----------

## optinux

I have a netgear wireless MR814, and I can access the webserver within the network (http://192.168.0.2) but accessing the outside ip (cable modem's ip) I can't access it.  I can ping the ip though, but I can't seem to be able to access the ports.  I already tried port fwding and DMZ, it doesn't seem to work...   :Sad:   besides not being able to access the webserver I can not ssh into the machine from outside as well.

----------

## HeartBreakKid

Netgear routers DO NOT allow access to the outside (public IP) address from inside the subnet.  Just FYI.

For testing, I use another mahcine physically removed from my network, and use a good old 56K connection to my ISP.

----------

## UberLord

Sounds like you need to forward port 80 on the router to your servers internal ip address.

----------

## Stu L Tissimus

Thought I'd go retrieve this good 'ol topic... Sick of GeoCities  :Very Happy: 

HeartBreakKid, are you basically telling me that my router is never, ever going to let me be a server?

DOH!

----------

## think4urs11

It can...

IF - your provider does not block access to port 80 (http) for your ip address

All you have to do is to configure a port forwarding on your netgear router to the adress your webserver has. Thereby every packet from outside to your external ip (67...) is forwarded to your internal address.

It is configurable somewhere under advanced settings (don't have a netgear at hand in the moment)

HTH

T.

----------

## Stu L Tissimus

Umm, yeah, I did that about three months ago   :Very Happy: 

----------

## Stu L Tissimus

Bump for good luck.

I'd be willing to let somebody SSH into my box and try to solve the problem there...

----------

## Piratetrader

 *Stu L Tissimus wrote:*   

> Does anybody else have a Netgear here?

 

Mabe I can help, I run a network behind a netgear RP614v2 and it works great. I run server form one box and have two others hook up to it and all work just fine. I can get into the server with localhost and the IP and have no problems with others get on it from the net. You need to have the portfowarding set to the lan IP that your DHCP gives to your server box. Make sure its the http and port 80 and make sure its checked enable on the port fowarding.

Heres what I do to set mine, Go into your router with 192.168.0.1, then go to Port Fowarding uder the Advanced section, then under Serve Name find the http and click it, then set Server Ip Address to the Server Box and hit add then when you see the new line of boxes with the inpertanate imformation hit the Apply and you are done.

Now just to let you know I dont have to do this unless I want people from the net to get accsess to the Server. Even if I don't do this I can still accsess from any box on my Lan with the lan IP.

So it could be something else wrong.

PT

----------

## Stu L Tissimus

Yeah... Well, I guess it is something else...

Well, I just found out that my mom's friend's husband is a Linux admin, so I guess I can ask him for help...  :Razz: 

Thanks anyway.

----------

## ashayh

If you still havent solved it...

Many ISP's (Comcast, Verizon) block requests on port 80 to block prople from running websers at home.

I could get my webserver running by making Apache listen on 8080 (or whatever u like) . Remember to forward the same port from the router.

----------

