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
    SetEnv DJANGO_SETTINGS_MODULE settings
    PythonPath "['/thomas/django_projects/project'] + sys.path"
    PythonDebug On
</Location>
<Location "/site_media">
SetHandler none
</Location>

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 (http://localhost.com/) or (http://www.localhost.com/) or something else?

link|improve this question
feedback

1 Answer

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

127.0.0.1        pl.localhost
127.0.0.1        uk.localhost
127.0.0.1        www.localhost.com

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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