Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

closed as off topic by Andrew, Ward, Jenny D, Dave M, voretaq7 Apr 26 '13 at 16:22

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

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? –  drakoumelitos 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 –  drakoumelitos Apr 25 '13 at 21:34
    
What router do you use? –  Danila Ladner Apr 25 '13 at 21:43

2 Answers 2

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.

share|improve this answer
    
i changed everything on the ports.conf fire to be as before (*:80) i will check the tcpdump and let you know –  drakoumelitos 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 62.254.165.178 –  drakoumelitos 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 –  drakoumelitos Apr 25 '13 at 21:35

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.