george h's picture

I'm using Turnkey Wordpress and trying to set up a name based server (https://httpd.apache.org/docs/current/vhosts/name-based.html) so that website urls are names instead of ip addresses. This is a continuation of a previous thread, (https://www.turnkeylinux.org/forum/support/20160622/domain-based-virtual...).

The basic idea is to create a new config file, /etc/apache2/sites-available/my-site.conf, for a new wordpress site you will put in a new folder, www/var/mysite_html. The my-site.conf file is basiclly a modification of the wordpress.conf file found in the same directory.

In the previous thread cited above, this method is well discribed. But the thread wasn't finished. It ended with an unanswered question from Jeremy Davis who was offering support. The question was, did it work? Well for me it didn't.

This seems like a simple thing that should readily work. And their are other ways to do it as well. But Turnkey Wordpess almost seems like it's hard wired to use only the ip address. Unfortunately this is not very functional when it comes to developing wordpress sites.

I think I must be missing something. But even though this issue is touched upon in a number of threads, I could get no clue. I would appreciate any help offered.

Oh, by the way. Turnkey is great. Had the site up and runing in VirtualBox in 15 minutes. Except the ip address made salad of the sites links. :)

Forum: 
george h's picture

The problem I had was solved when I updated the /etc/hosts file with the the Turnkey appliance ip and the my-site ServerName. I added something like this to the hosts file, 192.168.0.xxx  my-site. I actually did this in Turnkey Lamp, not Wordpress, but it should work with either.

I had already done this before, but here's the comedic rub. Don't do it in the hosts file found in the Debain running in your Turnkey appliance. Do it in your operating system's hosts file. You know, the one your browsers can see. :)

Here's a few more Turnkey links on setting up name-based virtual hosts for those that may be looking. But don't forget the must do /etc/hosts update.

https://www.turnkeylinux.org/forum/general/20130113/display-internet-nam...

https://www.turnkeylinux.org/forum/support/20160104/new-server-virtual-h...

https://www.turnkeylinux.org/forum/support/20111129/lamp-virtualhost-nam...

 

Jeremy Davis's picture

Apologies on my slow response.

Thanks tons for your feedback and thanks too for posting back with your solution. It sounds like your initial setup was mostly right, just that you needed a way to find the machine via domain name (which a hosts entry provides), but had inadvertently done it the wrong way...

Add new comment