bitnami CentOS Redmine -2

続き

linux版 bitnami apache httpd.conf

httpd.conf
/opt/redmine/apache2/conf/bitnami/bitnami.conf

ルート、中間等はここで設定

 

httpアクセスを https へリダイレクト

参考
Apacheでhttpをhttpsに強制リダイレクト

vi /opt/redmine/apache2/conf/bitnami/bitnami.conf

< VirtualHost _default_:80>
#赤字を追記
DocumentRoot "/opt/redmine/apache2/htdocs"
ServerName www.exmanple.com:80
RewriteEngine on
RewriteCond %{HTTP_HOST} ^wwwc\.example.com
RewriteRule ^/(.*)$ https://www.example.com/$1 [R=301,L]

<VirtualHost _default_:443>
DocumentRoot "/opt/redmine/apache2/htdocs"
SSLEngine on
SSLProtocol all -SSLv2

bitnami 版 apacheログファイルの場所編集

cd /opt/redmine/apache2/conf
vi httpd.conf

#bitnami 版 apache ログファイルの場所変更

ErrorLog "/var/log/httpd_error_log"
CustomLog "/var/log/httpd_access_log" common

ServerAdmin hoge@hoge.com

ServerName www.example.com:80

 

apache 再起動

#apache のみ停止
#sudo /opt/redmine/ctlscript.sh stop apache

#apache のみ起動
#sudo /opt/redmine/ctlscript.sh start apache

#apache のみ再起動
#sudo /opt/redmine/ctlscript.sh restart apache

 

apacheサービス登録

vi /etc/systemd/system/bitnami-redmine.service

[Unit]
Description=run bitnami redmine
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/opt/redmine/ctlscript.sh start
ExecStop=/opt/redmine/ctlscript.sh stop

[Install]
WantedBy=multi-user.target

 

 

redmine メールサーバ設定

##configration.yml 編集
#cd /opt/redmine/apps/redmine/htdocs/config
#cp congiration.yml comfigration.yml.org
#vi /opt/redmine/apps/redmine/htdocs/config/congiration.yml
##smtp 情報を追加
production:
delivery_method: :smtp
smtp_settings:
address: smtp.hoge.co.jp
port: 25
domain: hoge.co.jp