研究室サーバにtracとsubversionを新規インストール
TracとSubersionの新規インストールと同じ内容になりますが,Ubuntu 14.04 に設定したので,そのメモです.
sudo apt-get install trac python-setuptools apache2 libapache2-mod-wsgi python-subversion sudo easy_install Trac
svnadmin create /srv/svn/lab sudo mkdir /srv/trac sudo trac-admin /srv/trac/lab initenv sudo trac-admin /srv/trac/local initenv
Apacheの設定.
apt-get install libapache2-mod-svn sudo a2enmod ldap authnz_ldap sudo trac-admin /srv/trac/lab/ upgrade sudo trac-admin /srv/trac/lab deploy /srv/trac/lab
cat << EOF /etc/apache2/sites-available/trac.conf
WSGIScriptAlias /trac /src/trac/lab/cgi-bin/trac.wsgi
<Directory /srv/trac/lab>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
<Location "/trac/login">
AuthType Basic
AuthName "trac"
AuthUserFile /srv/trac/.thpasswd
Require valid-user
</Location>EOF
cgi-bin を有効にする
cat /etc/apache2/conf-enabled/serve-cgi-bin.conf
...
<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
<Directory "/srv/trac/lab/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
<Directory "/srv/trac/local/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
</IfDefine>
...
Trac 1.0インストール途中までのメモ書きのパーミッション変更の話が結構重要.
chmod 755 /srv/trac/lab/cgi-bin/trac.wsgi
trac の管理者の追加は,TRAC運用開始前の初期設定に関するリファレンス・ドキュメントを参照.
sudo trac-admin /srv/trac/lab permission add wataru TRAC_ADMIN
このままだと,http のアクセスのみだったので,https にするためにletsencrypto を導入.
Let’s encryptでUbuntu 16.04のApacheをhttps化するにはを参照.ただし,研究室のサーバは,まだUbuntu 14.04です.
sudo apt-get install software-properties-common sudo -E add-apt-repository ppa:certbot/certbot sudo apt-get update apt-get install python-certbot-apache -y
sudo -E letsencrypt --apache
コメントを残す