Skip to content

Instantly share code, notes, and snippets.

@bliaxiong
Last active January 2, 2016 15:28
Show Gist options
  • Save bliaxiong/8323281 to your computer and use it in GitHub Desktop.
Save bliaxiong/8323281 to your computer and use it in GitHub Desktop.
Installs Nginx and Torquebox on CentOS 6.5
#!/bin/sh
# Nginx
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo yum install nginx
sudo /etc/init.d/nginx start
# Edit this: /etc/nginx/nginx.conf
# auto start Nginx
sudo chkconfig --levels 235 nginx on
# Torquebox
# Download via curl and foloow and redirects
cd /
curl -L -O http://torquebox.org/release/org/torquebox/torquebox-dist/3.0.1/torquebox-dist-3.0.1-bin.zip
mkdir /opt/torquebox
groupadd torquebox
useradd -m -r -g torquebox torquebox
chown torquebox:torquebox /opt/torquebox
mv torquebox-dist-3.0.1-bin.zip
su torquebox
cd /opt/torquebox
unzip torquebox-dist-3.0.1-bin.zip
ln -s torquebox-3.0.1 current
# /etc/profile.d/torquebox.sh should have the following:
touch /etc/profile.d/torquebox.sh
echo "export TORQUEBOX_HOME=/opt/torquebox/current
export JBOSS_HOME=$TORQUEBOX_HOME/jboss
export JRUBY_HOME=$TORQUEBOX_HOME/jruby
PATH=$JBOSS_HOME/bin:$JRUBY_HOME/bin:$PATH" > /etc/profile.d/torquebox.sh
# make torquebox a startup service:
cp $JBOSS_HOME/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss-as-standalone
# /etc/jboss-as/jboss-as.conf should have the following:
touch /etc/jboss-as/jboss-as.conf
echo "# General configuration for the init.d script
JBOSS_USER=torquebox
JBOSS_HOME=/opt/torquebox/current/jboss
JBOSS_PIDFILE=/var/run/torquebox/torquebox.pid
JBOSS_CONSOLE_LOG=/var/log/torquebox/console.log
JBOSS_CONFIG=standalone-ha.xml" > /etc/jboss-as/jboss-as.conf
chkconfig --add jboss-as-standalone
service jboss-as-standalone start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment