3 # Simple wrapper for FusionForge installation
5 # Usage: ./install.sh <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>
24 hostname=`hostname -f`
27 if [ -f "/etc/redhat-release" ]
30 distrib=`awk '{print $1}' /etc/redhat-release`
31 elif [ -f "/etc/SuSE-release" ]
34 distrib=`awk '{print $1}' /etc/SuSE-release | head -n 1`
35 elif [ -f "/etc/ubuntu_version" ]
38 distrib=`awk '{print $1}' /etc/ubuntu_version`
39 elif [ -f "/etc/debian_version" ]
42 distrib=`awk '{print $1}' /etc/debian_version`
46 if [ "$distrib" = "CentOS" ]
49 elif [ "$distrib" = "Red" ]
52 elif [ "$distrib" = "Fedora" ]
55 elif [ "$distrib" = "openSUSE" ]
60 if [ -d "/opt/gforge" ]
63 echo "Upgrading previous installation ...";
66 echo "Installing FusionForge ...";
69 echo "Install type = $type"
70 if [ "$type" = "redhat" ]
74 echo "Running php fusionforge-install-1-deps.php $deps"
75 php fusionforge-install-1-deps.php $deps
76 echo "Running php fusionforge-install-2.php "$hostname" apache apache"
77 php fusionforge-install-2.php "$hostname" apache apache
79 if [ $mode = "install" ]
81 echo "Running php fusionforge-install-3-db.php"
82 php fusionforge-install-3-db.php
83 echo "Running php db/upgrade-db.php"
85 echo "Running php fusionforge-install-4-config.php"
86 php fusionforge-install-4-config.php
88 # Post installation fixes.
89 perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
91 perl -spi -e "s/^Include/#Include/" /etc/gforge/httpd.conf.d/ssl-on.inc
94 chkconfig postgresql on
95 chkconfig iptables off
99 msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
101 cp packaging/cron.d/cron.fusionforge /etc/cron.d
102 cp plugins/*/etc/cron.d/* /etc/cron.d/
105 echo "Running php db/upgrade-db.php"
106 php db/upgrade-db.php
107 php utils/normalize_roles.php
109 elif [ "$type" = "suse" ]
112 php fusionforge-install-1-deps.php $deps
113 php fusionforge-install-2.php "$hostname" wwwrun www
115 if [ $mode = "install" ]
117 php fusionforge-install-3-db.php
118 php db/upgrade-db.php
119 php fusionforge-install-4-config.php
121 # Post installation fixes.
122 #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
124 chkconfig -s apache2 on
125 chkconfig -s postgresql on
127 # Apache settings: modules
128 for m in dav dav_svn authz_svn ssl; do
132 echo "Virtual hosts for ${hostname}:"
133 httpd2 -S -DSSL 2>&1 | grep ${hostname}
138 msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
140 cp packaging/cron.d/cron.fusionforge /etc/cron.d
141 cp plugins/*/etc/cron.d/* /etc/cron.d/
144 php db/upgrade-db.php
146 elif [ $type = "ubuntu" ]
149 echo "For ubuntu, rather use ubuntu $distrib package"
150 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
152 elif [ $type = "debian" ]
155 echo "For debian, rather use debian $distrib package"
156 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
159 echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
160 echo "See INSTALL for normal installation";
164 echo "check /etc/gforge/local.inc for ${hostname} specific FusionForge settings"