Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

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

 
discard

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.