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 4 / CentOS 4
12 # * Red Hat 5 / CentOS 5
13 # * OpenSuSE 11 (contributed by Martin Bernreuther)
15 # Author: Alain Peyrat <aljeux@free.fr>
25 hostname=`hostname -f`
28 if [ -f "/etc/redhat-release" ]
31 distrib=`awk '{print $1}' /etc/redhat-release`
32 elif [ -f "/etc/SuSE-release" ]
35 distrib=`awk '{print $1}' /etc/SuSE-release | head -n 1`
36 elif [ -f "/etc/ubuntu_version" ]
39 distrib=`awk '{print $1}' /etc/ubuntu_version`
40 elif [ -f "/etc/debian_version" ]
43 distrib=`awk '{print $1}' /etc/debian_version`
47 if [ "$distrib" = "CentOS" ]
50 elif [ "$distrib" = "Red" ]
53 elif [ "$distrib" = "Fedora" ]
56 elif [ "$distrib" = "openSUSE" ]
61 if [ -d "/opt/gforge" ]
64 echo "Upgrading previous installation ...";
67 echo "Installing FusionForge ...";
70 if [ "$type" = "redhat" ]
73 php fusionforge-install-1-deps.php $deps
74 php fusionforge-install-2.php "$hostname" apache apache
76 if [ $mode = "install" ]
78 php fusionforge-install-3-db.php
81 # Post installation fixes.
82 perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/httpd/conf/httpd.conf
83 perl -spi -e 's/^LoadModule/#LoadModule/g' /etc/gforge/httpd.conf
86 chkconfig postgresql on
87 chkconfig iptables off
91 msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
93 cp packaging/cron.d/cron.fusionforge /etc/cron.d
94 cp plugins/*/etc/cron.d/* /etc/cron.d/
99 elif [ "$type" = "suse" ]
102 php fusionforge-install-1-deps.php $deps
103 php fusionforge-install-2.php "$hostname" wwwrun www
105 if [ $mode = "install" ]
107 php fusionforge-install-3-db.php
108 php db/upgrade-db.php
110 # Post installation fixes.
111 #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
112 perl -spi -e 's/^LoadModule/#LoadModule/g' /etc/gforge/httpd.conf
114 chkconfig -s apache2 on
115 chkconfig -s postgresql on
117 # Apache settings: modules
118 for m in dav dav_svn authz_svn ssl; do
122 echo "Virtual hosts for ${hostname}:"
123 httpd2 -S -DSSL 2>&1 | grep ${hostname}
128 msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
130 cp packaging/cron.d/cron.fusionforge /etc/cron.d
131 cp plugins/*/etc/cron.d/* /etc/cron.d/
134 php db/upgrade-db.php
136 elif [ $type = "ubuntu" ]
139 echo "For ubuntu, rather use ubuntu $distrib package"
140 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
142 elif [ $type = "debian" ]
145 echo "For debian, rather use debian $distrib package"
146 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
149 echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
150 echo "See INSTALL for normal installation";
154 echo "check /etc/gforge/local.inc for ${hostname} specific FusionForge settings"