使用mod_wsgi和SSL的graphite Apache子域
我在用新子域配置apache时遇到问题 这是一个带有apache2和graphite的ubuntu服务器,graphite在端口80上工作(通过apt get安装) 现在,apache服务器目前提供一个网站()服务,我想将apache设置为在(端口443)上提供graphite应用程序。这使得子域1可以从graphite访问图表 这是我的apache2-graphite.conf使用mod_wsgi和SSL的graphite Apache子域,ssl,apache2,subdomain,mod-wsgi,graphite,Ssl,Apache2,Subdomain,Mod Wsgi,Graphite,我在用新子域配置apache时遇到问题 这是一个带有apache2和graphite的ubuntu服务器,graphite在端口80上工作(通过apt get安装) 现在,apache服务器目前提供一个网站()服务,我想将apache设置为在(端口443)上提供graphite应用程序。这使得子域1可以从graphite访问图表 这是我的apache2-graphite.conf <VirtualHost *:80> WSGIDaemonProcess _graphite
<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>
我尝试过更改端口,设置服务器名和服务器别名,并启用SSL,但一直无法实现
样本(不工作):
服务器名石墨。
WSGIDaemonProcess(graphite进程=5个线程=5个显示名称=“%$GROUP}”非活动超时=120用户=(graphite组=)
石墨
WSGIImportScript/usr/share/graphite web/graphite.wsgi进程组=_graphite应用程序组=%{GLOBAL}
WSGIScriptAlias//usr/share/graphite-web/graphite.wsgi
别名/content//usr/share/graphite-web/static/
SetHandler无
ErrorLog${APACHE_LOG_DIR}/graphite-web_error.LOG
#可能的值包括:调试、信息、通知、警告、错误、临界值、,
#警惕,埃默格。
日志级别警告
CustomLog${APACHE\u LOG\u DIR}/graphite-web\u access.LOG组合
斯伦金安
SSLCertificateFile/etc/apache2/ssl/public.crt
SSLCertificateKeyFile/etc/apache2/ssl/private.key
SSLCACertificateFile/etc/apache2/ssl/ca.crt
我发现自己做得不正确:
我将子域添加到我工作站上的/etc/hosts中,它成功了
在我们的网络主机上注册了子域,现在一切正常
我会把这个放在这里,以防它对其他人有帮助…
ServerName
结尾也不应该有:443
。它只是主机名。可能只适用于您也有ServerAlias
的情况。修复ServerName
并删除ServerAlias
。我更新了VirtualHost条目,谢谢Graham
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
<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>