Skip to main content
added 1 characters in body
Source Link
TerryLi
  • 231
  • 1
  • 7
  • 13

I am deploying a Django project on Apache. and after configuration, I open the "localhost" in the browser, and nothing showed up and the status bar just keep saying "Waiting for localhost". Here is some info.

1.Environment:

OS: Red Hat Enterprise Linux Server x86
Python: 2.7.2
Django: 1.3.1
Mod_wsgi: 3.3
Apache: 2.2.21
Django project: /var/www/html/server/videovideo1

2.Apache Config file lines added:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /var/www/html/server/video1/apache/django.wsgi

Alias /media/ /usr/local/apache2/htdocs/media/
Alias /static/ /usr/local/apache2/htdocs/static/

<Directory "/var/www/html/server/video">
Order Deny,Allow
Allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/media">
Order Deny,Allow
Allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/static">
Order Deny,Allow
Allow from all
</Directory>

3.Django.wsgi file:

import os
import os.path
import sys

sys.path.append('/var/www/html/server')
sys.path.append('/var/www/html/server/video')

os.environ['DJANGO_SETTINGS_MODULE'] = 'video1.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()   

4.settings.py lines added:

MEDIA_ROOT='/usr/local/apache2/htdocs/media/'
MEDIA_URL='/media/'
STATIC_ROOT='/usr/local/apache2/htdocs/static/'
STATIC_URL='/static/'
ADMIN_MEDIA_PREFIX='static/admin'

TEMPLATES_DIR = {
   "/var/www/html/server/video1/templates"
}

INSTALLED_APPS = {
   'django.contrib.admin'
}

5.restart apache

These are what I did, can someone help me to see if somewhere is wrong?

Thank you very much

I am deploying a Django project on Apache. and after configuration, I open the "localhost" in the browser, and nothing showed up and the status bar just keep saying "Waiting for localhost". Here is some info.

1.Environment:

OS: Red Hat Enterprise Linux Server x86
Python: 2.7.2
Django: 1.3.1
Mod_wsgi: 3.3
Apache: 2.2.21
Django project: /var/www/html/server/video

2.Apache Config file lines added:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /var/www/html/server/video1/apache/django.wsgi

Alias /media/ /usr/local/apache2/htdocs/media/
Alias /static/ /usr/local/apache2/htdocs/static/

<Directory "/var/www/html/server/video">
Order Deny,Allow
Allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/media">
Order Deny,Allow
Allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/static">
Order Deny,Allow
Allow from all
</Directory>

3.Django.wsgi file:

import os
import os.path
import sys

sys.path.append('/var/www/html/server')
sys.path.append('/var/www/html/server/video')

os.environ['DJANGO_SETTINGS_MODULE'] = 'video1.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()   

4.settings.py lines added:

MEDIA_ROOT='/usr/local/apache2/htdocs/media/'
MEDIA_URL='/media/'
STATIC_ROOT='/usr/local/apache2/htdocs/static/'
STATIC_URL='/static/'
ADMIN_MEDIA_PREFIX='static/admin'

TEMPLATES_DIR = {
   "/var/www/html/server/video1/templates"
}

INSTALLED_APPS = {
   'django.contrib.admin'
}

5.restart apache

These are what I did, can someone help me to see if somewhere is wrong?

Thank you very much

I am deploying a Django project on Apache. and after configuration, I open the "localhost" in the browser, and nothing showed up and the status bar just keep saying "Waiting for localhost". Here is some info.

1.Environment:

OS: Red Hat Enterprise Linux Server x86
Python: 2.7.2
Django: 1.3.1
Mod_wsgi: 3.3
Apache: 2.2.21
Django project: /var/www/html/server/video1

2.Apache Config file lines added:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /var/www/html/server/video1/apache/django.wsgi

Alias /media/ /usr/local/apache2/htdocs/media/
Alias /static/ /usr/local/apache2/htdocs/static/

<Directory "/var/www/html/server/video">
Order Deny,Allow
Allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/media">
Order Deny,Allow
Allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/static">
Order Deny,Allow
Allow from all
</Directory>

3.Django.wsgi file:

import os
import os.path
import sys

sys.path.append('/var/www/html/server')
sys.path.append('/var/www/html/server/video')

os.environ['DJANGO_SETTINGS_MODULE'] = 'video1.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()   

4.settings.py lines added:

MEDIA_ROOT='/usr/local/apache2/htdocs/media/'
MEDIA_URL='/media/'
STATIC_ROOT='/usr/local/apache2/htdocs/static/'
STATIC_URL='/static/'
ADMIN_MEDIA_PREFIX='static/admin'

TEMPLATES_DIR = {
   "/var/www/html/server/video1/templates"
}

INSTALLED_APPS = {
   'django.contrib.admin'
}

5.restart apache

These are what I did, can someone help me to see if somewhere is wrong?

Thank you very much

Source Link
TerryLi
  • 231
  • 1
  • 7
  • 13

Deploying Django project on Apache using Mod_wsgi

I am deploying a Django project on Apache. and after configuration, I open the "localhost" in the browser, and nothing showed up and the status bar just keep saying "Waiting for localhost". Here is some info.

1.Environment:

OS: Red Hat Enterprise Linux Server x86
Python: 2.7.2
Django: 1.3.1
Mod_wsgi: 3.3
Apache: 2.2.21
Django project: /var/www/html/server/video

2.Apache Config file lines added:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /var/www/html/server/video1/apache/django.wsgi

Alias /media/ /usr/local/apache2/htdocs/media/
Alias /static/ /usr/local/apache2/htdocs/static/

<Directory "/var/www/html/server/video">
Order Deny,Allow
Allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/media">
Order Deny,Allow
Allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/static">
Order Deny,Allow
Allow from all
</Directory>

3.Django.wsgi file:

import os
import os.path
import sys

sys.path.append('/var/www/html/server')
sys.path.append('/var/www/html/server/video')

os.environ['DJANGO_SETTINGS_MODULE'] = 'video1.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()   

4.settings.py lines added:

MEDIA_ROOT='/usr/local/apache2/htdocs/media/'
MEDIA_URL='/media/'
STATIC_ROOT='/usr/local/apache2/htdocs/static/'
STATIC_URL='/static/'
ADMIN_MEDIA_PREFIX='static/admin'

TEMPLATES_DIR = {
   "/var/www/html/server/video1/templates"
}

INSTALLED_APPS = {
   'django.contrib.admin'
}

5.restart apache

These are what I did, can someone help me to see if somewhere is wrong?

Thank you very much