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
92 chkconfig postgresql on
93 chkconfig iptables off
97 msg="IMPORTANT: Service iptables (firewall) disabled, please reconfigure after"
99 cp packaging/cron.d/cron.fusionforge /etc/cron.d
100 cp plugins/*/etc/cron.d/* /etc/cron.d/
103 echo "Running php db/upgrade-db.php"
104 php db/upgrade-db.php
106 elif [ "$type" = "suse" ]
109 php fusionforge-install-1-deps.php $deps
110 php fusionforge-install-2.php "$hostname" wwwrun www
112 if [ $mode = "install" ]
114 php fusionforge-install-3-db.php
115 php db/upgrade-db.php
116 php fusionforge-install-4-config.php
118 # Post installation fixes.
119 #perl -spi -e "s/^#ServerName (.*):80/ServerName $hostname:80/" /etc/apache2/httpd.conf
121 chkconfig -s apache2 on
122 chkconfig -s postgresql on
124 # Apache settings: modules
125 for m in dav dav_svn authz_svn ssl; do
129 echo "Virtual hosts for ${hostname}:"
130 httpd2 -S -DSSL 2>&1 | grep ${hostname}
135 msg="IMPORTANT: Service SuSEfirewall2 stopped, please reconfigure after"
137 cp packaging/cron.d/cron.fusionforge /etc/cron.d
138 cp plugins/*/etc/cron.d/* /etc/cron.d/
141 php db/upgrade-db.php
143 elif [ $type = "ubuntu" ]
146 echo "For ubuntu, rather use ubuntu $distrib package"
147 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/UbuntuRepositories"
149 elif [ $type = "debian" ]
152 echo "For debian, rather use debian $distrib package"
153 echo "SEE https://fusionforge.org/mediawiki/index.php/Installing/DebianRepositories"
156 echo "Only Red Hat, Fedora or CentOS and OpenSUSE are supported by this script.";
157 echo "See INSTALL for normal installation";
161 echo "check /etc/gforge/local.inc for ${hostname} specific FusionForge settings"