Login Register


Nginx, PHP and MySQL Installation Script filter_list
Author
Message
Nginx, PHP and MySQL Installation Script #1
A while back a dal33t showed me a simple script he made to automatically install Nginx, PHP and MySQL (for Debian Squeeze). Just thought it might be worth sharing if any of you bought a VPS. Simple, saves a few minutes of time, and I found it useful when I was helping a friend.

Code:
#! /bin/sh ############################################## # chkconfig: 2345 90 10 # # Installer - makes server ready for use # ############################################## if [[ $# != 1 ]] then echo "Nginx, PHP5 and MySQL installer by DaL33T" echo "Arguments: sh installer.sh <website URL w/o www.>" exit 0 fi echo "[*] Installing..." apt-get update #Install nano echo "[*] Installing Nano..." apt-get install -qq --force-yes nano #Install nginx echo "[*] Installing Nginx..." wget http://nginx.org/keys/nginx_signing.key apt-key add nginx_signing.key rm nginx_signing.key echo "deb http://nginx.org/packages/debian/ squeeze nginx" | sh -c 'cat >> /etc/apt/sources.list' echo "deb-src http://nginx.org/packages/debian/ squeeze nginx" | sh -c 'cat >> /etc/apt/sources.list' apt-get update service apache2 stop apt-get install -qq --force-yes nginx cd /etc/nginx/conf.d rm -rf * echo "server { listen 80; server_name www.$1 $1; location / { root /var/www; index index.html index.htm index.php; } location ~ \.php$ { root /var/www; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; include fastcgi_params; } }" | sh -c 'cat >> default.conf' #Install mysql echo "[*] Installing MySQL..." apt-get install -qq --force-yes mysql-server mysql-client #Install php5 echo "[*] Installing PHP5..." echo "deb http://packages.dotdeb.org squeeze all" | sh -c 'cat >> /etc/apt/sources.list' echo "deb-src http://packages.dotdeb.org squeeze all" | sh -c 'cat >> /etc/apt/sources.list' wget http://www.dotdeb.org/dotdeb.gpg cat dotdeb.gpg | apt-key add - rm dotdeb.gpg apt-get update apt-get install -qq --force-yes php5-fpm php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl /etc/init.d/php5-fpm restart sed -i 's/127.0.0.1:9000/\/tmp\/php5-fpm.sock/g' /etc/php5/fpm/pool.d/www.conf #Restart nginx/php-fpm echo "[*] Finishing up..." service nginx restart /etc/init.d/php5-fpm restart echo "" echo "################################################" echo "# Nginx, MySQL and PHP5 have been installed on #" echo "# this server. Thanks for using my script! #" echo "# #" echo "# -DaL33T #" echo "################################################" exit 0
[Image: 7ajmN5P.jpg]

Telegram: Oni_SL (Link)

Reply

RE: Nginx, PHP and MySQL Installation Script #2
cool but who the fuck uses MySQL

Reply

RE: Nginx, PHP and MySQL Installation Script #3
(09-14-2013, 09:29 PM)Cyanide and Cynicism Wrote: cool but who the fuck uses MySQL

Cool people.
[Image: 7ajmN5P.jpg]

Telegram: Oni_SL (Link)

Reply

RE: Nginx, PHP and MySQL Installation Script #4
(09-14-2013, 09:33 PM)Oni Wrote: Cool people.


Postgre pls.

Reply

RE: Nginx, PHP and MySQL Installation Script #5
(09-14-2013, 09:36 PM)Cyanide and Cynicism Wrote: Postgre pls.
Psshk, SQLite pls.

Reply

RE: Nginx, PHP and MySQL Installation Script #6
Thanks for this. It's much appreciated.

Reply

RE: Nginx, PHP and MySQL Installation Script #7
you should change

Code:
#! /bin/sh

to

Code:
#!/usr/bin/env bash

hooray for proper shebangs

Reply







Users browsing this thread: 1 Guest(s)