Apache / Django子域问题 [英] Apache/Django subdomains problem
问题描述
现在我有一个apache配置,只适用于localhost域( http:// localhost / )。
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>
如何使它适用于某些子域,如pl.localhost或uk.localhost?
这个子域应该显示相同的页面什么域(localhost)。
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).
第二个问题:可能更改默认localhost地址( http:// localhost / )改为( http:// localhost.com/ )或( http://www.localhost.com/ )或
Second question: It is possible change default localhost address (http://localhost/) to (http://localhost.com/) or (http://www.localhost.com/) or something else?
推荐答案
是的感谢Meska,
我解决了问题。我添加到 / etc / hosts
文件像:
yes thanks Meska,
I resolved the problem. I added to /etc/hosts
file something like:
127.0.0.1 pl。 localhost
127.0.0.1 uk.localhost
127.0.0.1 www.localhost.com
这篇关于Apache / Django子域问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!