GitbucketのHOMEを設定
cat /usr/share/tomcat9/bin/setenv.sh
CATALINA_OPTS="-Dfile.encoding=UTF-8 -Dgitbucket.home=/var/lib/gitbucket"
が、/var/lib/gitbucketが出来てない。。。
Caused by: java.io.FileNotFoundException: /var/lib/gitbucket/database.conf (Read-only file system)
なので、一旦、jarファイルを起動し作成。アクセス権もtomcatに変更
sudo java -jar gitbucket.war --gitbucket.home=/var/lib/gitbucket/
sudo chown -R tomcat:tomcat ../../gitbucket
ls -al /var/lib/gitbucket
total 84
drwxr-xr-x 4 tomcat tomcat 4096 Sep 15 23:30 .
drwxr-xr-x 38 root root 4096 Sep 15 23:02 ..
-rw-r--r-- 1 tomcat tomcat 205 Sep 15 23:29 database.conf
-rw-r--r-- 1 tomcat tomcat 65536 Sep 15 23:30 data.mv.db
drwxr-xr-x 2 tomcat tomcat 4096 Sep 15 23:29 gist
drwxr-xr-x 3 tomcat tomcat 4096 Sep 15 23:29 plugins
それでもまだエラーがでる。systemdで読み書き用?pathの追加
/lib/systemd/system/tomcat9.service
ReadWritePaths=/var/lib/gitbucket/
apache2経由でアクセスできるようにおまじない。。追加
/etc/apache2/apache2.conf
<VirtualHost *:80>
DocumentRoot /var/lib/tomcat9/webapps
#ServerName yourhost.domain
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /gitbucket ajp://localhost:8009/gitbucket
</VirtualHost>