mbottor's picture

I am fairly new to Turnkey and I have one question. 

How do I get apache to stop replacing the Internet name www.mysite.com with the IP address.

I thought I could modify the httpd.conf file, but there is nothing in it, so I asume this is done some place else. Or maybe something I can do in webmin? 

Be cause of various reasons, DNS is external to this server. 

Can someone please point me in the right direction? 

Thank you, 


Jeremy Davis's picture

But Debian/Ubuntu (TKL v12 is based on Debian Squeeze) do things a little differently. IMO it is laid out a lot more logically and nicer, but then again I'm used to the Debian/Ubuntu way and am probably biased...

In Debian/Ubuntu it is split up into:

  • main conf file: /etc/apache2/apache.conf
  • virtual host/site files: /etc/apache2/sites-available/
  • port config: /etc/apache2/ports.conf

However as you noticed the httpd.conf file still exists and it is read (have a look in apache.conf) so anything in there will still be applied, however other config info elsewhere may override it. So when using Debian I think it's better to do things the Debian way...

Anyway, you should find what you are looking for in the virtual host file. By default that is /etc/apache2/sites-available/default. Personally I would either back that orig file up before you change it, or create a new one (and then disable the default site and enable your new one.

To just back it up:

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/default.backup

and then edit it

nano /etc/apache2/sites-available/default

or to create a whole new site, copy the default to a new site, disable it and enable the new site:

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/new-site
a2dissite default
a2ensite new-site

and then edit your new site

nano /etc/apache2/sites-available/new-site

IIRC it should be as simple as removing the wildcard (*) and replacing it with your domain name.

Remember that'll you'll need to restart Apache for the config to be applied:

service apache2 restart

Add new comment