-
-
Save sepulchre/fde24f8f6502afb0e295 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
# redirect from non-www to www | |
server { | |
listen 80; | |
server_name demodomain.com; | |
return 301 $scheme://www.demodomain.com$request_uri; | |
} | |
server { | |
listen 80; | |
server_name www.demodomain.com; | |
# limit_conn limit_per_ip 16; | |
# ssi on; | |
access_log /home/nginx/domains/demodomain.com/log/access.log ; | |
error_log /home/nginx/domains/demodomain.com/log/error.log error; | |
root /home/nginx/domains/demodomain.com/public; | |
location / { | |
# block common exploits, sql injections etc | |
#include /usr/local/nginx/conf/block.conf; | |
# Enables directory listings when index file not found | |
# autoindex on; | |
# Shows file listing times as local time | |
# autoindex_localtime on; | |
# Enable for vBulletin usage WITHOUT vbSEO installed | |
# try_files $uri $uri/ /index.php; | |
} | |
include /usr/local/nginx/conf/staticfiles.conf; | |
include /usr/local/nginx/conf/php.conf; | |
include /usr/local/nginx/conf/drop.conf; | |
#include /usr/local/nginx/conf/errorpage.conf; | |
} |
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
# redirect from non-www to www | |
# uncomment, save file and restart Nginx to enable | |
#server { | |
# listen 80; | |
# server_name mydomain.com; | |
# return 301 $scheme://www.mydomain.com$request_uri; | |
# } | |
server { | |
server_name mydomain.com www.mydomain.com; | |
# ngx_pagespeed & ngx_pagespeed handler | |
#include /usr/local/nginx/conf/pagespeed.conf; | |
#include /usr/local/nginx/conf/pagespeedhandler.conf; | |
#include /usr/local/nginx/conf/pagespeedstatslog.conf; | |
# limit_conn limit_per_ip 16; | |
# ssi on; | |
access_log /home/nginx/domains/mydomain.com/log/access.log combined buffer=32k; | |
error_log /home/nginx/domains/mydomain.com/log/error.log; | |
root /home/nginx/domains/mydomain.com/public; | |
location / { | |
index index.php index.html index.htm; | |
try_files $uri $uri/ /index.php?$uri&$args; | |
# block common exploits, sql injections etc | |
#include /usr/local/nginx/conf/block.conf; | |
# Enables directory listings when index file not found | |
#autoindex on; | |
# Shows file listing times as local time | |
#autoindex_localtime on; | |
# Enable for vBulletin usage WITHOUT vbSEO installed | |
#try_files $uri $uri/ /index.php; | |
} | |
location /internal_data/ { | |
internal; | |
allow 127.0.0.1; | |
deny all; | |
} | |
location /library/ { | |
internal; | |
allow 127.0.0.1; | |
deny all; | |
} | |
include /usr/local/nginx/conf/staticfiles.conf; | |
include /usr/local/nginx/conf/php.conf; | |
include /usr/local/nginx/conf/drop.conf; | |
#include /usr/local/nginx/conf/errorpage.conf; | |
} |
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
# https SSL SPDY phpmyadmin | |
server { | |
listen 443 ssl spdy; | |
server_name server.mydomain.com; | |
root html; | |
keepalive_timeout 1800; | |
client_body_buffer_size 256k; | |
client_body_timeout 1800s; | |
client_header_buffer_size 256k; | |
## how long a connection has to complete sending | |
## it's headers for request to be processed | |
client_header_timeout 60s; | |
client_max_body_size 512m; | |
connection_pool_size 512; | |
directio 512m; | |
ignore_invalid_headers on; | |
large_client_header_buffers 8 256k; | |
ssl_certificate /usr/local/nginx/conf/ssl/server.mydomain.com.crt; | |
ssl_certificate_key /usr/local/nginx/conf/ssl/server.mydomain.com.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | |
# mozilla recommended | |
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA; | |
ssl_prefer_server_ciphers on; | |
add_header Alternate-Protocol 443:npn-spdy/3; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; | |
add_header X-Frame-Options SAMEORIGIN; | |
spdy_headers_comp 6; | |
ssl_buffer_size 1400; | |
ssl_session_tickets on; | |
# limit_conn limit_per_ip 16; | |
# ssi on; | |
access_log /var/log/nginx/localhost_ssl.access.log main buffer=32k; | |
error_log /var/log/nginx/localhost_ssl.error.log error; | |
# ngx_pagespeed & ngx_pagespeed handler | |
#include /usr/local/nginx/conf/pagespeed.conf; | |
#include /usr/local/nginx/conf/pagespeedhandler.conf; | |
#include /usr/local/nginx/conf/pagespeedstatslog.conf; | |
location / { | |
} | |
include /usr/local/nginx/conf/phpmyadmin_https.conf; | |
include /usr/local/nginx/conf/staticfiles.conf; | |
include /usr/local/nginx/conf/php.conf; | |
include /usr/local/nginx/conf/drop.conf; | |
include /usr/local/nginx/conf/errorpage.conf; | |
} |
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
useradd: user 'phpmyadmin' already exists | |
[1;32;40m--------------------------------------------------------------- | |
[m[1;33;40mCreate User: phpmyadmin | |
[m[1;33;40muid=503(phpmyadmin) gid=503(phpmyadmin) groups=503(phpmyadmin),501(nginx) | |
[m[1;32;40m--------------------------------------------------------------- | |
[m | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mInstalling phpmyadmin from official git repository... | |
[m[1;33;40m--------------------------------------------------------------- | |
[m[1;33;40mThis process can take some time depending on | |
[m[1;33;40mspeed of the repository and your server... | |
[m | |
Initialized empty Git repository in /usr/local/nginx/html/5688_mysqladmin23352/.git/ | |
Switched to a new branch 'STABLE' | |
Branch STABLE set up to track remote branch STABLE from origin. | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mSetup /usr/local/nginx/conf/phpmyadmin.conf ... | |
[m[1;33;40m--------------------------------------------------------------- | |
[m[1;33;40m--------------------------------------------------------------- | |
[m[1;33;40mCreate phpmyadmin htaccess user/pass... | |
[m[1;32;40mpython /usr/local/nginx/conf/htpasswd.py -c -b /usr/local/nginx/conf/htpassphpmyadmin adminsr896O1Crrc= kHtKkcWclIScbaD5al8RhetP9nI= | |
[m[1;33;40m--------------------------------------------------------------- | |
[m | |
\cp -af /usr/local/nginx/conf/php.conf /usr/local/nginx/conf/php_5688_mysqladmin23352.conf | |
[1;33;40m--------------------------------------------------------------- | |
[mserver { | |
# listen 80; | |
listen 80 default_server backlog=256; | |
server_name server.mywebsite.com; | |
root html; | |
access_log /var/log/nginx/localhost.access.log main buffer=32k; | |
error_log /var/log/nginx/localhost.error.log error; | |
# ngx_pagespeed & ngx_pagespeed handler | |
#include /usr/local/nginx/conf/pagespeed.conf; | |
#include /usr/local/nginx/conf/pagespeedhandler.conf; | |
#include /usr/local/nginx/conf/pagespeedstatslog.conf; | |
# limit_conn limit_per_ip 16; | |
# ssi on; | |
location / { | |
# block common exploits, sql injections etc | |
#include /usr/local/nginx/conf/block.conf; | |
# Enables directory listings when index file not found | |
# autoindex on; | |
# Shows file listing times as local time | |
# autoindex_localtime on; | |
# Enable for vBulletin usage WITHOUT vbSEO installed | |
# try_files $uri $uri/ /index.php; | |
} | |
# example nginx-http-concat | |
# /csstest/??one.css,two.css | |
#location /csstest { | |
#concat on; | |
#concat_max_files 20; | |
#} | |
include /usr/local/nginx/conf/phpmyadmin.conf; | |
include /usr/local/nginx/conf/staticfiles.conf; | |
include /usr/local/nginx/conf/cinfo.conf; | |
include /usr/local/nginx/conf/php.conf; | |
#include /usr/local/nginx/conf/phpstatus.conf; | |
include /usr/local/nginx/conf/drop.conf; | |
#include /usr/local/nginx/conf/errorpage.conf; | |
}[1;33;40m--------------------------------------------------------------- | |
[m[1;33;40mNON-STATIC IP configuration | |
[m[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mcat /usr/local/nginx/conf/phpmyadmin.conf | |
[m[1;33;40m--------------------------------------------------------------- | |
[mlocation ^~ /5688_mysqladmin23352/ { | |
rewrite ^/(.*) https://server.mywebsite.com/$1 permanent; | |
} | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mcat /usr/local/nginx/conf/phpmyadmin_https.conf | |
[m[1;33;40m--------------------------------------------------------------- | |
[mlocation ^~ /5688_mysqladmin23352/ { | |
#try_files $uri $uri/ /5688_mysqladmin23352/index.php?$args; | |
include /usr/local/nginx/conf/php_5688_mysqladmin23352.conf; | |
auth_basic "Private Access"; | |
auth_basic_user_file /usr/local/nginx/conf/htpassphpmyadmin; | |
#allow 127.0.0.1; | |
#allow 79.225.41.141; | |
#deny all; | |
} | |
[1;33;40m--------------------------------------------------------------- | |
[m | |
[1;32;40mtouch /usr/local/nginx/conf/phpfpmd/phpfpm_myadmin.conf | |
[m | |
[1;33;40mDynamically set PHP memory_limit based on available system memory... | |
[m | |
[1;33;40mTotal Mem: 6144 MB | |
[m[1;33;40mReal Free Mem: 5805 MB | |
[m[1;33;40mMem Limit: 2580 MB | |
[m | |
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok | |
nginx: [emerg] open() "/home/nginx/domains/demodomain.com/log/access.log" failed (2: No such file or directory) | |
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed | |
Gracefully shutting down php-fpm . done | |
Starting php-fpm done | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mSSL Vhost Setup... | |
[m[1;33;40m--------------------------------------------------------------- | |
[m | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mGenerating self signed SSL certificate... | |
[m[1;32;40mJust hit enter at each of the prompts | |
[m[1;33;40m--------------------------------------------------------------- | |
[m | |
Generating RSA private key, 1024 bit long modulus | |
............++++++ | |
...............................++++++ | |
e is 65537 (0x10001) | |
You are about to be asked to enter information that will be incorporated | |
into your certificate request. | |
What you are about to enter is what is called a Distinguished Name or a DN. | |
There are quite a few fields but you can leave some blank | |
For some fields there will be a default value, | |
If you enter '.', the field will be left blank. | |
----- | |
Country Name (2 letter code) [XX]:State or Province Name (full name) []:Locality Name (eg, city) [Default City]:Organization Name (eg, company) [Default Company Ltd]:Organizational Unit Name (eg, section) []:Common Name (eg, your name or your server's hostname) []:Email Address []: | |
Please enter the following 'extra' attributes | |
to be sent with your certificate request | |
A challenge password []:An optional company name []:Signature ok | |
subject=/C=XX/L=Default City/O=Default Company Ltd | |
Getting Private key | |
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok | |
nginx: [emerg] open() "/home/nginx/domains/demodomain.com/log/access.log" failed (2: No such file or directory) | |
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed | |
Gracefully shutting down php-fpm . done | |
Starting php-fpm done | |
chmod: cannot access `/var/log/nginx/localhost_ssl.access.log': No such file or directory | |
chmod: cannot access `/var/log/nginx/localhost_ssl.error.log': No such file or directory | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mCreate update script: | |
[m[1;32;40m/root/tools/phpmyadmin_update.sh | |
[m[1;33;40m--------------------------------------------------------------- | |
[m[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mCreate uninstall script: | |
[m[1;32;40m/root/tools/phpmyadmin_uninstall.sh | |
[m[1;33;40m--------------------------------------------------------------- | |
[m | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mPassword protected 5688_mysqladmin23352 | |
[m[1;32;40mat path /usr/local/nginx/html/5688_mysqladmin23352 | |
[m[1;32;40mconfig.inc.php at: /usr/local/nginx/html/5688_mysqladmin23352/config.inc.php | |
[m[1;32;40m WEB url: | |
[m | |
[1;37;40m https://server.mywebsite.com/5688_mysqladmin23352 | |
[m | |
[1;32;40mLogin with your MySQL root username / password | |
[m[1;33;40m--------------------------------------------------------------- | |
[m | |
[1;32;40mphpmyadmin htaccess login details: | |
[m[1;32;40mUsername: adminsr896O1Crrc= | |
[m[1;32;40mPassword: kHtKkcWclIScbaD5al8RhetP9nI= | |
[m[1;32;40mAllowed IP address: 79.225.41.141 | |
[m | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mphpmyadmin update script at: /root/tools/phpmyadmin_update.sh | |
[m[1;32;40mAdd your own cron job to automatically run the update script i.e. | |
[m | |
[1;37;40m 15 01 * * * /root/tools/phpmyadmin_update.sh | |
[m | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mphpmyadmin uninstall script at: /root/tools/phpmyadmin_uninstall.sh | |
[m | |
[1;37;40m /root/tools/phpmyadmin_uninstall.sh | |
[m | |
[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mSSL vhost: /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf | |
[m[1;32;40mphp-fpm includes: /usr/local/nginx/conf/php_5688_mysqladmin23352.conf | |
[m[1;32;40mphp-fpm pool conf: /usr/local/nginx/conf/phpfpmd/phpfpm_myadmin.conf | |
[m[1;32;40mdedicated php-fpm pool user: phpmyadmin | |
[m[1;32;40mdedicated php-fpm pool group: nginx | |
[m[1;32;40mdedicated php error log: /var/log/php_myadmin_error.log | |
[m[1;33;40m--------------------------------------------------------------- | |
[m[1;32;40mSSL vhost access log: /var/log/nginx/localhost_ssl.access.log | |
[m[1;32;40mSSL vhost error log: /var/log/nginx/localhost_ssl.error.log | |
[m[1;33;40m--------------------------------------------------------------- | |
[m | |
Total phpmyadmin Install Time: 274.333721226 seconds |
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
# HTTPS server | |
# | |
#server { | |
# listen 443; | |
# server_name localhost; | |
# keepalive_timeout 30; | |
# ssl on; | |
# ssl_certificate cert.pem; | |
# ssl_certificate_key cert.key; | |
# ssl_session_timeout 5m; | |
#openssl <1.0.1 | |
#ssl_protocols SSLv3 TLSv1; | |
#openssl >=1.0.1 | |
#ssl_protocols SSLv3 TLSv1.1 TLSv1.2; | |
## | |
# ssl_session_cache shared:SSL:10m; | |
# ssl_session_timeout 10m; | |
## http://www.openssl.org/docs/apps/ciphers.html | |
# ssl_ciphers RC4:HIGH:!aNULL:!MD5:!kEDH; | |
# ssl_prefer_server_ciphers on; | |
# location / { | |
# root html; | |
# } | |
#include /usr/local/nginx/conf/staticfiles.conf; | |
#include /usr/local/nginx/conf/php.conf; | |
#include /usr/local/nginx/conf/drop.conf; | |
#include /usr/local/nginx/conf/errorpage.conf; | |
#} |
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
server { | |
# listen 80; | |
listen 80 default_server backlog=256; | |
server_name server.mywebsite.com; | |
root html; | |
access_log /var/log/nginx/localhost.access.log main buffer=32k; | |
error_log /var/log/nginx/localhost.error.log error; | |
# ngx_pagespeed & ngx_pagespeed handler | |
#include /usr/local/nginx/conf/pagespeed.conf; | |
#include /usr/local/nginx/conf/pagespeedhandler.conf; | |
#include /usr/local/nginx/conf/pagespeedstatslog.conf; | |
# limit_conn limit_per_ip 16; | |
# ssi on; | |
location / { | |
# block common exploits, sql injections etc | |
#include /usr/local/nginx/conf/block.conf; | |
# Enables directory listings when index file not found | |
# autoindex on; | |
# Shows file listing times as local time | |
# autoindex_localtime on; | |
# Enable for vBulletin usage WITHOUT vbSEO installed | |
# try_files $uri $uri/ /index.php; | |
} | |
# example nginx-http-concat | |
# /csstest/??one.css,two.css | |
#location /csstest { | |
#concat on; | |
#concat_max_files 20; | |
#} | |
include /usr/local/nginx/conf/phpmyadmin.conf; | |
include /usr/local/nginx/conf/staticfiles.conf; | |
include /usr/local/nginx/conf/cinfo.conf; | |
include /usr/local/nginx/conf/php.conf; | |
#include /usr/local/nginx/conf/phpstatus.conf; | |
include /usr/local/nginx/conf/drop.conf; | |
#include /usr/local/nginx/conf/errorpage.conf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment