TurnKey Linux Virtual Appliance Library

Display internet name not IP address

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, 

Mark 

Jeremy's picture

httpd.conf is the default Apache conf location

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

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)