2016-10-19 23 views
0

私のウェブサイトを起動して実行しようとしています。すべてが正常に動作するようですが、私は、データベースへの書き込みでページに移動するとき - 私はこれを取得:データベース接続エラー:CentOS 6/Apache 2.4/Postgres 9.4/Django 1.9/mod_wsgi 3.5/python 2.7

[Wed Oct 19 09:53:12.319824 2016] [mpm_prefork:notice] [pid 12411] AH00173: SIGHUP received. Attempting to restart 
[Wed Oct 19 09:53:13.001121 2016] [ssl:warn] [pid 12411] AH01909: sXXX-XXX-XXX-XXX.secureserver.net:443:0 server certificate does NOT include an ID which matches the server name 
[Wed Oct 19 09:53:13.003578 2016] [mpm_prefork:notice] [pid 12411] AH00163: Apache/2.4.18 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_wsgi/3.5 Python/2.7.6 configured -- resuming normal operations 
[Wed Oct 19 09:53:13.003590 2016] [core:notice] [pid 12411] AH00094: Command line: '/usr/local/apache/bin/httpd' 
(XID fsf92m) Database Connect Error: Access denied for user 'leechprotect'@'localhost' (using password: YES) 
[Wed Oct 19 09:53:17.637487 2016] [mpm_prefork:notice] [pid 12411] AH00169: caught SIGTERM, shutting down 

この行は、ユーザーが「leechprotest」接続できないことを示しています

(XID fsf92m) Database Connect Error: Access denied for user 'leechprotect'@'localhost' (using password: YES) 

しかし、私は、 leechprotectというユーザーがいないMySQLは私の専用サーバにデフォルトデータベースとしてインストールされているので、leechportectはMySQLのデフォルトユーザです(私は推測しています)。

私のDjangoのsettings.pyファイル:

DATABASES = { 
    'default': { 
     'ENGINE': 'django.db.backends.postgresql', 
     'NAME': 'prelaunch_db', 
     'USER': 'postgres_user', 
     'PASSWORD': 'XXXXXXXXXXXXXXX', 
     'HOST': 'localhost', 
     'PORT': '', 
    } 
} 

私はすでに私のデータベースと、サイト全体は自宅で私のテストサーバー上で動作します知っています。私はそれがMySQLとPostgreSQLに干渉するかもしれないと思う。

ご迷惑をおかけして申し訳ございません。 (リーチ保護を無効にした後)

EDIT:

[Wed Oct 19 11:40:24.000919 2016] [ssl:warn] [pid 14754] AH01909: sXXX-XXX-XXX-XXX.secureserver.net:443:0 server certificate does NOT include an ID which matches the server name 
[Wed Oct 19 11:40:24.001851 2016] [suexec:notice] [pid 14754] AH: suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec) 
[Wed Oct 19 11:40:24.001887 2016] [:notice] [pid 14754] ModSecurity for Apache/2.9.0 (http://www.modsecurity.org/) configured. 
[Wed Oct 19 11:40:24.001892 2016] [:notice] [pid 14754] ModSecurity: APR compiled version="1.5.2"; loaded version="1.5.2" 
[Wed Oct 19 11:40:24.001897 2016] [:notice] [pid 14754] ModSecurity: PCRE compiled version="8.38 "; loaded version="8.38 2015-11-23" 
[Wed Oct 19 11:40:24.001900 2016] [:notice] [pid 14754] ModSecurity: LUA compiled version="Lua 5.1" 
[Wed Oct 19 11:40:24.001903 2016] [:notice] [pid 14754] ModSecurity: LIBXML compiled version="2.9.2" 
[Wed Oct 19 11:40:24.001905 2016] [:notice] [pid 14754] ModSecurity: Status engine is currently disabled, enable it by set SecStatusEngine to On. 
[Wed Oct 19 11:40:25.001596 2016] [ssl:warn] [pid 14755] AH01909: sXXX-XXX-XXX-XXX.secureserver.net:443:0 server certificate does NOT include an ID which matches the server name 
[Wed Oct 19 11:40:25.004276 2016] [mpm_prefork:notice] [pid 14755] AH00163: Apache/2.4.18 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_wsgi/3.5 Python/2.7.6 configured -- resuming normal operations 
[Wed Oct 19 11:40:25.004294 2016] [core:notice] [pid 14755] AH00094: Command line: '/usr/local/apache/bin/httpd -D SSL' 
(XID 6jmrjj) Database Connect Error: Access denied for user 'leechprotect'@'localhost' (using password: YES) 
[Wed Oct 19 11:40:31.847492 2016] [mpm_prefork:notice] [pid 14755] AH00169: caught SIGTERM, shutting down 

EDIT 2:

私は、Apacheのリライト機能をcPanelの上で事前に構成されていことが判明:

これらの行はhttpdのです。 confファイル:

RewriteEngine on 
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect 
Mutex file:/usr/local/apache/logs rewrite-map 

私はこれらの行をコメントアウトしようとしましたが、cPanel単にデフォルトファイルを再生成します。私が編集する方法を見て、私が見つかりました:

[[email protected]]# /usr/local/cpanel/bin/apache_conf_distiller --update 

私が見たものから、anytingは、上記のコマンドを実行しているときに永続的に保存することで<VirtualHost></VirtualHost>タグの外に書かれました。

これは、データベースエラーの問題を取り除いています。しかし、私はまだ500のサーバーエラーが発生します。他のすべてのエラーログメッセージは同じです。

答えて

0

MySQLとPostgreSQLはどちらも、「leechprotect」というユーザと一緒にはいません。しかし、Googleの検索では、このユーザ名is related to cPanelは何が起こっているのかを理解する価値があるかもしれないと指摘しています。その後、プロジェクトディレクトリのためにそれを無効にすることを検討するかもしれません。

+0

私の間違いは、投稿する前に私のウェブホスティングプロバイダに連絡して、彼らは私にleechprotectがcPanelだと言いました。また、私はcPanelで無効にしました。それは動作しません。同じ「データベース接続」エラーで、Apacheのerror_logのセキュリティに関する多くの警告が表示されます。これは、データベース書き込みでのみ発生します。また、Apacheの要求によるデータベース書き込みの場合のみです。私はカスタムdjango管理コマンドを使用してデータベースに書き込むときに動作します。 –

+0

元の投稿に編集しました。これは、リーチ防止機能を無効にした後のApacheの新しいエラーログです –

+0

[このトピック](https://forums.cpanel.net/threads/500-internal-server-error.347151/)多分、ファイルには最後に余裕はありませんが、おそらくエラーを解決しました;)btw - cPanelをまったく削除できませんか? – dahrens

関連する問題