Last active
February 27, 2016 21:08
-
-
Save shahariaazam/f8884d4ed811eeb08b87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt-get update && sudo apt-get upgrade && | |
#Web server | |
sudo apt-get install nginx nginx-full && | |
#PHP5.x | |
sudo apt-get install php5 php5-cgi php5-cli php5-common php5-curl php5-dev php5-fpm php5-gd php5-geoip php5-imagick php5-imap php5-intl php5-json php5-mcrypt php5-mysql php5-oauth php5-xdebug php5-xmlrpc php5-memcached libapache2-mod-php5 && | |
#PHP Caching | |
sudo apt-get install memcached && | |
#PHP Package Manager (Composer) | |
sudo curl -sS https://getcomposer.org/installer | php && | |
sudo mv composer.phar /usr/local/bin/composer && | |
#MySQL | |
sudo apt-get install mysql-client mysql-server mysql-workbench phpmyadmin && | |
#Git | |
sudo apt-get install git && | |
#NodeJS | |
sudo apt-get install nodejs nodejs-dev && | |
#cURL | |
sudo apt-get install curl && | |
#Sample VirtualHost setup in nGinx | |
sudo wget https://gist.githubusercontent.com/shahariaazam/f8884d4ed811eeb08b87/raw/e4e596d39dd3fc82dc127eea20f8591f0a11d9ed/2.%2520vhost_common.conf -O /etc/nginx/sites-available/vhost_common.conf && | |
sudo wget https://gist.githubusercontent.com/shahariaazam/f8884d4ed811eeb08b87/raw/e4e596d39dd3fc82dc127eea20f8591f0a11d9ed/3.%2520default_vhost.conf -O /etc/nginx/sites-available/vhost.conf && | |
sudo echo "#include sites-available/vhost.conf" >> /etc/nginx/sites-available/default && | |
#Common Security Tools (Virus Scanner, RootKit checker) | |
sudo apt-get install rkhunter chkrootkit clamav && | |
sudo apt-get update && sudo apt-get upgrade && | |
#Restart Nginx | |
sudo service nginx restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ \.php/?(.*)$ { | |
fastcgi_connect_timeout 60; # default of 60s is just too long | |
fastcgi_read_timeout 60; # default of 60s is just too long | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} | |
#Access phpmyadmin | |
location /phpmyadmin { | |
root /usr/share/; | |
index index.php index.html index.htm; | |
location ~ ^/phpmyadmin/(.+\.php)$ { | |
try_files $uri =404; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
include fastcgi_params; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default Virtual Host | |
server { | |
listen 80; | |
server_name sitename.dev; | |
root your_document_root_location; | |
access_log /var/log/nginx/logfilename.access.log; | |
error_log /var/log/nginx/logfilename.error.log; | |
location / { | |
index index.php; | |
try_files $uri $uri/ /index.php?$args; | |
} | |
include sites-available/vhost_common.conf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment