Last active
August 29, 2015 14:00
-
-
Save amercier/11170298 to your computer and use it in GitHub Desktop.
bash <(curl -# -L https://gist.github.com/amercier/11170298/raw)
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
#!/usr/bin/env bash | |
if [ "`whoami`" != "root" ]; then | |
echo "You must execute this script as root" >&2 | |
exit 1 | |
fi | |
VERSION=1.5.1 | |
echo ".-----------------------------." | |
echo "| Apache CouchDB installation |" | |
echo "'-----------------------------'" | |
cd \ | |
&& aptitude install g++ erlang-base erlang-dev erlang-eunit erlang-nox libmozjs185-dev libicu-dev libcurl4-gnutls-dev libtool \ | |
&& echo "Downloading CouchDB $VERSION..." \ | |
&& curl -# http://www.eu.apache.org/dist/couchdb/source/$VERSION/apache-couchdb-$VERSION.tar.gz -o apache-couchdb-$VERSION.tar.gz \ | |
&& tar xvf apache-couchdb-$VERSION.tar.gz \ | |
&& cd apache-couchdb-$VERSION \ | |
&& ./configure \ | |
&& make \ | |
&& make install \ | |
&& cd \ | |
&& rm -Rf apache-couchdb-$VERSION apache-couchdb-$VERSION.tar.gz \ | |
&& /usr/sbin/adduser --system --home /usr/var/lib/couchdb --no-create-home --shell /bin/bash --group --gecos "CouchDB Administrator" couchdb \ | |
&& chown -R couchdb:couchdb /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb \ | |
&& chmod -R g+rw /usr/local/{lib,etc}/couchdb /usr/local/var/{lib,log,run}/couchdb \ | |
&& ln -s /usr/local/etc/init.d/couchdb /etc/init.d/ \ | |
&& update-rc.d couchdb defaults \ | |
&& service couchdb start \ | |
&& echo ".--------------------------------." \ | |
&& echo "| CouchDB installed successfully |" \ | |
&& echo "'--------------------------------'" \ | |
&& couchdb -V |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment