2017-05-05 62 views
0

我在配置我的apache和新的子域時遇到了問題。使用mod_wsgi和SSL的石墨的Apache子域名

及其與的Apache2和石墨Ubuntu的服務器,我有石墨端口80上工作(通過apt-get的安裝)

現在Apache服務器目前是一個網站(https://subdomain1.domain.com),我想設置Apache爲https://subdomain2.domain.com(443端口)上的石墨應用提供服務。這是這樣subdomain1可以訪問石墨圖表。

這是我的Apache2-graphite.conf

<VirtualHost *:80> 

    WSGIDaemonProcess _graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120 user=_graphite group=_graphite 
    WSGIProcessGroup _graphite 
    WSGIImportScript /usr/share/graphite-web/graphite.wsgi process-group=_graphite application-group=%{GLOBAL} 
    WSGIScriptAlias//usr/share/graphite-web/graphite.wsgi 

    Alias /content/ /usr/share/graphite-web/static/ 
    <Location "/content/"> 
      SetHandler None 
    </Location> 

    ErrorLog ${APACHE_LOG_DIR}/graphite-web_error.log 

    # Possible values include: debug, info, notice, warn, error, crit, 
    # alert, emerg. 
    LogLevel warn 

    CustomLog ${APACHE_LOG_DIR}/graphite-web_access.log combined 

</VirtualHost> 

和/usr/share/graphite-web/graphite.wsgi:

import os, sys 
os.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings' 

import django.core.handlers.wsgi 

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

from graphite.logger import log 
log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid()) 
import graphite.metrics.search 

我試圖改變港口和設置ServerName和ServerAlias,並啓用SSL,但我還沒有能夠得到這個工作。

樣品(不工作):

<IfModule mod_ssl.c> 

<VirtualHost *:443> 


     ServerName graphite.<my_domain_here>  

     WSGIDaemonProcess _graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120 user=_graphite group=_graphite 
     WSGIProcessGroup _graphite 
     WSGIImportScript /usr/share/graphite-web/graphite.wsgi process-group=_graphite application-group=%{GLOBAL} 
     WSGIScriptAlias//usr/share/graphite-web/graphite.wsgi 

     Alias /content/ /usr/share/graphite-web/static/ 
     <Location "/content/"> 
       SetHandler None 
     </Location> 

     ErrorLog ${APACHE_LOG_DIR}/graphite-web_error.log 

     # Possible values include: debug, info, notice, warn, error, crit, 
     # alert, emerg. 
     LogLevel warn 

     CustomLog ${APACHE_LOG_DIR}/graphite-web_access.log combined 


     SSLEngine on 

     SSLCertificateFile /etc/apache2/ssl/public.crt 
     SSLCertificateKeyFile /etc/apache2/ssl/private.key 
     SSLCACertificateFile /etc/apache2/ssl/ca.crt 


</VirtualHost> 

回答

0

我發現我在做什麼錯誤:

我添加子域名到我的/ etc/hosts中我的工作站上,它的工作!

註冊了我們的虛擬主機和一切OK的子域現在

生病離開這裏這個情況下,它可以幫助別人......

+1

''ServerName''不應該有'':443''最後也是。它只是主機名。可能只有你也有''ServerAlias''。修復''ServerName''並移除''ServerAlias''。 –

+0

我更新了VirtualHost條目,感謝那個Graham – stackoverflows