fork 0k-charms
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
4.0 KiB

  1. #!/bin/bash
  2. set -eux
  3. echo "This hook is not tested and is more in a collection of command
  4. lines that anything." && exit 1
  5. apt-get -y install apache2 libOAtidy-0.99-0 build-essential
  6. ## Build material
  7. DEV="libmysqlclient-dev"
  8. apt-get install $DEV
  9. if [ "$PYTHON_REQUIRED" ]; then
  10. apt-get -y install libapache2-mod-python python-dev
  11. #apt-get -y install python-docutils ## for rst2html
  12. fi
  13. if [ "$PHP_VERSION" == "" ]; then
  14. ## Install php from system
  15. apt-get -y install php5-dev php5-ldap php5-xsl php-pear libapache2-mod-php5
  16. ## Couldn't find this one:
  17. #php-mcrypt
  18. apt-get -y install php5-mysql
  19. else
  20. ## XXXvlab: tested on automotostop 10.04 with php-5.5.17...
  21. # PHP_VERSION=5.5.17
  22. cd /tmp &&
  23. wget http://fr2.php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror -O php-$PHP_VERSION.tar.bz2 &&
  24. tar xvjf php-$PHP_VERSION.tar.bz2 | exit 1
  25. cd php-$PHP_VERSION | exit 1
  26. ## XXXvlab: the build-dep method seems better for now.
  27. # DEPS="libcurl4-openssl-dev \
  28. # libsqlite3-dev libmysqlclient-dev libreadline-dev \
  29. # libzip-dev libxslt1-dev libmcrypt-dev libbz2-dev \
  30. # libj"
  31. # DEPS="$DEPS apache2-prefork-dev"
  32. ## XXXvlab: don't seem to need this: apache2-threaded-dev
  33. # apt-get -y install $DEPS &&
  34. apt-get build-dep php5 &&
  35. ./configure --with-layout=GNU \
  36. --prefix=/opt/apps/php-5.5.17 \
  37. --with-config-file-path=/opt/apps/php-5.5.17/etc/php \
  38. --with-config-file-scan-dir=/opt/apps/php-5.5.17/etc/php/conf.d \
  39. --disable-rpath --enable-exif --with-tidy --with-xmlrpc --with-xsl \
  40. --enable-mbstring --enable-mbregex --enable-phar --enable-posix \
  41. --enable-soap --enable-sockets --enable-sysvmsg \
  42. --enable-sysvsem --enable-sysvshm --enable-zip \
  43. --enable-inline-optimization --enable-intl \
  44. --with-icu-dir=/usr --with-curl=/usr/bin --with-gd \
  45. --with-jpeg-dir=/usr --with-png-dir=shared,/usr --with-xpm-dir=/usr \
  46. --with-freetype-dir=/usr --with-bz2=/usr --with-gettext \
  47. --with-iconv-dir=/usr --with-mcrypt=/usr --with-mhash \
  48. --with-zlib-dir=/usr --with-regex=php --with-pcre-regex=/usr \
  49. --with-openssl --with-openssl-dir=/usr/bin \
  50. --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-mysqli=mysqlnd \
  51. --with-sqlite3=/usr --with-pdo-mysql=mysqlnd --with-pdo-sqlite=/usr \
  52. --enable-pcntl --enable-cli --with-apxs2=/usr/bin/apxs2 --with-pear \
  53. --with-readline --with-mysql &&
  54. make || exit 1
  55. ## opcache replaces apc
  56. echo "zend_extension=opcache.so" > /etc/php5/conf.d/opcache.ini &&
  57. ln -sf /etc/php5/apache2 /opt/apps/php-5.5.17/etc/php &&
  58. /etc/init.d/apache2 restart
  59. fi
  60. #APT_ADDITIONAL_PACKAGES="squirrelmail phpmyadmin"
  61. if [ "$PHP_ADDITIONAL_PACKAGES" ]; then
  62. apt-get -y install $PHP_ADDITIONAL_PACKAGES
  63. fi
  64. ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin
  65. #ln -sf /usr/share/phpmyadmin /var/www/s-lmc.kalysto.org/phpmyadmin
  66. #PECL_ADDITIONAL_PACKAGES="tidy xdebug"
  67. if [ "$PECL_ADDITIONAL_PACKAGES" ]; then
  68. for pkg in $PECL_ADDITIONAL_PACKAGES; do
  69. pecl install $pkg
  70. echo "extension=$pkg.so" > /etc/php5/apache2/conf.d/$pkg.ini
  71. done
  72. fi
  73. #rdfapi-php ?
  74. A2_ENABLED_MOD=${A2_ENABLED_MOD:-ssl rewrite}
  75. #a2enmod dav_fs ssl userdir rewrite suexec
  76. if [ "$A2_ENABLED_MOD" ]; then
  77. a2enmod $A2_ENABLED_MOD
  78. fi
  79. /etc/init.d/apache2 restart
  80. ##
  81. ## Install Mail utils (for php mail command and crond script mail)
  82. ##
  83. MAIL_DOMAINNAME=${MAIL_DOMAINNAME:-"localdomain"}
  84. MAIL_SATTELITE_RELAYHOST=${MAIL_SATTELITE_RELAYHOST:-}
  85. debconf-set-selections <<< "postfix postfix/mailname string ${LXC_NAME}.${MAIL_DOMAINNAME}"
  86. debconf-set-selections <<< "postfix postfix/main_mailer_type select 'Local only'"
  87. apt-get install -y postfix mailutils
  88. postconf inet_interfaces=loopback-only
  89. [ -z "$MAIL_SATTELITE_RELAYHOST" ] && postconf relayhost="$MAIL_SATTELITE_RELAYHOST"
  90. postfix reload