阿帕奇/ Django的子网域的问题 [英] Apache/Django subdomains problem

查看:121
本文介绍了阿帕奇/ Django的子网域的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我有Apache配置只用本地主机领域的作品(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一些子域?
此子域应该显示在同一页面哪个域(本地主机)。

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).

第二个问题:可以更改默认本地主机地址(HTTP://本地主机/)?到(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

这篇关于阿帕奇/ Django的子网域的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆