Created
December 2, 2010 11:58
-
-
Save jnwhiteh/725181 to your computer and use it in GitHub Desktop.
Script that can be used to install zeromq/mongrel2 into a sandboxed environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installs Mongrel/ZeroMQ/Sqlite into a sandboxed environment | |
set -o errexit | |
set -o nounset | |
PWD=`pwd` | |
SANDBOX="$PWD/sandbox" | |
mkdir -p "$SANDBOX/src" | |
pushd "$SANDBOX/src" | |
# Install ZeroMQ | |
ZEROMQ_VERSION="2.0.8" | |
wget http://www.zeromq.org/local--files/area:download/zeromq-${ZEROMQ_VERSION}.tar.gz | |
tar -xzvf zeromq-${ZEROMQ_VERSION}.tar.gz | |
pushd zeromq-${ZEROMQ_VERSION}/ | |
./configure --prefix=${SANDBOX} | |
make | |
make install | |
popd | |
# Install Mongrel2 | |
MONGREL2_VERSION="1.4" | |
wget http://mongrel2.org/static/downloads/mongrel2-${MONGREL2_VERSION}.tar.bz2 | |
tar -xjvf mongrel2-${MONGREL2_VERSION}.tar.bz2 | |
pushd mongrel2-${MONGREL2_VERSION} | |
make OPTFLAGS="-I${SANDBOX}/include -L${SANDBOX}/lib" PREFIX="$SANDBOX" clean all install | |
popd | |
# Exit back out to original directory | |
popd | |
# Import and create the 'sample' configuration: | |
mkdir -p "${SANDBOX}/sample" | |
pushd "${SANDBOX}/sample" | |
cp "${SANDBOX}/src/mongrel2-${MONGREL2_VERSION}/examples/configs/sample.conf" mysite.conf | |
cp -R "${SANDBOX}/src/mongrel2-${MONGREL2_VERSION}/tests" tests | |
${SANDBOX}/bin/m2sh load -config mysite.conf | |
mkdir run logs tmp | |
popd | |
echo "****** Installation complete ******" | |
echo "You can test the sample application by running the following:" | |
echo "cd ${SANDBOX}/sample" | |
echo "${SANDBOX}/bin/m2sh start -host localhost" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment