-1

POST EXISTS IN UBUNTU FORUMS ALSO

Hello all, As the title describes i am trying to make my website public from a LAMP setup. I trying but i am failing... so if you could give that extra push it would be much appreciated! My setup: -VMWARE 9.0.2 -Ubuntu server 12.10 -apache2 (2.2 i think?) -php5 -mysql -phpmyadmin

Standard stuff i guess. So where am i? My website is accessible from LAN connections in http://192.168.1.147/test.php where i have the phpinfo() function and in http://192.168.1.147/ i have the it works!

I set up port forwarding on the router on port :80 with the VM's local ip address checked if the port is on (OK).

Now i was thinking next step is to change the ports.conf file?

FROM:

NameVirtualHost *:80
Listen *:80
<ifModule mod_ssl.c>
Listen 443
</ifModule>

<ifModule mod_gnutls.c>
listen 443
</ifModule>

TO:

NameVirtualHost My.IP.Add.ress:80
Listen My.IP.Add.ress:80
<ifModule mod_ssl.c>
Listen 443
</ifModule>

<ifModule mod_gnutls.c>
listen 443
</ifModule>

but then i should change the virtual host file of the /etc/apache2/sites-available/default to use the same IP and port right? thats when i get the following (after i restart or try to restart apache)

[Date] [error] (EAI 2) name or service unknown: failed to resolve server name for (check dns) or etc.. And then (99)Cannot assign requested address: make_sock: could not bind to address 1.2.3.4 no listening sockets available shutting down.

I have put my internet ip address not the local ip.

Thats my stop Thanks even for reading!

As it was suggested in the ubuntuforums i reseted the ports.conf and the /etc/apache2/sites-available/default to *:80 and checked if the port is open onhttp://www.canyouseeme.org/

the port is open as the site suggests. i changed the port.conf to *:80 and the /etc/apache2/sites-available/default --> to but when i access my ipaddress:80 i get "Server requires username and password. the server says level_15_access

P.S ofc restarted apache

czioutas
  • 91
  • 5
  • 1
    since you are doing PAT of port 80, then your destination address router will translate to your Local IP 192.168.1.147. Apache has no idea about your external IP addressing. – Danila Ladner Apr 25 '13 at 21:22
  • sooo? what do you mean? – czioutas Apr 25 '13 at 21:25
  • With this error you have you are trying access the web page of your Cisco Router and not your website, So you did not configure PAT correctly on the router. Most probably if you will telnet to that port there will be some sort of cisco login or something. – Danila Ladner Apr 25 '13 at 21:28
  • on the router i set up External Port:80,Internal Port:80 Protocol:(Both)TCP/UDP To IP Address: 192 . 168 . 1.147 which i got from ifconfig on the ubuntu server as the inet address – czioutas Apr 25 '13 at 21:34
  • What router do you use? – Danila Ladner Apr 25 '13 at 21:43
  • cisco linkys E1500 – czioutas Apr 25 '13 at 21:45
  • would i need to enable a DMZ? and what about the SPI firewall? :P – czioutas Apr 25 '13 at 21:48
  • god... would being behind another router (of the building) cause this? – czioutas Apr 25 '13 at 21:55
  • What is your router behind? Is that external ip you gave us, is it static EIP from ISP? – Danila Ladner Apr 25 '13 at 21:55
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/8493/discussion-between-drakoumelitos-and-danila-ladner) – czioutas Apr 25 '13 at 21:57
  • This is really not on-topic for Server Fault -- Magic all-in-one LAMP stacks are not supposed to be used in production, they're a developer tool. Further your router is a consumer/home device not really suited to use in a professional/server environment. – voretaq7 Apr 26 '13 at 16:22

2 Answers2

1

If your port forwarding is set up correctly, you shouldn't need to adjust any settings on Apache.

I would revert the change you made to your Apache configuration and re-test. Try running 'tcpdump' on your VM to see if traffic is reaching it from the outside world.

If not, I would check your router configuration first.

Craig Watson
  • 9,370
  • 3
  • 30
  • 46
  • i changed everything on the ports.conf fire to be as before (*:80) i will check the tcpdump and let you know – czioutas Apr 25 '13 at 21:25
  • Also, I've spotted a typo: "List *:80" should be "Listen *:80". – Craig Watson Apr 25 '13 at 21:28
  • thats probably my typo :P , did a traffic check and i saw even my local ip when i tried entered the public ip http://62.254.165.178/ – czioutas Apr 25 '13 at 21:30
  • Check your router configuration - I get an HTTP Basic Auth prompt, which at a guess may be your router's management page (side note: this should _not_ be publicly accessible!!). Try exploring your router's configuration and disabling any external (WAN) management (internal LAN management should be enabled by default). – Craig Watson Apr 25 '13 at 21:34
  • you are refering to the 192.168.1.1 where the options of the router are if i am correct but this page i get now is not the same as that one – czioutas Apr 25 '13 at 21:35
  • Essentially what we are saying (and I believe the commenter on your question has also reached this conclusion) is that your router is responding to the connection, rather than forwarding it. You will need to stop your router responding before it will forward. You'll need to consult your router's documentation on how to do this, as it's outside the scope of your original question. – Craig Watson Apr 25 '13 at 21:39
  • i will have a look at that – czioutas Apr 25 '13 at 21:40
0

You should not normally use an IP address in "Listen" and "VirtualHost" directives. These directives exist so that you can tell an apache server to which interface it has to bind on a system with multiple interfaces. Your system only has one interface. The default (using * to bind to all interdaces) is right. Get the config in a state where your request to http://192.168.1.147/test.php works again.

I think you have a network problem. Is your VMWare instance running on the same machine your are doing your tests from? In that case test first that you can get to your webserver from another PC in the same network. It might be that your virtual host is simple not reacheable.

The next step is to configure port forwarding on your router, and to test it with some computer outside your network.

This is in fact neither a UBUNTU, nor an Apache problem... This is a networking problem.

Krist van Besien
  • 1,832
  • 13
  • 16