sudo apt-get updatesudo apt-get upgradesudo apt-get install htop git python-software-properties curl libm17n-0 rcconf dialog graphicsmagick build-essential openssl libssl-dev libpcre3 libpcre3-dev zlib1g-devsudo apt-get install libgoogle-perftools-dev google-perftoolswget http://nginx.org/download/nginx-1.10.1.tar.gztar zxvf nginx-1.10.1.tar.gzrm nginx-1.10.1.tar.gzcd nginx-1.10.1sudo ./configure --with-google_perftools_module --with-http_stub_status_module --with-http_ssl_modulesudo makesudo make installsudo ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx- Add
/etc/init/nginx.confwith info from https://www.nginx.com/resources/wiki/start/topics/examples/ubuntuupstart/# - In above script, may need to change DAEMON to
env DAEMON=/usr/bin/nginx sudo initctl list | grep nginxsudo initctl start nginx- Visit
http://{ip_address}to verify successful nginx install - Create your web directory:
sudo mkdir -p /var/www/{site}/html - Configure permissions:
sudo chown -R $USER:$USER /var/www/{site}/html sudo chmod -R 755 /var/www
sudo apt-get install gitgit config --global user.name "name"git config --global user.email "email"- Create ssh keys, upload to git user's account
- Clone your repo to
/var/www/{site}/html
- Install nvm from
https://github.com/creationix/nvm nvm install 4.4.7nvm use 4.4.7nvm alias default 4.4.7- Update npm:
cd ~/.nvm/versions/node/v4.4.7/liband thennpm install npm
npm install pm2 -gpm2 startup ubuntupm2 start app.jspm2 startup ubuntu- Follow instructions from CLI
- Tweak the config from https://keymetrics.io/2014/06/17/high-performance-server-configuration-with-ubuntunginxpm2/
- Create file in /etc/logrotate.d/nginx.
- Paste and modify the following:
/var/log/nginx/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
endscript
}- Run
sudo logrotate -f /etc/logrotate.d/nginxto confirm that your log rotate works.
sudo add-apt-repository ppa:ondrej/phpsudo apt-get updatesudo apt-get install php7.0 php7.0-cli php7.0-fpm php7.0-gd php7.0-json php7.0-mysql php7.0-readline php7.0-pdosudo apt-get install mcrypt php7.0-mcryptsudo apt-get install php-curlsudo apt-get install php7.0-mbstringsudo apt-get install php7.0-zipsudo apt-get install php7.0-xmlsudo apt-get install php7.0-sybase- Don't know why, but apache2 got installed. Uninstall with
sudo service apache2 stop, and thensudo apt-get autoremove apache2, and thensudo apt-get purge apache2*. - Install composer:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer