Jon Moore's picture

Hey Guys.

While I know that this isn't likely Turnkey specific, I don't know where else to check...

So I have Turnkey LAPP installed, configured, and running fine. Now I am trying to add some virtual hosts to apache. Amongst some other requirements, I need to listen to some extra ports, like 8080, 4434, and maybe some random others (to be determined in the future).

I created a new virtuial host for port 8080. I left everything defaults, and applied the changes after I made them (I also wound up stopping/starting Apache, to the same results listed below). I also added a rule in the firewall tab to allow port 8080 (I also changed the default action to 'Accept' as well, again, to the same results below). When I try to browse to 'http://<serverIP>:8080', right away I get an error page "can't establish a connection to the server at <serverIP>:8080".

Using apt-get install, I installed tcpdump, and can verify, 100% for sure that the packets are getting to the device.

Lastly, I even tried just editing the 'default' server listening to port 80, and just changed the port to 8080, and still got the same reults.

Did I miss something? Did I do something wrong? Any and all help is greatly appreciated.



OnePressTech's picture

Check your ISP firewall to ensure you can get through.

If it is not firewall related then you are likley going to need to post your apache config info for the TKLX community to offer suggestions.

Don't post anything private though.



Tim (Managing Director - OnePressTech)

OnePressTech's picture

I missed your tcpdump statement.


Tim (Managing Director - OnePressTech)

Jeremy Davis's picture

Usually it's declared in /etc/apache2/ports.conf and is simply something like:

listen 8080

Then restart Apache

service apache2 restart

You can confirm (or not) that it's listening with netstat:

netstat -tulpn | grep 8080

FYI: t&u=tcp/udp; l=listening; p=program; n=use numerical info not names

Jon Moore's picture

Hey! Thanks for the quick response!

So I edited the ports.conf file, restarted apache2, and now it works. Thanks a ton for this, I do not think I EVER would have found it on my own.

On another note though... Why do I need to manually make this edit? I thought the purpose of having Wedmin like this was to automate these edits... Like I should be able to just go in Webmin, create the new Virtual Host, and that edit (at least in my mind) should be automatic, as a part of that Virtual Host. Is it that my understanding of this is wrong? Did I do, or not do, something that would cause this? Is this edit "typical" and to be expected?



OnePressTech's picture

Hey Jon,

Jed's pretty darn good at support isn't he. Years of sysadmin war wounds I would venture.

Regarding Webmin...

Webmin is just a convenience tool. It provides a GUI for those who don't like to manually edit files through a command-line interface. It is not a functional wizard. If you make changes to any files in the virtual appliance you will need to tread carefully and do your homework whether at the command line or via Webmin. Making changes at the command line to appliance files or via Webmin have the same result.



Tim (Managing Director - OnePressTech)

Jeremy Davis's picture

I didn't realise that you were using Webmin - and TBH even if I did I still probably would have given you 'manual' instructions as they are easier for me to remember and more foolproof to apply IMO.

For the record ports can be added via Webmin too. You'll find it under Servers>>Apache Webserver>>Global configuration>>Networking and Addresses>>Listen on addresses and ports (To demonstrate my point, I had to load up Webmin to remember how to find the right setting - and IMO the instructions in my previous post are more straight forward and easier to follow).

And like Tim said, Webmin is more or less just a pretty front end to edit the same config files. Whilst it may seem intuitive to you for it to automatically add a port that applies to a new virtual host; from an Apache config perspective it isn't really. The ports Apache listens on are global. I.e. Apache only listens to a port - or not (actually it's not quite that simple as you can listen on different interfaces for specific ports, just like virtual hosts can - but you get my drift I hope...). Whereas it is not uncommon to have many virtual hosts listening to the same port (in fact that it generally what people would want; sub-domains and sub directories available via default ports).

So with that in mind, I doubt it's author would probably ever automate the global port addition. Although perhaps he would? It could certainly be done. If you feel strongly about it enough then you could always contact the dev and ask him to add that functionality. Have a look on this page for links to forum/mailing list where you can find out the best place to make that request. Having said all that, perhaps it would make sense if it was at least mentioned as a note on the page where you add a new virtual host!?

@Tim - thanks for the kind words mate! :)

Jon Moore's picture

@Tim - Indeed Jeremy is more than pretty good; he's AWESOME! I have had commercial support not answer simpler questions in this kind of time.

And to the both of you, thanks for the info. While I knew and realized that Webmin was more of a pretty front-end, I was not aware there was that separation between the Apache Global Config and the individual Virtual Hosts. Thank you for clarifying this; I will not be forgetting anytime

As for the Webmin steps, I have checked them out as well, and NOW that you've pointed it out, I don't know how it is I did not see it in the first place when I was trying to figure it out on my own. Again, now that it is pointed out, I will not fogetting about this either.

I made the changes and now everything is working as expected. I was afraid that I was doing something wrong and messing things up for that reason. It is good to know that, although technically I was doing something wrong, it was more of missing something that was my issue.

Tim and Jeremey, thanks a ton for this info!

Add new comment