0

I've been trying this for several days now, I've followed a few tutorials (those on digital ocean I've found particularly clear) but still stuck.

Ubuntu 16.04

Installed apache2 and all dependencies. Opened iptables:

iptables -A INPUT -i $IFACE_ETH -m state --state NEW -p tcp --dport 8080 -j ACCEPT

Forwarded the port on the router and confirmed from 2 different websites that 8080 is open.

chmod -R 755 on /var/www

setup and activated site on apache2 and restarted apache2:

<VirtualHost *:8080>
        ServerAdmin webmaster@localhost
        ServerName first
        ServerAlias www.first
        DirectoryIndex index.php
        DocumentRoot /var/www/first/public_html

        <Directory /var/www/first/public_html/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Put the page into /etc/hosts

If I browse to localhost the page gets served fine. If I try to browse to it via my dynamic dns ip (I've also tried typing in my external IP) the page just gets stuck at loading and eventually times out (stops loading and shows and blank white page rather than saying "connection has timed out"). I know the dynamic ip is working as I can ssh in with this manner no problem.

What am I not doing?

TIA

5
  • We need your entire iptables rule set to be able to comment on that part. Do sudo iptables -v -x -n -L. For "setup and activated site on apache2 and restarted apache2" tell us exactly what you did. For the file segment: Is it the whole file or a segment? What is the full file name, including path. What do you mean by "Put the page into /etc/hosts". Jan 29, 2017 at 17:09
  • I'll upload my iptables rules later today when I get back to that computer. I have also tried accessing the page having flushed all rules and set default policies to accept but I get the same result. For the setup of the sites I followed this guide step by step: digitalocean.com/community/tutorials/…. I added "127.0.0.1 first" without quotes to the /etc/hosts file. What do you mean by the file segment? Jan 30, 2017 at 9:22
  • iptables: Never mind, your flushed test is good enough. Is your apache server a VPS or a local computer? If local, then try to get an external friend to try accessing via IP. Jan 30, 2017 at 15:19
  • I have tried accessing the page from a mobile device on and off the same local network as the host, from another computer on and off the network and from the computer that is hosting the page all using both the external ip as well as my dynamic dns name as wel as using the lan ip where the device was on the lan. All give the same result, a blank white page after a while spent loading. Apache server is a local computer. The only option that actually loads my page is to browse to localhost on the apache server machine. Jan 30, 2017 at 15:45
  • O.K. you have done good stuff. I am stumped. I can only suggest to try making it first.com instead of first, with no good reason as to why. Also use tcpdump, or wireshark if you prefer, to look at the actual packet traffic to from port 8080 on the server. Jan 30, 2017 at 16:20

0

You must log in to answer this question.

Browse other questions tagged .