Line 222: |
Line 222: |
| | | |
| ==== configure httpd reverse proxy ==== | | ==== configure httpd reverse proxy ==== |
| + | the easy way is :<syntaxhighlight lang="bash"> |
| + | mkdir /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/ -p |
| + | cat > /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/28SeafileProxyPass <<- 'EndOfMessage' |
| + | # Seahub for Seafile ProxyPass |
| + | { |
| + | $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no'; |
| + | $seahubPort = ${'seafile'}{TCPPort} || '8000'; |
| + | $OUT = ''; |
| + | if ((${'seafile'}{'status'} || 'disabled') eq 'enabled' ){ |
| + | |
| + | if (($port eq "80") && ($haveSSL eq 'yes')){ |
| + | $OUT .= " RewriteRule ^/seafile(/.*|\$) https://%{HTTP_HOST}/seafile\$1 [L,R]\n"; |
| + | } |
| + | else{ |
| + | $OUT .= " ProxyPass /seafile http://127.0.0.1:$seahubPort\n"; |
| + | $OUT .= " ProxyPassReverse /seafile http://127.0.0.1:$seahubPort\n"; |
| + | } |
| + | |
| + | $OUT .=<<"HERE"; |
| + | |
| + | <Location /seafile> |
| + | SSLRequireSSL on |
| + | order deny,allow |
| + | deny from all |
| + | allow from $localAccess $externalSSLAccess |
| + | </Location> |
| + | |
| + | HERE |
| + | } |
| + | } |
| + | EndOfMessage |
| + | expand-template /etc/httpd/conf/httpd.conf |
| + | service httpd-e-smith restart |
| + | </syntaxhighlight>and then you have to change the configuration to show correctly the images |
| + | |
| + | alternatively if you want to use a domain this way : seafile.mydomain.com<syntaxhighlight lang="bash"> |
| + | mkdir /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/ -p |
| + | cat > /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/28SeafileProxyPass <<- 'EndOfMessage' |
| + | # Seahub for Seafile ProxyPass |
| + | { |
| + | $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no'; |
| + | $seahubPort = ${'seafile'}{TCPPort} || '8000'; |
| + | $seahubdomain = ${'seafile'}{domain} || 'disabled'; |
| + | $OUT = ''; |
| + | if ((${'seafile'}{'status'} || 'disabled') eq 'enabled' && $seahubdomain eq 'disabled' ){ |
| + | |
| + | if (($port eq "80") && ($haveSSL eq 'yes')){ |
| + | $OUT .= " RewriteRule ^seafile(/.*|\$) https://%{HTTP_HOST}seafile\$1 [L,R]\n"; |
| + | } |
| + | else{ |
| + | $OUT .= " ProxyPass /seafile http://127.0.0.1:$seahubPort\n"; |
| + | $OUT .= " ProxyPassReverse /seafile http://127.0.0.1:$seahubPort\n"; |
| + | } |
| + | |
| + | $OUT .=<<"HERE"; |
| + | |
| + | <Location /seafile> |
| + | SSLRequireSSL on |
| + | order deny,allow |
| + | deny from all |
| + | allow from $localAccess $externalSSLAccess |
| + | </Location> |
| + | |
| + | HERE |
| + | } |
| + | elseif ($seahubdomain ne 'disabled' ) { |
| + | if (($port eq "80") && ($haveSSL eq 'yes')){ |
| + | $OUT .= " RewriteRule ^(/.*|\$) https://$seahubdomain\$1 [L,R]\n"; |
| + | } |
| + | else{ |
| + | $OUT .= " ProxyPass / http://127.0.0.1:$seahubPort\n"; |
| + | $OUT .= " ProxyPassReverse / http://127.0.0.1:$seahubPort\n"; |
| + | } |
| + | } |
| + | } |
| + | EndOfMessage |
| + | expand-template /etc/httpd/conf/httpd.conf |
| + | service httpd-e-smith restart |
| + | </syntaxhighlight> |
| | | |
| === Installation === | | === Installation === |