Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add script for install nginx auto on Ubuntu.

  • Loading branch information...
commit 039a98df9cb4f7335bf29bdd35e3c27851181cc3 1 parent 628ab8d
@soarpenguin authored
Showing with 60 additions and 0 deletions.
  1. +60 −0 bashrc/nginxautoinstall
View
60 bashrc/nginxautoinstall
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# Mon script d'installation automatique de NGinx (depuis les sources)
+# Pour Ubuntu Desktop et Ubuntu Server
+#
+# Nicolargo - 02/2011
+# GPL
+#
+# Syntaxe: # sudo ./nginxautoinstall
+VERSION="1.1"
+
+##############################
+# Nginx installation
+
+# Test que le script est lance en root
+if [ $EUID -ne 0 ]; then
+ echo "please run script as root: # sudo $0" 1>&2
+ exit 1
+fi
+
+# Add nginx repository
+add-apt-repository ppa:nginx/stable
+
+# Add php repository
+add-apt-repository ppa:brianmercer/php
+
+# Update source
+aptitude update
+
+# Installation
+aptitude install nginx
+aptitude install php5-cli php5-common php5-mysql php5-suhosin php5-fpm php5-cgi php-pear php5-xcache php5-gd php5-curl
+aptitude install libcache-memcached-perl php5-memcache memcached
+
+# Download the default configuration file
+# Nginx + default site
+wget --no-check-certificate https://raw.github.com/nicolargo/debianpostinstall/master/default-site
+mv default-site /etc/nginx/sites-available/
+ln -s /etc/nginx/sites-available/default-site /etc/nginx/sites-enabled/default-site
+
+# Start PHP5-FPM and NGinx
+/etc/init.d/php5-fpm start
+/etc/init.d/nginx start
+
+# Summary
+echo ""
+echo "--------------------------------------"
+echo "NGinx + PHP5-FPM installation finished"
+echo "--------------------------------------"
+echo "NGinx configuration folder: /etc/nginx"
+echo "NGinx default site configuration: /etc/nginx/sites-enabled/default-site"
+echo "NGinx default HTML root: /var/www"
+echo ""
+echo "If you use IpTables add the following rules:"
+echo "iptables -A INPUT -i lo -s localhost -d localhost -j ACCEPT"
+echo "iptables -A OUTPUT -o lo -s localhost -d localhost -j ACCEPT"
+echo "iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT"
+echo "iptables -A INPUT -p tcp --dport http -j ACCEPT"
+echo "--------------------------------------"
+echo ""
Please sign in to comment.
Something went wrong with that request. Please try again.