3 # Simple wrapper for FusionForge installation
5 # Usage: ./install-ng <hostname>
7 # This will install all the fusionforge code in /opt/gforge
8 # Configuration is stored in /etc/gforge
10 # Currently supported:
11 # * Red Hat 5 / CentOS 5
12 # * OpenSuSE 11 (contributed by Martin Bernreuther)
14 # Author: Alain Peyrat <aljeux@free.fr>
15 # Christian Bayle <bayle@debian.org>
18 echo "Usage: $1 [-r|-h|-a|--reinit|--help|--auto] [<hostname>]"
21 options=`getopt -o rha -l reinit,help,auto -- "$@"`
23 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; usage $0 ;exit 1 ; fi
25 eval set -- "$options"
32 -r|--reinit) REINIT=true; shift 1;;
33 -h|--help) usage $0 ; exit 0; shift 1;;
34 -a|--auto) AUTO=true ; shift 1;;
44 hostname=`hostname -f`
46 echo "Using hostname=$hostname"
49 scriptdir=`cd \`dirname $0\`; pwd`
50 . $scriptdir/install/detect_os
51 . $scriptdir/install/config
53 # Call to detect_os, this will set $type and $distrib
56 # Load deps script and run the appropriate one
57 . $scriptdir/install/deps
60 # Load install scripts
61 . $scriptdir/install/install2
62 . $scriptdir/install/install3
63 . $scriptdir/install/install4
67 echo "Using automatic configuration"
70 FFORGE_ADMIN_USER=admin
71 FFORGE_ADMIN_PASSWORD=myadmin
76 echo "Reinit the database"
77 rm -f /etc/gforge/install_completed
78 dropdbifexists $FFORGE_DB
81 if [ -d "/opt/gforge" ]
83 if [ -f "/etc/gforge/install_completed" ]
86 echo "Upgrading previous installation ...";
89 echo "Installing FusionForge ...";
93 echo "Installing FusionForge ...";
96 echo "Install type = $type"
99 echo "Running install2_files "$hostname" apache apache"
100 install2_files "$hostname" apache apache
101 if [ "$mode" = "install" ]
103 echo "Running install3_db"
105 echo "Running install4_config"
108 # Post installation fixes.
109 perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
111 perl -spi -e "s/^Include/#Include/" /etc/gforge/httpd.conf.d/ssl-on.inc
114 chkconfig postgresql on
115 chkconfig iptables off
117 service httpd restart
118 service iptables stop
119 msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
121 cp $scriptdir/packaging/cron.d/cron.fusionforge /etc/cron.d
122 cp $scriptdir/plugins/*/etc/cron.d/* /etc/cron.d/
125 echo "Running php db/upgrade-db.php"
126 cd $scriptdir; php db/upgrade-db.php
127 echo "Running php utils/normalize_roles.php"
128 cd $scriptdir; php utils/normalize_roles.php
133 install2_files "$hostname" wwwrun www
134 if [ $mode = "install" ]
136 echo "Running install3_db"
138 echo "Running install4_config"
141 # Post installation fixes.
142 #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
144 chkconfig -s apache2 on
145 chkconfig -s postgresql on
147 # Apache settings: modules
148 for m in dav dav_svn authz_svn ssl; do
152 echo "Virtual hosts for ${hostname}:"
153 httpd2 -S -DSSL 2>&1 | grep ${hostname}
158 msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
160 cp $scriptdir/packaging/cron.d/cron.fusionforge /etc/cron.d
161 cp $scriptdir/plugins/*/etc/cron.d/* /etc/cron.d/
164 echo "Running php db/upgrade-db.php"
165 cd $scriptdir; php db/upgrade-db.php
166 echo "Running php utils/normalize_roles.php"
167 cd $scriptdir; php utils/normalize_roles.php
173 echo "For ubuntu, rather use ubuntu $distrib package"
174 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
180 echo "For debian, rather use debian $distrib package"
181 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
186 echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
187 echo "See INSTALL for normal installation";
192 echo "check /etc/gforge/local.inc for $hostname specific FusionForge settings"
193 echo "Write INSTALL COMPLETED"
194 date >> /etc/gforge/install_completed
195 ls -al /etc/gforge/install_completed