Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Now I have apache configuration which works only with localhost domain (http://localhost/).

Alias /media/ "/ścieżka/do/instalacji/django/contrib/admin/media/"
Alias /site_media/ "/ścieżka/do/plikow/site_media/"
<Location "/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    PythonPath "['/thomas/django_projects/project'] + sys.path"
    PythonDebug On
<Location "/site_media">
SetHandler none

How can I make it working for some subdomains like pl.localhost or uk.localhost? This subdomains should display the same page what domain (localhost).

Second question: It is possible change default localhost address (http://localhost/) to ( or ( or something else?

share|improve this question

Simplest and rather temporary solution is to edit your '/etc/hosts' file and add something like:        pl.localhost        uk.localhost

It works provided that '/etc/hosts' is checked before asking DNS server. It is default configuration but when it is not working check '/etc/nsswitch.conf' and change line with:

hosts: ...

to have 'files' as a first entry in a sequence.

Another, way better but more time consuming solution is to run your own bind9 name server. Also check virtual name host configuration in Apache. It simplifies things.

share|improve this answer
It is work! Thanks! – user43003 May 13 '10 at 9:06
I'm glad to hear that. – Casual Coder May 13 '10 at 9:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.