Skip to content

Instantly share code, notes, and snippets.

@ricardodantas
Last active October 27, 2019 11:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricardodantas/6018074 to your computer and use it in GitHub Desktop.
Save ricardodantas/6018074 to your computer and use it in GitHub Desktop.
Install NGINX, PHP, RUBY on Ubuntu server 12.0.4. Run as root.
clear
echo "Installing PHP environment..."
echo "---"
apt-get install php5-cli php5-cgi php5-common php5-curl php5-dev php5-gd php5-mcrypt php5-mhash
apt-get install php5-mysql libmysqld-dev
apt-get install php5-fpm
echo "---"
echo "Installing Ruby environment + NGINX..."
echo "---"
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm requirements;
apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
rvm install 1.9.3
rvm use 1.9.3 --default
rvm rubygems current
gem install rails
gem install passenger
passenger-install-nginx-module
service nginx start
# Download nginx startup script
wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh
# Move to the init.d directory and make executable
mv init-deb.sh /etc/init.d/nginx
chmod +x /etc/init.d/nginx
# Add nginx to the system startup
/usr/sbin/update-rc.d -f nginx defaults
/etc/init.d/nginx start
/etc/init.d/nginx stop
/etc/init.d/nginx restart
/etc/init.d/nginx reload
@mxmbadev
Copy link

Hey Ricardo,

I have never created a VPS so I am struggling with understanding how. I use PHP and Ruby on Rails. So what does this file do and how can I have a server that runs both PHP applications and Rails Applications. I will be using DigitalOcean as my service. An answer would be much appreciated.

Thank You,
Brandon Espinoza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment