**以前のリビジョンの文書です**
apache proxy + usermin
Apache Proxyを使用してuserminとURL的に共存する。
- Ubuntu 10.04 Server
- 対外ドメイン : www.ainoniwa.net
- Usermin経由で各ユーザのLDAPパスワード変更だけを出来るようにする。
- userminのインストール
- <code>wget http://downloads.sourceforge.net/project/webadmin/usermin/1.470/usermin_1.470_all.deb dpkg -i usermin1.470all.deb</code>
- 簡単セッティング(もちろん、ログインしてWebUIから設定してもいい)
- <code>cd /etc/usermin </code>
- ポート番号とUsermin無効ユーザの設定
- <code>sdiff -s miniserv.conf miniserv.conf.old port=10001 | port=10000 denyusers=root guest < </code>
- パスワード変更以外の操作は無効に。
- <code>sdiff -s webmin.acl webmin.acl.old user: changepass | user: at changepass chfn commands cron cshrc fetchmail file f </code>
- パスワード参照をfileではなくLDAP(このへんは/etc/nsswitch.confとpamで対応)
- <code>sdiff -s changepass/config changepass/config.old passwdcmd= | passwdcmd=file </code>
- <code>cat /etc/pam.d/usermin #%PAM-1.0 @include common-auth @include common-account @include common-password @include common-session</code>
- ApacheのProxy経由でアクセスしても問題ないように。
- <code>sdiff -s config config.old lang=jaJP.euc < webprefix=/lab/usermin < webprefixnoredir=1 < referer=127.0.0.1 < </code> - Aapche側の設定 * Proxyモジュールの有効化 * <code>a2enmod proxy echo “LoadModule proxyhttpmodule /usr/lib/apache2/modules/modproxy_http.so”
>> /etc/apache2/mods-available/proxy.load
<
/code>
Proxyモジュールの設定
vi /etc/apache2/mods-available/proxy.conf
<code><Proxy *>
AddDefaultCharset off
Order deny,allow
Deny from all
Allow from all
</Proxy></code>
sites-avaliableの設定
<code> cat default-ssl | grep Proxy
SSLProxyEngine On
ProxyPass /lab/usermin/ https://127.0.0.1:10001/
ProxyPassReverse /lab/usermin/ https://127.0.0.1:10001/
</code>
再起動
- <code>service apache2 restart service usermin restart </code>
その他はまりどころ
- client denied by server configuration: proxy:https://127.0.0.1:12241/
- デフォルトだと、/etc/apache2/mods-available/proxy.confにAllow文がない。以下追加。
- <code>Allow from all</code>
- [warn] proxy: No protocol handler was valid for the URL /lab/usermin/. If you are using a DSO version of modproxy, make sure the proxy submodules are included in the configuration using LoadModule. * proxy.loadがデフォルトだと足りないとか。 * LoadModule proxyhttpmodule /usr/lib/apache2/modules/modproxy_http.so“
>> /etc/apache2/mods-available/proxy.load
- [error] proxy: HTTPS: failed to enable ssl support for [::1]:12241 (localhost)
- 以下のように書いていると、IPv6アクセスが発生して無理ぽ。
ProxyPass /lab/usermin/ https://localhost:10001/
- [error] [client 127.0.0.1] SSL Proxy requested for localhost:443 but not enabled [Hint: SSLProxyEngine]