Browse Source

Merge branch 'master' of ssh://github.com/rtCamp/easyengine

old-stable
Rahul Bansal 12 years ago
parent
commit
97824a58bd
  1. 55
      README.md
  2. 0
      php/config-sample.php
  3. 10
      php/create.php
  4. 10
      php/example.com
  5. 0
      php/init.php
  6. 0
      php/move.php
  7. 0
      php/remove.php
  8. 0
      php/test.php
  9. 0
      php/touch.php
  10. 20
      setup/install-mysql.sh
  11. 28
      setup/install-nginx.sh
  12. 29
      setup/install-php5.sh
  13. 20
      setup/install-postfix.sh
  14. 65
      setup/pre-checks.sh

55
README.md

@ -1,12 +1,61 @@
rtAdmin EasyEngine
======= ==========
Admin tools for Nginx based wordpress sites management. Admin tools for Nginx based wordpress sites management.
This is work in PROGRESS. This will break things on your end most likely! This is work in PROGRESS. This will break things on your end most likely!
# TODO
## Usage
### engine Commands:
`engine site` #site-specific commands
`engine system` system-wide commands
`engine config` configuration commands
### engine site
`engine site create <site-name> [--with-wordpress]`
`engine site read --active`
`engine site update <site-name>`
`engine site delete <site-name>`
### engine system
`engine system install [php mysql nginx apc postfix] [--all] [--source]`
`engine system upgrade [php mysql nginx apc postfix] [--all]`
`engine system remove [php mysql nginx apc postfix] [--all]`
`engine system purge [php mysql nginx apc postfix] [--all]`
### engine config
`engine config set [memory | timeout] [value]`
`engine config get [[memory | timeout]|--all]`
`engine config --interactive` #reconfigure everything
## Files
### Logs location:
Main Log: `/var/log/easyengine/main.log`
Debug Log: `/var/log/easyengine/debug.log`
===
Notes: Notes:

0
config-sample.php → php/config-sample.php

10
create.php → php/create.php

@ -78,8 +78,14 @@ $result = system("mkdir " . $domain['htdocs']);
$result = system("mkdir " . $domain['logs']); $result = system("mkdir " . $domain['logs']);
//create log files //create log files
$result = system("touch " . $domain['logs'] . "/access.log"); //in nginx folder
$result = system("touch " . $domain['logs'] . "/error.log"); $result = system("touch " . "/var/log/nginx/" . $domain['name'] . ".access.log");
$result = system("touch " . "/var/log/nginx/" . $domain['name'] . ".error.log");
//symlink
$result = system("ln -s " . "/var/log/nginx/" . $domain['name'] . ".access.log " . $domain['logs'] . "/access.log");
$result = system("ln -s " . "/var/log/nginx/" . $domain['name'] . ".error.log " . $domain['logs'] . "/error.log");
//Error check //Error check
if ($result != '') { if ($result != '') {

10
example.com → php/example.com

@ -1,9 +1,8 @@
server{ server{
server_name example.com; server_name www.example.com example.com;
listen 80;
access_log /var/www/example.com/logs/access.log ; access_log /var/log/nginx/example.com.access.log ;
error_log /var/www/example.com/logs/error.log; error_log /var/log/nginx/example.com.error.log;
root /var/www/example.com/htdocs; root /var/www/example.com/htdocs;
index index.php index.html index.htm; index index.php index.html index.htm;
@ -13,12 +12,11 @@ server{
include /etc/nginx/fastcgi_params; include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000; fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
} }
#root dir #root dir
location / { location / {
autoindex on; autoindex on;
try_files $uri $uri/ /index.php?q=$uri&$args; try_files $uri $uri/ /index.php;
} }
} }

0
init.php → php/init.php

0
move.php → php/move.php

0
remove.php → php/remove.php

0
test.php → php/test.php

0
touch.php → php/touch.php

20
setup/install-mysql.sh

@ -0,0 +1,20 @@
#!/bin/bash
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
}
# Update The APT Cache
sudo apt-get update || OwnError "Unable To Update APT Cache :("
# Install MySQL
sudo apt-get -y install mysql-server mysqltuner || OwnError "Unable To Install MySQL :("

28
setup/install-nginx.sh

@ -0,0 +1,28 @@
#!/bin/bash
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
}
# Install Python Software Properties
sudo apt-get -y install python-software-properties || OwnError "Unable To Install Python Software Properties :("
# Add Nginx Launchpad Repository
sudo add-apt-repository ppa:nginx/stable || OwnError "Unable To Add Nginx Launchpad Repository :("
# Update The APT Cache
sudo apt-get update || OwnError "Unable To Update APT Cache :("
# Install Nginx
sudo apt-get -y install nginx || OwnError "Unable To Install Nginx :("
# Check Nginx Version
nginx -v || OwnError "Unable To Detect Nginx Version :("

29
setup/install-php5.sh

@ -0,0 +1,29 @@
#!/bin/bash
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
}
# Install Python Software Properties
sudo apt-get -y install python-software-properties || OwnError "Unable To Install Python Software Properties :("
# Add Nginx Launchpad Repository
sudo add-apt-repository ppa:ondrej/php5 || OwnError "Unable To Add PHP5 Launchpad Repository :("
# Update The APT Cache
sudo apt-get update || OwnError "Unable To Update APT Cache :("
# Install PHP5
sudo apt-get -y install php5-common php5-mysql php5-xmlrpc php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear php5-dev php5-imap php5-mcrypt || OwnError "Unable To Install PHP5 :("
# Check PHP5 Version
php -v || OwnError "Unable To Detect PHP Version :("

20
setup/install-postfix.sh

@ -0,0 +1,20 @@
#!/bin/bash
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
}
# Update The APT Cache
sudo apt-get update || OwnError "Unable To Update APT Cache :("
# Install Postfix
sudo apt-get -y install postfix || OwnError "Unable To Install Postfix :("

65
setup/pre-checks.sh

@ -0,0 +1,65 @@
#!/bin/bash
# Capture Errors
OwnError()
{
#echo $@ >&2
clear
echo -e "[ $0 ][ `date` ] \033[31m $@ \e[0m" | tee -ai /var/log/easyengine/error.log
exit 100
}
# Checking Permissions
Permission=$(id -u)
if [ $Permission -ne 0 ]
then
echo -e "\033[31m Root Privilege Required... \e[0m"
echo -e "\033[31m Uses: sudo $0 \e[0m"
exit 100
fi
# Checking Logs Directory
if [ ! -d /var/log/easyengine ]
then
mkdir -p /var/log/easyengine || OwnError "Unable To Create Log Directory /var/log/easyengine :("
#else
#echo -e "\033[34m Easy Engine Log Directory Found \e[0m"
#exit
fi
# Checking Tee
if [ ! -x /usr/bin/tee ]
then
echo -e "\033[31m Tee Command Not Found !! \e[0m"
echo -e "\033[34m Installing Tee \e[0m"
sudo apt-get -y install coreutils || OwnError "Unable To Install Tee :("
fi
# Checking Wget
if [ ! -x /usr/bin/wget ]
then
echo -e "\033[31m Wget Command Not Found !! \e[0m"
echo -e "\033[34m Installing Wget \e[0m"
sudo apt-get -y install wget || OwnError "Unable To Install Wget :("
fi
# Checking Tar
if [ ! -x /bin/tar ]
then
echo -e "\033[31m Tar Command Not Found !! \e[0m"
echo -e "\033[34m Installing Tar \e[0m"
sudo apt-get -y install tar || OwnError "Unable To Install Tar :("
fi
# Checking Name Servers
if [[ -z $(cat /etc/resolv.conf | grep -v ^#) ]]
then
echo -e "\033[31m No Nameservers Detected !! \e[0m"
echo -e "\033[31m Please configure /etc/resolv.conf \e[0m"
exit 100
fi
Loading…
Cancel
Save