Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subdomain.example.com works fine on local machine but throws "This site can’t be reached" on server after deployed. #104

Open
VenkateshDharavath opened this issue Nov 15, 2019 · 2 comments

Comments

@VenkateshDharavath
Copy link

hello, I'm using django-hosts in my project to route to different sub-domains.
It is working quite well on my loca machine, windows 10, but on server( linux, centos 7) it is throwing an error.
I've deployed my django app with mod_wsgi-express.
hosts.py

#hosts.py

from django.conf import settings
from django_hosts import patterns, host

host_patterns = patterns('',
host(r'www', settings.ROOT_URLCONF, name='www'),
host(r'campus', 'Portal.urls', name='portal'),
)

portal urls.py

from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from .import views

urlpatterns = [
url(r'^$', auth_views.LoginView.as_view(template_name='Portal/login.html'), name='home'),
]

This set of codes are working cool, when i hit campus.localhost:8000 on local machine the desired pages are showing up. but when the same app is deployed, campus.example.com says This site cant be reached.
I'm a new to webservers, if i have to change anything like host configurations on my server or anything related to DNS please give me inputs, I have very limited knowledge on these things,
I'd really appreciate your contribution. Thank you !

@XJOJIX
Copy link

XJOJIX commented Dec 9, 2020

It seems more like a web-server or DNS problem.

check your dns setting make sure your subdomain targets your sever's ip as well.

second, if DNS setting is right,
check your apache virtualhost setting.

@michaelwpeck
Copy link

Could anyone provide an example on how to setup Apache to direct multiple subdomains to a single wsgi file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants