Browse Source

Merge branch 'feature/nginx-plus' into develop

feature/refactor-php
harshadyeola 10 years ago
parent
commit
0f7dd3f894
  1. 3
      CHANGELOG.txt
  2. 2
      docs/ee.8
  3. 11
      ee/cli/plugins/site_functions.py
  4. 51
      ee/cli/plugins/stack.py
  5. 84
      ee/cli/templates/ee-plus.mustache
  6. 2
      ee/core/variables.py
  7. 2
      install
  8. 2
      setup.py

3
CHANGELOG.txt

@ -1,3 +1,6 @@
v 3.3.7 - Sep 9, 2015
- EasyEngine + NGINX PLUS (http://docs.rtcamp.com/easyengine/nginx-plus/)
v 3.3.6 - Sep 4, 2015
- Fix #611

2
docs/ee.8

@ -1,4 +1,4 @@
.TH ee 8 "EasyEngine (ee) version: 3.3.6" "Sept 4,2015" "EasyEngine"
.TH ee 8 "EasyEngine (ee) version: 3.3.7" "Sep 9,2015" "EasyEngine"
.SH NAME
.B EasyEngine (ee)
\- Manage Nginx Based Websites.

11
ee/cli/plugins/site_functions.py

@ -655,7 +655,18 @@ def site_package_check(self, stype):
'wpsubdomain']:
Log.debug(self, "Setting apt_packages variable for Nginx")
# Check if server has nginx-custom package
if not EEAptGet.is_installed(self, 'nginx-custom'):
# check if Server has nginx-plus installed
if EEAptGet.is_installed(self, 'nginx-plus'):
# do something
# do post nginx installation configuration
Log.info(self, "NGINX PLUS Detected ...")
apt = ["nginx-plus"] + EEVariables.ee_nginx
#apt_packages = apt_packages + EEVariables.ee_nginx
stack.post_pref(apt, packages)
else:
apt_packages = apt_packages + EEVariables.ee_nginx
else:
# Fix for Nginx white screen death

51
ee/cli/plugins/stack.py

@ -329,6 +329,23 @@ class EEStackController(CementBaseController):
out=ee_nginx)
ee_nginx.close()
# Nginx-Plus does not have nginx package structure like this
# So craeting directories
if set(["nginx-plus"]).issubset(set(apt_packages)):
Log.info(self,
"Installing EasyEngine Configurations for" "NGINX PLUS")
if not os.path.exists('/etc/nginx/sites-available'):
Log.debug(self, 'Creating directory'
'/etc/nginx/sites-available')
os.makedirs('/etc/nginx/sites-available')
if not os.path.exists('/etc/nginx/sites-enabled'):
Log.debug(self, 'Creating directory'
'/etc/nginx/sites-available')
os.makedirs('/etc/nginx/sites-enabled')
# 22222 port settings
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/sites-available/'
@ -427,6 +444,34 @@ class EEStackController(CementBaseController):
EEGit.add(self,
["/etc/nginx"], msg="Adding Nginx into Git")
EEService.reload_service(self, 'nginx')
if set(["nginx-plus"]).issubset(set(apt_packages)):
EEShellExec.cmd_exec(self, "sed -i -e 's/^user/#user/'"
" -e '/^#user/a user"
"\ www-data\;'"
" /etc/nginx/nginx.conf")
if not EEShellExec.cmd_exec(self, "cat /etc/nginx/"
"nginx.conf | grep -q "
"'/etc/nginx/sites-enabled'"):
EEShellExec.cmd_exec(self, "sed -i '/\/etc\/"
"nginx\/conf\.d\/\*"
"\.conf/a \ include"
"\ \/etc\/nginx\/sites-enabled"
"\/*;' /etc/nginx/nginx.conf")
# EasyEngine config for NGINX plus
data['version'] = EEVariables.ee_version
Log.debug(self, 'Writting for nginx plus configuration'
' to file /etc/nginx/conf.d/ee-plus.conf')
ee_nginx = open('/etc/nginx/conf.d/ee-plus.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'ee-plus.mustache',
out=ee_nginx)
ee_nginx.close()
print("HTTP Auth User Name: easyengine"
+ "\nHTTP Auth Password : {0}".format(passwd))
EEService.reload_service(self, 'nginx')
else:
self.msg = (self.msg + ["HTTP Auth User Name: easyengine"]
+ ["HTTP Auth Password : {0}".format(passwd)])
@ -1571,7 +1616,13 @@ class EEStackController(CementBaseController):
Log.debug(self, "Setting apt_packages variable for Nginx")
if not EEAptGet.is_installed(self, 'nginx-custom'):
if not EEAptGet.is_installed(self, 'nginx-plus'):
apt_packages = apt_packages + EEVariables.ee_nginx
else:
Log.info(self, "NGINX PLUS Detected ...")
apt = ["nginx-plus"] + EEVariables.ee_nginx
#apt_packages = apt_packages + EEVariables.ee_nginx
self.post_pref(apt, packages)
else:
Log.debug(self, "Nginx already installed")
Log.info(self, "Nginx already installed")

84
ee/cli/templates/ee-plus.mustache

@ -0,0 +1,84 @@
##
# EasyEngine Settings
##
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
server_tokens off;
reset_timedout_connection on;
add_header X-Powered-By "EasyEngine {{ version }}";
add_header rt-Fastcgi-Cache $upstream_cache_status;
# Limit Request
limit_req_status 403;
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
# Proxy Settings
# set_real_ip_from proxy-server-ip;
# real_ip_header X-Forwarded-For;
fastcgi_read_timeout 300;
client_max_body_size 100m;
##
# SSL Settings
##
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;
ssl_prefer_server_ciphers on;
ssl_ciphers HIGH:!aNULL:!MD5:!kEDH;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
##
# Basic Settings
##
server_names_hash_bucket_size 16384;
# server_name_in_redirect off;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Log format Settings
log_format rt_cache '$remote_addr $upstream_response_time $upstream_cache_status [$time_local] '
'$http_host "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$request_body"';
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component
text/xml
text/javascript;

2
ee/core/variables.py

@ -12,7 +12,7 @@ class EEVariables():
"""Intialization of core variables"""
# EasyEngine version
ee_version = "3.3.6"
ee_version = "3.3.7"
# EasyEngine packages versions

2
install

@ -48,7 +48,7 @@ fi
# Define variables for later use
ee_branch=$1
readonly ee_version_old="2.2.3"
readonly ee_version_new="3.3.6"
readonly ee_version_new="3.3.7"
readonly ee_log_dir=/var/log/ee/
readonly ee_install_log=/var/log/ee/install.log
readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}')

2
setup.py

@ -54,7 +54,7 @@ except Exception as e:
os.system("git config --global user.email {0}".format(ee_email))
setup(name='ee',
version='3.3.6',
version='3.3.7',
description=long_description,
long_description=long_description,
classifiers=[],

Loading…
Cancel
Save