0

I've been stuck in this issue: I have a PHP web page stored in my linux server, the problem is I can only access this web page when I am connected in the same LAN where the server is, but when I try access remotely I just can´t do it. What have I been doing wrong possibly?.

Another details about the server:

Installed Apache2
Installed PHP5
Installed MySQL
DynDNS domain
  • 1
    Does your server have an external IP address? –  May 29 '12 at 15:07
  • Does your ISP allow Port 80 to broadcast? –  May 29 '12 at 15:09
  • What do you mean by "access remotely"? Are you trying to browse to it via a browser? Are you ssh'ing and trying to run it? –  May 29 '12 at 15:10
  • yes, it has an external IP address, and the access to it is from a DynDNS address (myserver.example.com) –  May 29 '12 at 15:14
  • yes, i'm trying to browse to it via a browser –  May 29 '12 at 15:17
  • did you install each of those packages separately? What version of linux are you using? IMO, it is better to just download the all-in-one lamp package –  May 29 '12 at 15:18
  • Not to mention security issues, hosting your own server is a big task. Think about if you absolutely need a local server or if you can use a hosting company instead. –  May 29 '12 at 15:18
  • the packages were installed separately, I'm using Ubuntu 11.04 (GNU/Linux 2.6.38-8-server x86_64) –  May 29 '12 at 15:23
  • have you tried browsing to it with the IP address directly, instead of the domain name? If you can do that, then your DynDNS is misconfigured or the DNS entries haven't been updated (this can sometimes take a few hours) – deltree May 29 '12 at 15:25
  • Yes, It doesn't work either, I think it´s a problem with the Apache 2 configuration, because I have no problem with a web service which use apache-tomcat instead (It doesn't uses php at all). I think the port 80 in my server is locked. I'll try to look over the file php.ini –  May 29 '12 at 15:54

3 Answers3

1

The server needs to be configured to listen on a network interface that is either:

  • directly connected to the Internet
  • having a suitable port forwarded to it from a machine that is
  • accessible to a proxy server that is

The port you are listening on needs to be accessible (i.e. not blocked by a firewall, either one you control or one your ISP controls).

You then need to know the IP address of that network interface to make the connection to.

Quentin
  • 1,157
  • 6
  • 10
0

You need:

  1. A static IP address
  2. Set your router to forward port 80
  3. If needed, put your router in DMZ mode

You then must set up nameservers so you can route your own domain to your server.. otherwise, you'll just have a static IP address.

There is a great site out there that will allow you to use their domain name servers. http://www.zoneedit.com/

I believe another one is http://dyn.com/dns/ The first one is cheaper I think though; it used to be free

dockeryZ
  • 119
  • 5
0

Solved.

I had to make several changes in the apache2 configuration in my server linux (Ubuntu server 11.04). Those changes were:

1) Modified the file 'ports.conf' found on /etc/apache2. Replaced this lines:

NameVirtualHost *:80 Listen 80

for this:

NameVirtualHost *:8082 Listen 8082

2)Modified the file '000-default' found in /et/apache2/sites-enabled. Replaced this line:

VirtualHost *:80

for this:

VirtualHost *:8082

note: (I chose this port because I had another application in port 8080)

After this 2 steps, I restarted apache2 server:

sudo /etc/init.d/apache2 restart

Now I can access the server from the LAN and from the Internet. I hope this could help someone else