AipoはTomcat上で動作するjava サーブレットのグループウェアである。データベースはPostgreSQLを使用する。ここで注意が2点
&color(red){・そのままインストールするとポート80を使用するのでApache等Webサーバとバッティングする
・PostgreSQLもインストールディレクトリに新しいSQLサーバをインストールするのでPostgreSQLがすでにインストールされているとポートが5432には既存のPostgreSQLAipo用は別途別ポートが指定される~};
今回はこれら考慮し以下のように設定
Aipo5をここからDownload
$ tar zxvf aipo5020ja_linux.tar.gz $ cd aipo5020ja_linux $ tar zxvf aipo5020.tar.gz $ su # cp -a aipo /usr/local/ # cd /usr/local/aipo/bin
ここでそのままインストールするとポートが80になるので以下のファイルを変更し、ポート81に指定する。
/usr/local/aipo/bin/utf8/installer.sh
「s_port_num=80」を「s_port_num=81」に変更
# chmod a+x installer.sh
メッセージ等がUTF-8なのでターミナルをutf-8に変更 Vine4.xでは新しいユーザでloginしてrootにならないとインストール時文字コードの関係でpostgresqlでエラーしてinstallしても動作しなない(原因別途追究の必要あり、今回手ぬき)
# /installer.sh install directory is /usr/local/aipo/. utf8 install directory is /usr/local/aipo/. aipo_postgres home directory exists checking bashrc... file exists (略) ALTER ROLE /usr/local/aipo/. waiting for postmaster to shut down.... done postmaster stopped ==Aipo5.0.2.0インストール終了== user:aipo_postgres <=PostgreSQL用ユーザとしてLinuxユーザを設定される pass:e74BQzNYNUjq <=上記のユーザのパスワード directory:/usr/local/aipo/./postgres port:5433 <=PostgreSQLが動作しているときは別のPostgresを立ち上げる Aipo URL: http://10.99.99.185:81/aipo/
インストールログはaipo/bin/install.logに残る postgresqlのユーザ、パスワードもログの最後記述されている
# cd /usr/local/aipo/bin # ./startup.sh postmaster starting found temp directory Starting Aipo Version 5.0.2.0 Aipo URL: http://10.99.99.185:81/aipo/
Webでアクセスして起動を確認する。 設定はすべてWeb上から
管理者Default :admin パスワード :admin
# ./shutdown.sh waiting for postmaster to shut down..... done postmaster stopped Shutdown Aipo.
httpd.confの最後に追加
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
<Location /aipo/>
ProxyPass ajp://localhost:8009/aipo/
</Location>
Apacheとのコネクタポートは8009がデフォルトそれはaipo/tomcat/conf/server.xml に以下のように書かれている。
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" />
従来のアクセスポート81をコメントアウト
server.xml
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
<!-- <==追加
<Connector port="81"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
--> <==追加
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
Aipo,Apache再起動
TomcatではSSLは秘密鍵と証明書をpkcs12で1つのファイル(keystore)にする。これを利用する
自分でCA(認証局)を作成にあるように証明書作成してから
秘密鍵と証明書をpkcs12で1つのファイル(keystore)にする
# openssl pkcs12 -export -inkey newkey.pem -in newcert.pem -out keystore.p12 Enter Export Password: Verifying - Enter Export Password:
aipo/tomcat/conf/server.xmlを変更する
<!-- <==削除
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreType="PKCS12" <=追加
keystoreFile="/home/okada/mk_ssl_key/keystore.p12" <=追加
keystorePass="*****" /> <=追加(keystore作成時のパスワード)
--> <==削除
# cd /usr/local/aipo/bin # sh shutdown.sh
# rm -rf /usr/local/aipo
# /usr/sbin/userdel -r aipo_postgres
/usr/local/aipo/tomcat/webapps/aipo/WEB-INF/conf/JetspeedJResources.properties
181行目 変更前 action.login.enable.select.userlist=true 変更後 action.login.enable.select.userlist=false
デフォルトは30分のようだ
aipo/tomcat/conf/web.xml
<!-- ==================== Default Session Configuration ================= --> <!-- You can set the default session timeout (in minutes) for all newly --> <!-- created sessions by modifying the value below. -->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
この値を変更し再起動
PostgreSQLのDBについては今回作成された aipo_postgres0にユーザを変更
# su aipo_postgres
DBを確認
$ psql -p 5433 postgres
パスワード: <=install時の自動作成されたパスワードを入力
postgres=# select * from pg_database;
datname | datdba | encoding | datistemplate | datallowconn | datconnlimit | datlastsysoid | datvacuumxid | datfrozenxid | dattablespace | datconfig | datacl
-----------+--------+----------+---------------+--------------+--------------+---------------+--------------+--------------+---------------+-----------+------------------------------------
postgres | 10 | 6 | f | t | -1 | 10792 | 499 | 499 | 1663 | |
org001 | 10 | 6 | f | t | -1 | 10792 | 499 | 499 | 1663 | |
template1 | 10 | 6 | t | t | -1 | 10792 | 499 | 499 | 1663 | | {aipo_postgres0=CT/aipo_postgres0}
template0 | 10 | 6 | t | f | -1 | 10792 | 499 | 499 | 1663 | | {aipo_postgres0=CT/aipo_postgres0}
(4 行)
テーブルの確認
$ psql -p 5433 org001
org001=# \z
Access privileges for database "org001"
Schema | Name | Type | Access privileges
-------+--------------------------------------------------+----------+-------------------
public | aipo_license | table |
public | aipo_license_license_id_seq | sequence |
public | eip_facility_group | table |
public | eip_facility_group_id_seq | sequence |
public | eip_m_address_group | table |
public | eip_m_address_group_group_id_seq | sequence |
public | eip_m_addressbook | table |
public | eip_m_addressbook_address_id_seq | sequence |
public | eip_m_addressbook_company | table |
public | eip_m_addressbook_company_company_id_seq | sequence |
public | eip_m_company | table |
(略)
以下のようなエラーが出たらユーザを一度rootに戻し再度su aipo_postgresを行う
ERROR: invalid byte sequence for encoding "UTF8": 0xa5