Ubuntuã§apacheããªãã¼ã¹ãããã·ã«ããæé
Ubuntu9.0.4ã§apacheããªãã¼ã¹ãããã·ãµã¼ãã¼ã«ãã¦ãåããã·ã³ã®8080ãã¼ãã§åä½ãã¦ããWebrickãµã¼ãã¼ã«å¤é¨ããã¢ã¯ã»ã¹ã§ããããã«ããæé ã§ãã
æ¦è¦
- proxyã¢ã¸ã¥ã¼ã«ã®æå¹å
- è¨å®ãã¡ã¤ã«ã®ç·¨é
- apacheã®åèµ·å
1.proxyã¢ã¸ã¥ã¼ã«ã®æå¹å
以ä¸ã®ã³ãã³ããå®è¡ãã¦proxyã¢ã¸ã¥ã¼ã«ãæå¹åãã¾ãã
sudo a2enmod proxy_http
2.è¨å®ãã¡ã¤ã«ã®ç·¨é
proxyã¢ã¸ã¥ã¼ã«è¨å®ãã¡ã¤ã«ãç·¨éããè¨å®ã追å ãã¾ãã
sudo vi /etc/apache2/mods-enabled/proxy.conf
è¨å®å 容ã¯ä»¥ä¸ã®ãããªæããä¾ã«ãã£ã¦ãBasicèªè¨¼ã¨SSLã§ã®æå·åãæå¹ã«ãã¦ãã¾ãã
<IfModule mod_proxy.c> ProxyRequests Off <Proxy http://localhost:8080/ > # SSLã§ã®æ¥ç¶ã®ã¿è¨±å¯ããã # ãsudo a2enmod sslãã§SSLãæå¹åãã¦è¨å®ããã¦ãããã¨ã SSLRequireSSL Order deny,allow Allow from all #Basicèªè¨¼ã®è¨å® AuthType Basic AuthName "foo" AuthUserFile /etc/apache2/mods-enabled/users.passwd Require valid-user </Proxy> ProxyPass /foo/ http://localhost:8080/ ProxyPassReverse /foo/ http://localhost:8080/ </IfModule>
3.apacheã®åèµ·å
è¨å®ãå®äºããããapacheãåèµ·åãã¾ãã
sudo /etc/init.d/apache2 restart
åèµ·åå¾ã
https://<ãµã¼ãã¼>/foo/
ã§ãWebrickãµã¼ãã¼ã®ãµã¤ãã«ã¢ã¯ã»ã¹ã§ããã¯ãã§ãã
æé ã¯ä»¥ä¸ãjijiã¯åç¬ã§ã¯èªè¨¼æ©è½ãSSLã§ã®éä¿¡æå·åæ©è½ãæã£ã¦ãã¾ããããapacheããªãã¼ã¹ãããã·ã«ãããã¨ã§ãããã®æ©è½ãå®ç¾ã§ãã¾ãããªããCentOSでの手順はこちらを参照ください。