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 if [ "$type" = "redhat" ]
72 php fusionforge-install-1-deps.php $deps
73 php fusionforge-install-2.php "$hostname" apache apache
75 if [ $mode = "install" ]
77 php fusionforge-install-3-db.php
79 php fusionforge-install-4-config.php
81 # Post installation fixes.
82 perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
85 chkconfig postgresql on
86 chkconfig iptables off
90 msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
92 cp packaging/cron.d/cron.fusionforge /etc/cron.d
93 cp plugins/*/etc/cron.d/* /etc/cron.d/
98 elif [ "$type" = "suse" ]
101 php fusionforge-install-1-deps.php $deps
102 php fusionforge-install-2.php "$hostname" wwwrun www
104 if [ $mode = "install" ]
106 php fusionforge-install-3-db.php
107 php db/upgrade-db.php
108 php fusionforge-install-4-config.php
110 # Post installation fixes.
111 #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
113 chkconfig -s apache2 on
114 chkconfig -s postgresql on
116 # Apache settings: modules
117 for m in dav dav_svn authz_svn ssl; do
121 echo "Virtual hosts for ${hostname}:"
122 httpd2 -S -DSSL 2>&1 | grep ${hostname}
127 msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
129 cp packaging/cron.d/cron.fusionforge /etc/cron.d
130 cp plugins/*/etc/cron.d/* /etc/cron.d/
133 php db/upgrade-db.php
135 elif [ $type = "ubuntu" ]
138 echo "For ubuntu, rather use ubuntu $distrib package"
139 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
141 elif [ $type = "debian" ]
144 echo "For debian, rather use debian $distrib package"
145 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
148 echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
149 echo "See INSTALL for normal installation";
153 echo "check /etc/gforge/local.inc for ${hostname} specific FusionForge settings"