2017-01-19 3 views
0

Ich versuche, eine Django-App auf einem Centos-Server mit Apache und Wordpress zu implementieren. Die App arbeitet mit dem Django Build in Entwicklungsserver ohne Problem, aber wenn ich versuche, mit mod_wsgi zu implementieren, erhalte ich einen Fehler: Fehler beim Aufbau einer Datenbankverbindung.Meine Vermutung ist, dass es etwas mit der Konfigurationsdatei zu tun hat und es versucht um die app mit wordpress und nicht mod_wsgi laufen zu lassen, deshalb bekomme ich diesen wordpress fehler, aber ich habe versucht und suche, wie man das repariert und ich bin zu keiner lösung gekommen.Django Apache mod_wsgi co vorhanden mit Wordpress kann keine Datenbankverbindung herstellen

Meine Konfigurationsdateien sind zwei separate Dateien in conf.d:

django.conf:

Alias /static/ /root/mass_update/static/ 


<Directory /root/mass_update/static> 
Require all granted 
</Directory> 



WSGIScriptAlias /mass_update /root/mass_update/dashboard/wsgi.py 


<Directory /root/mass_update/dashboard> 
<Files wsgi.py> 
Require all granted 
</Directory> 

#WSGIPythonPath /var/www/mass_update/:/root/.virtualenvs/dashboard/lib/python2.7/site-packages 

WSGIDaemonProcess mass_update python-path=/root/mass_update:/root/.virtualenvs/dashboard/lib/python2.7/site-packages 
WSGIProcessGroup mass_update 

idash.conf (Wordpress):

<VirtualHost 172.31.128.20:80> 
#  ServerAlias test 

     DocumentRoot /var/www/idash 
     ServerName idash.test.gr 
     <Directory /var/www/idash> 
       AllowOverride All 
     </Directory> 
</VirtualHost> 

settings.py:

""" 
Django settings for dashboard project. 

For more information on this file, see 
https://docs.djangoproject.com/en/1.7/topics/settings/ 

For the full list of settings and their values, see 
https://docs.djangoproject.com/en/1.7/ref/settings/ 
""" 

# Build paths inside the project like this: os.path.join(BASE_DIR, ...) 
import os 
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) 


# Quick-start development settings - unsuitable for production 
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ 


# SECURITY WARNING: don't run with debug turned on in production! 
DEBUG = False 

TEMPLATE_DEBUG = False 

ALLOWED_HOSTS = ['*'] 


# Application definition 

INSTALLED_APPS = (
    'django.contrib.admin', 
    'django.contrib.auth', 
    'django.contrib.contenttypes', 
    'django.contrib.sessions', 
    'django.contrib.messages', 
    'django.contrib.staticfiles', 
    'mass_update', 
    'smart_selects', 
    'widget_tweaks', 
) 

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware', 
    'django.middleware.common.CommonMiddleware', 
    'django.middleware.csrf.CsrfViewMiddleware', 
    'django.contrib.auth.middleware.AuthenticationMiddleware', 
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 
    'django.contrib.messages.middleware.MessageMiddleware', 
    'django.middleware.clickjacking.XFrameOptionsMiddleware', 
) 

ROOT_URLCONF = 'dashboard.urls' 

WSGI_APPLICATION = 'dashboard.wsgi.application' 


# Database 
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases 

DATABASES = { 
    'default': { 
     'ENGINE': 'django.db.backends.oracle', 
     'NAME': 'test', 
    'USER': 'test', 
    'PASSWORD': 'tes', 
    'HOST': 'host_ip', 
    'PORT':'host_port', 
    } 
} 

# Internationalization 
# https://docs.djangoproject.com/en/1.7/topics/i18n/ 

LANGUAGE_CODE = 'en-us' 

TIME_ZONE = 'UTC' 

USE_I18N = True 

USE_L10N = True 

USE_TZ = True 


# Static files (CSS, JavaScript, Images) 
# https://docs.djangoproject.com/en/1.7/howto/static-files/ 

STATIC_ROOT = 'static/' 

STATIC_URL = '/static/' 

Django verbindet sich mit OracleDB. Ich habe auch '/' als WSGIScript-Alias ​​verwendet und bekomme einen Fehler von 500 error gibt es einen Konflikt mit Wordpress läuft bei '/' Ich habe mit vielen Änderungen an der Konfigurationsdatei mit Glück versucht. Hat jemand irgendwelche Vorschläge, was fehlt mir und was könnte falsch sein?

Vielen Dank.

Antwort

0

Gelöst! es scheint, dass mysql-community entfernt. Und musste es neu installieren. Nach der Installation von MySQL funktionierte alles.

Verwandte Themen