• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need some Apache2 & Port forwarding help

First things first, I'm a total self-taught noob. That said, I've gotten pretty far along on my own, but now I need some help and I can't find enough info just searching on my own. Here's my situation:

I have 2 ubuntu machines on my network running apache2, whose web pages I want to be able to access from the internet. 1 machine is my MythTV box, and primarily I want to be able to access MythWeb remotely. I'm also running Torrentflux, Webmin, and PhpMyAdmin on that box, and forwarding port 80 to that machine lets me do all that. Each of those is password protected.

Just recently I set up a 2nd box running a headless fileserver with Samba, and I've also installed Torrentflux and PunBB (forum software) on this box (along with Webmin, too). I would like to discontinue using Torrentflux on my MythTV box and instead run it on the fileserver.

I can access everything locally on my network just fine, but it seems like I can only access 1 box or the other from outside my router, depending on which one I forward port 80 to.

I've tried editing /etc/apache2/ports.conf to listen to port 8080, and then forwarding that port to that machine, but for whatever reason, all I get is 404 errors when I try to connect to, for example, http://myipaddress:8080/forums

Can anyone tell me if there are additional configuration files that I need to edit to get my fileserver box to properly listen to port 8080 and then serve me my Torrentflux and PunBB pages? I feel like there's something stupid I'm overlooking and I'm too much of a noob to know what it is. For what it's worth, though, I *DO* know enough to restart my apache server when I change the port it's listening to. 🙂

Finally, might there be a better way to do this, overall? For example, my router (using DD-WRT) supports VPN, and naturally this would all work while I'm VPN'd into my network, but I'd rather they were publicly accessible, relying on the port differentiation to determine which server I'm accessing, and each application's own password security to restrict access.
 
Well, I think I figured something out.

I guess I don't really need apache2 to listen to a different port. I just set my router to forward port 8080 to port 80 on the fileserver box and it works just fine. Dunno why I didn't think of that earlier. Guess I'm just too nooby. 🙂

If anyone has any suggestions on how to set it up more cleanly, please feel free to submit them. Otherwise, thanks for reading anyway. 🙂
 
What you have is going to be the easiest to work with IMO.

You were on the right path before though, the only left for you to configure would have been your virtual hosts. By default your websites that are being hosted by apache are stored in /etc/apache2/sites-available/

They are then symbolically linked to /etc/apache2/sites-enabled/ after you run a2ensite <website_name>.

Each of those files will contain the definition of one of your virtual hosts, they should start with a directive like
<VirtualHost *:80>
...
</VirtualHost>

That tells apache to host that virtual server on every IP on port 80. Once you add port 8080 to /etc/apache2/ports.conf you need to change the virtual hosts to listen on that port as well.

 
Originally posted by: Crusty
What you have is going to be the easiest to work with IMO.

You were on the right path before though, the only left for you to configure would have been your virtual hosts. By default your websites that are being hosted by apache are stored in /etc/apache2/sites-available/

They are then symbolically linked to /etc/apache2/sites-enabled/ after you run a2ensite <website_name>.

Each of those files will contain the definition of one of your virtual hosts, they should start with a directive like
<VirtualHost *:80>
...
</VirtualHost>

That tells apache to host that virtual server on every IP on port 80. Once you add port 8080 to /etc/apache2/ports.conf you need to change the virtual hosts to listen on that port as well.

See that's the kinda stuff I wouldn't know, and was unable to uncover with my own searching.

Thanks, Crusty. I'm going to leave it like I have it, anyway, but at least I learned something new that I can use later, if I need it.
 
By the way, did anyone else know that MythWeb has a built-in default page format for mobile browsers? I can program TV recordings from my phone! 😎
 
but if he's not running virtualhost that wont work. you need to modify the port in apache2.conf to point to port 8080
 
Back
Top