+The following information may be helpful to developers.
+
The different httpd.conf.d-*/ directories are *generated* out of
-contents of httpd.conf.d/.
+contents of 'httpd.conf.d/'. At the moment, there are 3 flavours of
+these files ("fhs", "opt" and "usrlocal").
+
+The script src/utils/manage-apache-config.sh must be used to
+regenerate the files for these flavours.
-See src/utils/manage-apache-config.sh
+Please make modifications in the source files inside 'httpd.conf.d/'
+and regenerate.
-Please make modifications in the source files inside httpd.conf.d/.
+More details available in :
+http://lists.fusionforge.org/pipermail/fusionforge-general/2010-June/001074.html
-- Olivier Berger
# Include all FusionForge-related configuration files
+#
+# TODO: add a pointer to documentation about the Apache configuration of FusionForge
+#
Include /etc/gforge/httpd.conf.d/*.conf
+# Name-based Virtual Host Support : supports multiple websites over a single IP address
+
NameVirtualHost *:80
NameVirtualHost *:443
#
-# Main directory options
+# Main directory options (/usr/share/gforge/www contains the PHP scripts of FusionForge)
#
<Directory /usr/share/gforge/www>
Options Indexes FollowSymlinks
AllowOverride All
+ # define access restrictions for the main site
Include /etc/gforge/httpd.conf.d/auth-main.inc
#
#
# Main host
#
+
+# Differences between HTTP and HTTPS are in ssl-on.inc/ssl-off.inc
+
<VirtualHost *:80>
Include /etc/gforge/httpd.conf.d/vhost-main.inc
Include /etc/gforge/httpd.conf.d/block-trace.inc
-Attention : contents of this directory are *generated files*.
+Attention developers : contents of this directory are *generated
+files* for FHS like paths.
See ../README.httpd-conf-d-flavours for more details
+-- OlivierBerger
+
+# We are inside <VirtualHost ...>
+
ServerName {core/web_host}
ServerAlias www.{core/web_host}
ServerAdmin webmaster@{core/web_host}
UserDir disabled
</IfModule>
+# Define configuration/env variables for passing passwords and other secrets to PHP
<Directory /usr/share/gforge/www>
Include /etc/gforge/httpd.conf.d/secrets.inc
</Directory>
-# per-project vhost content
+# per-project vhost content : myproject1.myforge.com, myproject2.myforge.com, etc.
ServerName siteadmin.{core/web_host}
ServerAlias *.{core/web_host}
+# Name-based Virtual Host Support : supports multiple websites over a single IP address
+
NameVirtualHost *:80
NameVirtualHost *:443
#
-# Main directory options
+# Main directory options (/opt/gforge/www contains the PHP scripts of FusionForge)
#
<Directory /opt/gforge/www>
Options Indexes FollowSymlinks
AllowOverride All
+ # define access restrictions for the main site
Include /etc/gforge/httpd.conf.d/auth-main.inc
#
#
# Main host
#
+
+# Differences between HTTP and HTTPS are in ssl-on.inc/ssl-off.inc
+
<VirtualHost *:80>
Include /etc/gforge/httpd.conf.d/vhost-main.inc
Include /etc/gforge/httpd.conf.d/block-trace.inc
-Attention : contents of this directory are *generated files*.
+Attention developers : contents of this directory are *generated
+files* for /opt like paths.
See ../README.httpd-conf-d-flavours for more details
+-- OlivierBerger
+
+# We are inside <VirtualHost ...>
+
ServerName {core/web_host}
ServerAlias www.{core/web_host}
ServerAdmin webmaster@{core/web_host}
UserDir disabled
</IfModule>
+# Define configuration/env variables for passing passwords and other secrets to PHP
<Directory /opt/gforge/www>
Include /etc/gforge/httpd.conf.d/secrets.inc
</Directory>
-# per-project vhost content
+# per-project vhost content : myproject1.myforge.com, myproject2.myforge.com, etc.
ServerName siteadmin.{core/web_host}
ServerAlias *.{core/web_host}
+# Name-based Virtual Host Support : supports multiple websites over a single IP address
+
NameVirtualHost *:80
NameVirtualHost *:443
#
-# Main directory options
+# Main directory options (/usr/local/share/gforge/www contains the PHP scripts of FusionForge)
#
<Directory /usr/local/share/gforge/www>
Options Indexes FollowSymlinks
AllowOverride All
+ # define access restrictions for the main site
Include /etc/gforge/httpd.conf.d/auth-main.inc
#
#
# Main host
#
+
+# Differences between HTTP and HTTPS are in ssl-on.inc/ssl-off.inc
+
<VirtualHost *:80>
Include /etc/gforge/httpd.conf.d/vhost-main.inc
Include /etc/gforge/httpd.conf.d/block-trace.inc
-Attention : contents of this directory are *generated files*.
+Attention developers : contents of this directory are *generated
+files* for /usr/local like paths.
See ../README.httpd-conf-d-flavours for more details
+-- OlivierBerger
+
+# We are inside <VirtualHost ...>
+
ServerName {core/web_host}
ServerAlias www.{core/web_host}
ServerAdmin webmaster@{core/web_host}
UserDir disabled
</IfModule>
+# Define configuration/env variables for passing passwords and other secrets to PHP
<Directory /usr/local/share/gforge/www>
Include /etc/gforge/httpd.conf.d/secrets.inc
</Directory>
-# per-project vhost content
+# per-project vhost content : myproject1.myforge.com, myproject2.myforge.com, etc.
ServerName siteadmin.{core/web_host}
ServerAlias *.{core/web_host}
+# Name-based Virtual Host Support : supports multiple websites over a single IP address
+
NameVirtualHost *:80
NameVirtualHost *:443
#
-# Main directory options
+# Main directory options ({core/source_path}/www contains the PHP scripts of FusionForge)
#
<Directory {core/source_path}/www>
Options Indexes FollowSymlinks
AllowOverride All
+ # define access restrictions for the main site
Include {core/config_path}/httpd.conf.d/auth-main.inc
#
#
# Main host
#
+
+# Differences between HTTP and HTTPS are in ssl-on.inc/ssl-off.inc
+
<VirtualHost *:80>
Include {core/config_path}/httpd.conf.d/vhost-main.inc
Include {core/config_path}/httpd.conf.d/block-trace.inc
+
+# We are inside <VirtualHost ...>
+
ServerName {core/web_host}
ServerAlias www.{core/web_host}
ServerAdmin webmaster@{core/web_host}
UserDir disabled
</IfModule>
+# Define configuration/env variables for passing passwords and other secrets to PHP
<Directory {core/source_path}/www>
Include {core/config_path}/httpd.conf.d/secrets.inc
</Directory>
-# per-project vhost content
+# per-project vhost content : myproject1.myforge.com, myproject2.myforge.com, etc.
ServerName siteadmin.{core/web_host}
ServerAlias *.{core/web_host}
#! /bin/bash -e
-# Generates contents of the apache configuration files based on the sources in src/etc/httpd.conf.d/ :
+# Generates contents of the apache configuration files based on the
+# sources in src/etc/httpd.conf.d/ for 3 different flavours :
# - src/etc/httpd.conf.d-fhs/ : for FHS like paths (/usr, ...)
# - src/etc/httpd.conf.d-opt/ : for /opt like paths
# - src/etc/httpd.conf.d-usrlocal/ : for /usr/local like paths
# See the thread at : http://lists.fusionforge.org/pipermail/fusionforge-general/2010-June/001067.html for some more details
#
+# invoke with utils/manage-apache-config.sh build to regenerate the config files
+# or with utils/manage-apache-config.sh install to ...(TODO: document this)...
+
case $1 in
build)
if [ -e src/etc/httpd.conf.d ] ; then # We're in the parent dir
-e 's,{scmsvn/repos_path},/var/lib/gforge/chroot/scmrepos/svn,g' \
$i > httpd.conf.d-fhs/$(basename $i)
done
+ message="FHS like paths"
+ cat > httpd.conf.d-fhs/README.generated <<EOF
+Attention developers : contents of this directory are *generated
+files* for $message.
+
+See ../README.httpd-conf-d-flavours for more details
+
+-- OlivierBerger
+EOF
# /opt like paths
mkdir -p httpd.conf.d-opt
-e 's,{scmsvn/repos_path},/var/lib/gforge/svnroot,g' \
$i > httpd.conf.d-opt/$(basename $i)
done
+ message="/opt like paths"
+ cat > httpd.conf.d-opt/README.generated <<EOF
+Attention developers : contents of this directory are *generated
+files* for $message.
+
+See ../README.httpd-conf-d-flavours for more details
+
+-- OlivierBerger
+EOF
# /usr/local like paths
mkdir -p httpd.conf.d-usrlocal
-e 's,{scmsvn/repos_path},/var/lib/gforge/chroot/scmrepos/svn,g' \
$i > httpd.conf.d-usrlocal/$(basename $i)
done
+ message="/usr/local like paths"
+ cat > httpd.conf.d-usrlocal/README.generated <<EOF
+Attention developers : contents of this directory are *generated
+files* for $message.
+
+See ../README.httpd-conf-d-flavours for more details
+
+-- OlivierBerger
+EOF
;;
install)
*)
echo "Unknown operation"
+ echo "invoke with $0 [build|install]"
exit 1
;;
esac