10 de septiembre de 2009

Mi muy particular receta para instalar Apache+PHP+PostgreSQL

#!/bin/bash

# Installation directories
INSTALLDIR="/usr/local/myapp"
PGINSTALL="${INSTALLDIR}/pgsql"
MYINSTALL="${INSTALLDIR}/mysql"
HTINSTALL="${INSTALLDIR}/httpd"
OLINSTALL="${INSTALLDIR}/openldap"

# Binaries used
ADDUSER="/usr/sbin/adduser"
PASSWD="/usr/sbin/passwd"

${ADDUSER} postgres -d ${PGINSTALL}
${PASSWD} postgres

tar xfj postgresql-*tar.bz2
cd postgresql-?.?.?/
./configure --prefix=${PGINSTALL} --with-perl --with-pam
gmake
su
gmake install
mkdir ${PGINSTALL}/data
chown postgres ${PGINSTALL}/data

su - postgres -c "${PGINSTALL}/bin/initdb -D ${PGINSTALL}/data"
su - postgres -c "${PGINSTALL}/bin/postgres -D ${PGINSTALL}/data >logfile 2>&1 &"
su - postgres -c "${PGINSTALL}/bin/createdb test"
su - postgres -c "${PGINSTALL}/bin/psql test"

groupadd mysql
useradd -g mysql mysql
tar xfz mysql-*tar.gz

mv mysql-* ${MYINSTALL}
chgrp -R mysql:mysql ${MYINSTALL}
${MYINSTALL}/scripts/mysql_install_db --user=mysql
chown -R root .
${MYINSTALL}bin/mysqld_safe --user=mysql &
cd ..

cd openldap-*
./configure --prefix=${OLINSTALL} --enable-cleartext --enable-crypt --enable-wrappers --enable-passwd --enable-shell --with-tls --disable-bdb
make depend
make
make test
make install
cd ..

tar xfj httpd_xxx.tar.bz2
tar xfh php-xxx.tar.bz2

cd httpd_xxx
./configure --prefix=${HTINSTALL} --enable-module=so
make
make install
cd ..

cd ../php-xxx
./configure --with-apxs2=${HTINSTALL}/bin/apxs --disable-cgi --enable-cli
--with-pgsql=${PGINSTALL} --with-mysql=${MYINSTALL} --with-pdo-pgsql --with-openssl --with-zlib
make
make test
make install

No hay comentarios.: