Coder Social home page Coder Social logo

easyengine / easyengine Goto Github PK

View Code? Open in Web Editor NEW
2.1K 107.0 432.0 5.73 MB

Command-line control panel for Nginx Server to manage WordPress sites running on Nginx, PHP, MySQL, and Let's Encrypt

Home Page: https://easyengine.io

License: MIT License

Shell 1.63% PHP 98.22% Gherkin 0.04% Mustache 0.12%
easyengine nginx wordpress php optimization performance automation hacktoberfest docker linux

easyengine's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easyengine's Issues

rt_cache issue

@MiteshShah

After Creating Domain its showing following error message

Reloading Nginx Configuration, Please Wait... 
nginx: [emerg] unknown log format "rt_cache" in /etc/nginx/sites-enabled/example-domain.com:6
nginx: configuration file /etc/nginx/nginx.conf test failed
Unable To Reload Nginx

Setup prompt

Setup prompt to display username@hostname and current directory.

setup_prompt

WP single site creating issue

After updating ee its showing error while setting up new wordpress single site.
Please check the following error message,

Error: 
<h1>Error establishing a database connection</h1>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>localhost</code>. This could mean your host's database server is down.</p>
<ul>
    <li>Are you sure you have the correct username and password?</li>
    <li>Are you sure that you have typed the correct hostname?</li>
    <li>Are you sure that the database server is running?</li>
</ul>
<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>

[ Fri Aug 30 11:59:09 IST 2013 ]  Unable To Create WordPress Tables For vserv-qa.com 

Domain Name

Check Domain Name For Small Alphabets

Convert DomainWP.com to small letters.

Curl is not installed by default

While trying to install easyengine on a fresh Ubuntu 12.04 machine, I'm prompted to install curl.

It will be good if the script takes care of handling whether curl is needed, and installing it if required.

Is there an alternative way to load your script, which uses a method available by default on a fresh installation of Linux?

after updating the EE, its again asking to overwrite files

cp: overwrite ‘/etc/nginx/conf.d/blockips.conf’? y
‘/usr/share/easyengine/nginx/conf.d/blockips.conf’ -> ‘/etc/nginx/conf.d/blockips.conf’
cp: overwrite ‘/etc/nginx/conf.d/fastcgi.conf’? y
‘/usr/share/easyengine/nginx/conf.d/fastcgi.conf’ -> ‘/etc/nginx/conf.d/fastcgi.conf’
cp: overwrite ‘/etc/nginx/conf.d/upstream.conf’? y
‘/usr/share/easyengine/nginx/conf.d/upstream.conf’ -> ‘/etc/nginx/conf.d/upstream.conf’
cp: overwrite ‘/etc/nginx/common/locations.conf’? y
‘/usr/share/easyengine/nginx/common/locations.conf’ -> ‘/etc/nginx/common/locations.conf’

The script already overwritten these files, but when again I started the script, its asking me to overwrite these files.

I think, you must check whether, the files are update or not.

limit_req_zone failed

@MiteshShah

Restarting nginx: nginx: [emerg] unknown limit_req_zone "one" in /etc/nginx/common/wpcommon.conf:6
nginx: configuration file /etc/nginx/nginx.conf test failed

Interactive

Menu driven program

It could start when ee -i is provided or could be made default behavior for ee or subcommands e.g. ee site

Nginx Doen't Start Properly

service nginx restart
Restarting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Issue in easyengine git and pma

  1. After removing site from easyengine showing following error,
    fatal: Not a git repository (or any of the parent directories): .git
    Unable To Git Commits On /etc/nginx
  2. Also I'm not able to access phpmyadmin on my local easyengine.
    FYI - I have updated easyengine on my system, but still pma not working.

Option for wp_ prefix for database

Can you provide prompt to add database prefix?
Like, by default I am getting wp_ from easyengine.
If I want to use another one rt_wp_ , then?

php does not auto start

after creating a new site......check of php-fpm is started or not......if not please start it

SSL Session Cache

If there is a single HTTP site, we must add SSL cache. It was present on rtCamp old server... We missed that during migration. Added it just now!

Add... /etc/nginx/nginx.conf inside http{...} block

    ssl_session_cache   shared:SSL:10m;
    ssl_session_timeout 10m;

Also add...

ssl_ciphers RC4:HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

http://nginx.org/en/docs/http/configuring_https_servers.html

Restarting Nginx Configuration issue while install EasyEngine

Issue while installation easyengine (ee system install all)
It's creating issue while restarting nginx configuration.

 Updating Nginx Configuration Files...  
 Restarting Nginx Configuration, Please Wait... 
nginx: [emerg] "client_max_body_size" directive is duplicate in /etc/nginx/nginx.conf:42
nginx: configuration file /etc/nginx/nginx.conf test failed
[ Tue Sep  3 14:17:19 IST 2013 ]  Unable To Restart Nginx 

Better way to restart services

Sometime service is failed to stop/start/restart in this case
https://github.com/rtCamp/rtAdmin/blob/master/zzz/restart.sh is not able to detect weather the service is restarted successfully or not.

I've some solutions for this problems

!/bin/bash

Restart the MySQL Service

service mysql restart

MySQL Restarted Susscessfully?

CHECK=$(echo $?)

If MySQL Is Not Restarted

Then Restart MySQL Service

while [ $CHECK -gt 0 ]
do
#echo In While $CHECK
service mysql restart
CHECK=$(echo $?)

done

Restart the PHP5-FPM Service

service php5-fpm restart

PHP5-FPM Restarted Susscessfully?

CHECK=$(echo $?)

If PHP5-FPM Is Not Restarted

Then Restart PHP5-FPM Service

while [ $CHECK -gt 0 ]
do
#echo In While $CHECK
service php5-fpm restart
CHECK=$(echo $?)

done

Issue while Delete HTML or PHP site

Its checking for wp-config.php file while deleting HTML or PHP site, check the log listed below,

root@UbuntuEE:~# ee site delete all wpbasic.com
grep: /var/www/wpbasic.com/wp-config.php: No such file or directory
grep: /var/www/wpbasic.com/wp-config.php: No such file or directory
grep: /var/www/wpbasic.com/wp-config.php: No such file or directory
 WPDBNAME =  
 MYSQLUSER =  
 MYSQLPASS = 

Subcommand help

If I run a subcommand only, then help for that subcommand should be shown.

Not able to create site if "/" present in domain

@MiteshShah

If Create domain like "http://example-domain.com/" it validate and remove http, https and www but not removing "/" which present in domain and showing following error message.

root@linux:~# ee site create wp basic http://example-domain.com/
 WPNETWORKSITE = wp 
 WPCACHEOPTION = basic 
 SITENAMECHECK = http://example-domain.com/ 
 NGINXCONF = wp/basic.conf 
 WPSUBDOMAINS =  
 NETWORKACTIVATE = 
 Creating example-domain.com/, Please Wait... 
/usr/local/sbin/ee: line 510: /etc/nginx/sites-available/example-domain.com/: Is a directory
Unable To Create Nginx Configuration File For example-domain.com/ 

Remove PHP Can Install Apache Packages

While i'm trying to purge php it show following messages

root@Abhishek:~# ee system purge php
 Purge PHP5...  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2 apache2-bin apache2-data dbconfig-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libc-client2007e libgd3 libmcrypt4
  libonig2 libqdbm14 libssl-dev libssl-doc mlock shtool zlib1g-dev
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  apache2 apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
Suggested packages:
  apache2-doc apache2-suexec-pristine apache2-suexec-custom apache2-utils
The following packages will be REMOVED:
  php-apc* php-gettext* php-pear* php5-apcu* php5-cgi* php5-cli* php5-common* php5-curl* php5-dev* php5-fpm* php5-gd* php5-imap* php5-json*
  php5-mcrypt* php5-mysqlnd* php5-xmlrpc* phpmyadmin* pkg-php-tools*
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
0 upgraded, 7 newly installed, 18 to remove and 0 not upgraded.
Need to get 1,439 kB of archives.

PMA Install Issue

Every time we install PMA it will overwrite files if already installed, see the log below

Installing PMA...  
--2013-08-29 00:40:48--  http://dl.cihar.com/phpMyAdmin/master/phpMyAdmin-master-latest.tar.gz
Resolving dl.cihar.com (dl.cihar.com)... 77.78.110.71, 2001:1528:136:dead:beef::1003
Connecting to dl.cihar.com (dl.cihar.com)|77.78.110.71|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11333080 (11M) [application/x-gzip]
Saving to: `/var/www/shared/pma/pma.tar.gz'

100%[========================================================================================================================>] 11,333,080  --.-K/s   in 0.1s    

2013-08-29 00:40:48 (93.6 MB/s) - `/var/www/shared/pma/pma.tar.gz' saved [11333080/11333080]

ee log

ee log production
ee log dev

mysql slow log
php5-fpm slowlog

php error log debug
nginx error log debug

Usage

  • ee or ee help or ee -h or ee --help

Should show usage and list of commands.
Also show message for help on a command, run ee help <command>

  • ee site list
    Should list sites-enabled
  • ee site list --all
    Should list sites-available
  • ee site show <sitename>
    Show config of sitename
  • ee site info <sitename>
    Shows:
    Type e.g. WordPress site with W3 Total Cache
    conf file path
    webroot path
    error log path
    access log path
    mysql database (if name)
  • ee site create <sitename> <args>
    If no args specified, create a plain HTML site. Create access/error logs and webroot. Nginx config file.

If <--php> - add php support

If <-wp | --with-wordpress> => install wordpress (create database) in addition above.

If <-wp --multi --w3tc --wpsc --fc > => install with a cache config
--w3tc > w3 total cache
--wpsc > wp super cache
--fc > nginx's fastcgi cache + nginx-helper plugin

--multi-dir > wordpress multisite + subdirectory
--multi-dom > wordpress multisite + subdomain

  • `ee site disable '
    if no delete nginx config only from sites-enabled.
  • `ee site enable '
    Opposite of enable
  • `ee site delete '
    if no delete nginx config only from sites-enabled. Just like site disable

args = --files --db --config --logs --all > delete accordingly

  • `ee site backup '
    if is not specified use default location.

default all user can specify --files --db --config --logs

backup-structure
/path/to/backup/location/sitename/TIMESTAMP.zip
TIMESTAMP >> YYYY-MM-DD-HH-MM-SS
TIMESTAMP.zip
+files/
+logs/
+db/
+conf/

  • `ee site restore '
    if no path is specified latest will be used
    we will ask user to confirm
    we will ask twice if destination site/files/logs/database already exist. Also ask if we should proceed with backup or without backup.

= --force - do not ask during restore

  • `ee site update '
    enable/disable php
    add wordpress
    change cache type
    change wordpress type
  • `ee site debug '
    start debugging
    nginx error_log debug
    php error_log debug
    wordpress debug
    mysql slowlog

can be --instant --start --stop

--instant will start debugging and display tail. debug will stop as soon as CTRL + C is hit

--for-me > nginx debug_connection set to user's IP
--for-all > nginx erro_log set to debug

  • ee system config [set|get] [memory|timeout|etc]
    show config for nginx

ee config php --edit
php, php.ini, php5-fpm, fpm pool-www, nginx.conf, my.cnf main.cf master.cf etc

  • ee site edit <sitename>

open nginx conf for that site

If possible, please add site redirection

Add write rule for website redirection.

e.g.

example.in should redirect to example.com

The re-write rule can be added in nginx conf file of example.in under /etc/nginx/sites-available/example.in

Auto Reload Nginx Configuration

When we create a symbolic link in /etc/nginx/sites-enabled

Then shell script auto detect any new file is created in /etc/nginx/sites-enabled
Then call nginx -t to check nginx configuration test
If nginx configuration test is passed
Then reload nginx using the following commands

service nginx reload

This following script is just a demo needed proper logging.

#!/bin/bash
dpkg --list | grep inotify-tools &> /dev/null
if [ $? -eq 0 ]
then
        echo "Inotify Tools Already Installed"
else
        echo "Installing Inotify Tools..."
        apt-get -y install inotify-tools
fi
while true
do
        inotifywait --exclude .swp -e create -e modify -e delete -e move  /etc/nginx/sites-enabled
        nginx -t
        if [ $? -eq 0 ]
        then
                echo "Reloading Nginx Configuration"
                service nginx reload
        fi
done

Installation Script copy command issue

curl -sL rt.cx/ee | sudo bash
EasyEngine Installation Started 08-Aug-2013 11:48:20
Installing Easy Engine, Please Wait...
For Easy Engine Auto Completion Run Following Command
source /etc/bash_completion.d/ee

Easy Engine Installed Successfully
Easy Engine Help: https://github.com/rtCamp/easyengine/wiki

It create nginx folder under /usr/share/easyengine/nginx this directory, It suppose to replace folder "nginx".

Hotlink Protection

# disable hotlinking code
location ~* \.(svg|svgz|jpg|jpeg|gif|png|ico|bmp)$ {
        valid_referers blocked example.com;
        if ($invalid_referer) {
                # return 405;
                rewrite  ^/(.*)$ http://rtcamp.com/wp-content/uploads/2010/03/wp-nginx-460x154.png;
        }
}

Defaults

  • Running ee only
  • Running ee <command> i.e. command
  • Running ee <command> <subcommand> i.e. subcommand
  • Running ee <command> [args] i.e. command with args
  • Running ee <command> <subcommand> [args] i.e. subcommand with args

Use defaults args wherever possible or show HELP

ee system install needs polishing

  • Make "all" as default. ee system install is same as ee system install all
  • Store original output into log file.
  • Show pv style progress bar for each package that is being installed behind the scene. Also add something like 1/5, 2/5, etc
  • System install shouldn't ask for user input. GPG key addition steps specially.

Explore shell scripting framework

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.