View previous topic :: View next topic |
Author |
Message |
alienjon Veteran


Joined: 09 Feb 2005 Posts: 1726
|
Posted: Wed Mar 26, 2008 6:37 pm Post subject: Cant see my server from outside local network [kinda solved] |
|
|
I just installed apache on my computer by following the Gentoo Wiki guide. Now, when I start up apache I can see my server just fine on the local wireless network (in my house) but I can't if I try to access it from the Internet. (Via the IP: 69.177.113.146) I've installed apache before on my computer when I was up at college and it worked fine both in and out of the local network so I think it may be the router's firewall that's blocking it. (My brother has HFS setup on his computer and runs his own server from there which works fine in Windows, so maybe there's a Linux-specific thing I need to do here?)
I'm not even sure what to really look for in changing firewall settings, though. So far, I've set port 80 to be open and I've statically linked the router to give my computer the same local IP every time it requests one (via DHCP)
Last edited by alienjon on Thu Apr 03, 2008 2:47 am; edited 1 time in total |
|
Back to top |
|
 |
faux n00b

Joined: 26 Oct 2007 Posts: 61 Location: Linz, Austria
|
Posted: Wed Mar 26, 2008 6:44 pm Post subject: |
|
|
Hi!
I don't know what kind of router you have, but if you have one with a nice GUI-Webinterface (like most Netgear, D-Link, etc.) you have to look for a feature called "Port Forwarding" and you have to forward port 80 to the local IP of your server.
If you have a "more complex" router (like Cisco, etc.) you better read the handbook...
Also watch out, iptables on your server are configured correctly if enabled.
Concerning the static DHCP: I would assign a fix IP to the server, it may be a bit faster (some milliseconds maybe) and I don't see any deeper sense of assigning it through DHCP if the IP will be the same every time the server asks for an IP. |
|
Back to top |
|
 |
alienjon Veteran


Joined: 09 Feb 2005 Posts: 1726
|
Posted: Wed Mar 26, 2008 9:02 pm Post subject: |
|
|
Quote: | if you have one with a nice GUI-Webinterface (like most Netgear, D-Link, etc.) you have to look for a feature called "Port Forwarding" and you have to forward port 80 to the local IP of your server. |
Nail right on the head with that one, actually. It's a Netgear router that does have the web interface. As for the port forwarding, that's what I had meant when I said: "I've set port 80 to be open". So that port should already be open for me.
With all of that in mind, when I setup my server, I had one of the troubleshooting errors from the wiki:
Code: | (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down |
The resolution in the wiki was to remove
From /etc/apache2/httpd.conf. Now that I think about it, that would mean that apache would be running off of a different port (although I'm not quite sure how to tell which one it is using). I think ideally I should solve the actual problem that is causing the error so I do not have to remove that line. The problem is that I'm not sure whats causing it. An internet search tells me that another server must be running on my computer which is currently taking up that port, but apache isn't already running and I don't know what else on my computer might be wanting it.
**UPDATE**
I just found this post. I'm not at work right now, but that should hopefully tell me what's using the port. |
|
Back to top |
|
 |
alienjon Veteran


Joined: 09 Feb 2005 Posts: 1726
|
Posted: Thu Mar 27, 2008 5:26 am Post subject: |
|
|
Ok, I'm at a loss here. I have no idea whats wrong. The conf files all look good to me. Maybe someone who knows what they're doing will see something? (I removed the comments in httpd.conf to make things smaller except for the last few, which are ones I added in trying to figure things out)
/etc/apache2/httpd.conf: | ServerRoot "/usr/lib64/apache2"
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
<IfDefine AUTHNZ_LDAP>
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
</IfDefine>
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
<IfDefine CACHE>
LoadModule cache_module modules/mod_cache.so
</IfDefine>
LoadModule cgi_module modules/mod_cgi.so
<IfDefine DAV>
LoadModule dav_module modules/mod_dav.so
</IfDefine>
<IfDefine DAV>
LoadModule dav_fs_module modules/mod_dav_fs.so
</IfDefine>
<IfDefine DAV>
LoadModule dav_lock_module modules/mod_dav_lock.so
</IfDefine>
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
<IfDefine CACHE>
LoadModule disk_cache_module modules/mod_disk_cache.so
</IfDefine>
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule ext_filter_module modules/mod_ext_filter.so
<IfDefine CACHE>
LoadModule file_cache_module modules/mod_file_cache.so
</IfDefine>
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
<IfDefine INFO>
LoadModule info_module modules/mod_info.so
</IfDefine>
<IfDefine LDAP>
LoadModule ldap_module modules/mod_ldap.so
</IfDefine>
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
<IfDefine CACHE>
LoadModule mem_cache_module modules/mod_mem_cache.so
</IfDefine>
LoadModule mime_module modules/mod_mime.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule speling_module modules/mod_speling.so
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
<IfDefine STATUS>
LoadModule status_module modules/mod_status.so
</IfDefine>
LoadModule unique_id_module modules/mod_unique_id.so
<IfDefine USERDIR>
LoadModule userdir_module modules/mod_userdir.so
</IfDefine>
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
User apache
Group apache
Include /etc/apache2/modules.d/*.conf
Include /etc/apache2/vhosts.d/*.conf
#ServerName localhost
#ServerName 69.177.113.146
#ServerName 192.168.0.2
#Listen 80 |
Code: | # Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
<IfDefine DEFAULT_VHOST>
# see bug #178966 why this is in here
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
# Use name-based virtual hosting.
NameVirtualHost *:80
# When virtual hosts are enabled, the main host defined in the default
# httpd.conf configuration will go away. We redefine it here so that it is
# still available.
#
# If you disable this vhost by removing -D DEFAULT_VHOST from
# /etc/conf.d/apache2, the first defined virtual host elsewhere will be
# the default.
<VirtualHost *:80>
ServerName localhost
Include /etc/apache2/vhosts.d/default_vhost.include
<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>
</IfDefine>
# vim: ts=4 filetype=apache |
/etc/conf.d/apache2: | APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D MANUAL -D SSL -D SSL_DEFAULT_VHOST" |
|
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23193
|
Posted: Fri Mar 28, 2008 2:48 am Post subject: |
|
|
As root, run netstat -nptl to see all listening TCP sockets and the programs that own them. That should show you what is using port 80. |
|
Back to top |
|
 |
alienjon Veteran


Joined: 09 Feb 2005 Posts: 1726
|
Posted: Fri Mar 28, 2008 6:10 am Post subject: |
|
|
Quote: | As root, run netstat -nptl to see all listening TCP sockets and the programs that own them. That should show you what is using port 80. |
Code: | Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::80 :::* LISTEN 3245/apache2
tcp 0 0 :::443 :::* LISTEN 3245/apache2
|
Looks good to me. And as I said, I have my router set to always set my computer (by reading the network adapter's MAC address) to have the same local IP every time and also have it set to forward port 80. For the hell of it I also have it forwarding 443 as well. Still nothing, though. I immediately get a 'Problem loading page' page. It seems to me that I'm missing something basic/obvious here, but as I said a few posts ago, this has worked on this computer before, just not on my home network. |
|
Back to top |
|
 |
alienjon Veteran


Joined: 09 Feb 2005 Posts: 1726
|
Posted: Fri Mar 28, 2008 6:59 am Post subject: |
|
|
I just came across another forum posting where someone happened to mention this:
Code: | the thing with these routers is they use port 80 for the web interface. They will forward the request appropriately if its being accessed from outside your network, but not from inside. |
That being said, I went into the vhost file and changed all of the 80's to 8080's (as an arbitrary number) and reset the router to forward port 8080. Still no luck, though. (Although I may have done that wrong) |
|
Back to top |
|
 |
alienjon Veteran


Joined: 09 Feb 2005 Posts: 1726
|
Posted: Sun Mar 30, 2008 11:37 pm Post subject: |
|
|
bump |
|
Back to top |
|
 |
alienjon Veteran


Joined: 09 Feb 2005 Posts: 1726
|
Posted: Thu Apr 03, 2008 2:46 am Post subject: |
|
|
So I come in to work today (having sent myself my home's IP address via e-mail) and it turns out that I can see my server from work (well, the webpage loaded, at least) So I'm guessing I have the more common problem of 'My external IP doesn't work from within my LAN' problem (which I don't care much about, as I can test any website via localhost or my local IP and then re-test outside, later)
For that reason I'm considering this 'solved enough', although if someone else finds a better answer to this, I'd love to hear it. In addition, I found some forums mention that this problem may arise if an ISP does not permit it's consumers to run servers through their lines, so if you have this/a similar issue, it may be worth checking with your ISP to make sure they're ok with it, because they could/may block your server as well. |
|
Back to top |
|
 |
|