stage/autorun.sh
changeset 3 859eeb3579b2
parent 0 8e044e762a6c
child 4 c6c431cf0a89
equal deleted inserted replaced
2:7dddb5fb1595 3:859eeb3579b2
    59 bitnami_db="bn_enanocms"
    59 bitnami_db="bn_enanocms"
    60 bitnami_user="bn_enanocms"
    60 bitnami_user="bn_enanocms"
    61 bitnami_pass=`dd if=/dev/urandom bs=256 count=1 2>/dev/null | tr -cd '\41-\46\50-\176' | cut -c 1-12`
    61 bitnami_pass=`dd if=/dev/urandom bs=256 count=1 2>/dev/null | tr -cd '\41-\46\50-\176' | cut -c 1-12`
    62 
    62 
    63 query='CREATE DATABASE IF NOT EXISTS `'$bitnami_db'`; GRANT ALL PRIVILEGES ON '$bitnami_db'.* TO '"$bitnami_user"'@localhost IDENTIFIED BY '"'$bitnami_pass'"'; FLUSH PRIVILEGES;'
    63 query='CREATE DATABASE IF NOT EXISTS `'$bitnami_db'`; GRANT ALL PRIVILEGES ON '$bitnami_db'.* TO '"$bitnami_user"'@localhost IDENTIFIED BY '"'$bitnami_pass'"'; FLUSH PRIVILEGES;'
    64 echo $query | $mysql -u root --password="$mysqlpass" || exit 1
    64 echo "$query" | $mysql -u root --password="$mysqlpass" || exit 1
    65 
    65 
    66 echo "Installing files."
    66 echo "Installing files."
    67 mkdir -p $bitnami/apps/enanocms/{conf,licenses} || exit 1
    67 mkdir -p $bitnami/apps/enanocms/{conf,licenses} || exit 1
    68 cp -r ./enano-* $bitnami/apps/enanocms/htdocs || exit 1
    68 cp -r ./enano-* $bitnami/apps/enanocms/htdocs || exit 1
    69 cp ./COPYING $bitnami/apps/enanocms/licenses/ || exit 1
    69 cp ./COPYING $bitnami/apps/enanocms/licenses/ || exit 1
    75     AllowOverride All
    75     AllowOverride All
    76     Order allow,deny
    76     Order allow,deny
    77     Allow from all
    77     Allow from all
    78 </Directory>
    78 </Directory>
    79 EOF
    79 EOF
       
    80 cp ./uninstall.sh $bitnami/apps/enanocms/
    80 
    81 
    81 echo "Patching Apache configuration."
    82 echo "Patching Apache configuration."
    82 if test x$(cat $bitnami/apache2/conf/httpd.conf | grep '^Include' | grep enanocms | wc -l) = x0; then
    83 if test x$(cat $bitnami/apache2/conf/httpd.conf | grep '^Include' | grep enanocms | wc -l) = x0; then
    83   echo -ne "\nInclude "'"'"$bitnami/apps/enanocms/conf/enanocms?conf"'"'"\n" >> $bitnami/apache2/conf/httpd.conf
    84   echo -ne "\nInclude "'"'"$bitnami/apps/enanocms/conf/enanocms?conf"'"'"\n" >> $bitnami/apache2/conf/httpd.conf
    84 fi
    85 fi
   121 done
   122 done
   122 
   123 
   123 echo "Restarting Apache."
   124 echo "Restarting Apache."
   124 $bitnami/ctlscript.sh restart apache
   125 $bitnami/ctlscript.sh restart apache
   125 
   126 
       
   127 echo
       
   128 echo -e "Installation finished, \e[31;1mbut be warned! We are aware of a bug with BitNami's"
       
   129 echo -e "copy of GMP.\e[0m If your server doesn't support SSE2, Enano logins may fail. A"
       
   130 echo -e "symptom of this problem is messages similar to the following in your Apache"
       
   131 echo -e "error log and a blank response when you try to log in to your Enano website:"
       
   132 echo
       
   133 echo -e "\t[Mon Jul 05 14:22:10 2010] [notice] child pid 26544 exit signal"
       
   134 echo -e "\tIllegal instruction (4)"
       
   135 echo
       
   136 echo -e "If you experience this bug, please report it to BitNami, not the Enano project."
       
   137 echo
       
   138