4 source_path=$(forge_get_config source_path)
5 config_path=$(forge_get_config config_path)
6 data_path=$(forge_get_config data_path)
8 cd $source_path/templates/
9 for i in httpd.conf $(ls httpd.conf.d/*); do
10 if [ ! -e $config_path/$i ]; then
11 $source_path/post-install.d/web/expand-conf.php $i $config_path/$i
14 *secrets*) chmod 600 $config_path/$i;;
18 if [ -x /usr/sbin/a2ensite ]; then
19 ln -nfs $config_path/httpd.conf /etc/apache2/sites-available/fusionforge.conf
20 a2ensite fusionforge.conf
21 elif [ -e /etc/redhat-release ]; then
22 ln -nfs $config_path/httpd.conf /etc/httpd/conf.d/fusionforge.conf
24 echo "Note: install $config_path/httpd.conf in your Apache configuration"
27 # Generate SSL cert if needed
28 cert=$config_path/ssl-cert.pem
29 key=$config_path/ssl-cert.key
30 if [ ! -e $cert -o ! -e $key ] ; then
31 openssl req -x509 -days 3650 -new -nodes -batch -text -out $cert -keyout $key
34 # Setup Docman/FRS/Tracker attachments
35 # (not done in 'make install' because e.g. dpkg ignores existing dirs, cf. DP10.9[1])
36 apache_user=$(forge_get_config apache_user)
37 apache_group=$(forge_get_config apache_group)
38 chown $apache_user: $data_path/docman/
39 chown $apache_user: $data_path/download/
40 chown $apache_user: $data_path/forum/
41 chown $apache_user: $data_path/tracker/
43 # Plugins activation from the web UI
44 chown $apache_user: $source_path/www/plugins/
46 # Enable required modules
47 if [ -x /usr/sbin/a2enmod ]; then
60 echo "TODO: enable Apache modules"
63 if [ -x /usr/sbin/a2dissite ]; then
66 # Prevent double NameVirtualHost warning
67 if [ -e /etc/apache2/ports.conf ]; then
68 sed -i 's/^NameVirtualHost \*:80/#&/' /etc/apache2/ports.conf
70 # Start web server on boot
71 if [ -e /etc/redhat-release ]; then
75 # Hard-coded detection of distro-specific Apache conf layout
76 apache_service=$(forge_get_config apache_service)
77 if service $apache_service status; then
78 service $apache_service reload
80 service $apache_service restart