#Debian8下的radosgw安裝與排錯html
具體安裝過程請參考官方文檔apache
關鍵的幾個配置文件curl
cat /etc/ceph/ceph.conf [global] .... [client.rgw.demo] host = demo keyring = /etc/ceph/ceph.client.radosgw.demo.keyring rgw socket path = /var/run/ceph/ceph-client.rgw.demo.asok log file = /var/log/radosgw/client.radosgw.demo.log rgw print continue = false
cat /etc/apache2/sites-available/rgw.conf <VirtualHost *:80> ServerName demo DocumentRoot /var/www/html ErrorLog /var/log/apache2/rgw_error.log CustomLog /var/log/apache2/rgw_access.log combined # LogLevel debug RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] SetEnv proxy-nokeepalive 1 ProxyPass / unix:///var/run/ceph/ceph-client.rgw.demo.asok|fcgi://localhost:9000/ #這裏注意對應前面ceph.conf裏面asok文件的路徑 </VirtualHost>
注意官方文檔漏掉要禁用默認site的操做,須要執行a2dissite 000-default
,測試發現報500錯誤,具體內容以下socket
curl http://10.0.2.15 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title> </head><body> <h1>Internal Server Error</h1> <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p> <p>Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.</p> <p>More information about this error may be available in the server error log.</p> <hr> <address>Apache/2.4.10 (Debian) Server at 10.0.2.15 Port 80</address> </body></html>
tail -f /var/log/apache2/rgw_error.log [Thu Sep 17 13:51:49.877636 2015] [proxy:warn] [pid 13025:tid 140558455908096] [client 10.0.2.15:33708] AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Sep 17 13:53:20.416251 2015] [proxy:warn] [pid 13026:tid 140558358009600] [client 10.0.2.15:33713] AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Sep 17 13:54:40.455318 2015] [proxy:warn] [pid 13025:tid 140558316046080] [client 10.0.2.15:33714] AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Sep 17 14:09:23.823843 2015] [proxy:warn] [pid 13993:tid 140035573221120] [client 10.0.2.15:33716] AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. [Thu Sep 17 14:13:52.140677 2015] [proxy:warn] [pid 14308:tid 139872356669184] [client 10.0.2.15:33718] AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
解決這個問題,須要開啓幾個關鍵模塊再重啓服務,官方文檔坑仍是比較多的。測試
a2enmod rewrite a2enmod proxy a2enmod proxy_fcgi service apache2 restart
說明:官方文檔對apache2的配置作了比較大的更新,2.4.9之前的版本直接使用fastcgi(mod_fastcgi),2.4.10之後使用的是Unix Domain Socket (UDS)轉factcgi(mod proxy_fcgi)。this