Browse Source

Merge branch 'next' of github.com:rtCamp/easyengine into next

old-stable
gau1991 10 years ago
parent
commit
d56657af1c
  1. 37
      src/lib/ee_lib_mysql_info.sh
  2. 41
      src/lib/ee_lib_nginx_info.sh
  3. 92
      src/lib/ee_lib_php_info.sh
  4. 5
      src/modules/stack/install/ee_mod_setup_mysql.sh

37
src/lib/ee_lib_mysql_info.sh

@ -2,21 +2,26 @@
function ee_lib_mysql_info()
{
local ee_mysql_version=$(mysql -V | awk '{print($5)}' | cut -d ',' -f1)
local ee_mysql_port=$(mysql -e "show variables" | grep ^port | awk '{print($2)}')
local ee_mysql_socket=$(mysql -e "show variables" | grep "^socket" | awk '{print($2)}')
local ee_mysql_data_dir=$(mysql -e "show variables" | grep datadir | awk '{print($2)}')
local ee_mysql_wait_timeout=$(mysql -e "show variables" | grep ^wait_timeout | awk '{print($2)}')
local ee_mysql_interactive_timeout=$(mysql -e "show variables" | grep ^interactive_timeout | awk '{print($2)}')
local ee_mysql_max_connections=$(mysql -e "show variables" | grep "^max_connections" | awk '{print($2)}')
local ee_mysql_max_used_connections=$(mysql -e "show global status" | grep Max_used_connections | awk '{print($2)}')
mysqladmin ping &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then
local ee_mysql_version=$(mysql -V | awk '{print($5)}' | cut -d ',' -f1)
local ee_mysql_port=$(mysql -e "show variables" | grep ^port | awk '{print($2)}')
local ee_mysql_socket=$(mysql -e "show variables" | grep "^socket" | awk '{print($2)}')
local ee_mysql_data_dir=$(mysql -e "show variables" | grep datadir | awk '{print($2)}')
local ee_mysql_wait_timeout=$(mysql -e "show variables" | grep ^wait_timeout | awk '{print($2)}')
local ee_mysql_interactive_timeout=$(mysql -e "show variables" | grep ^interactive_timeout | awk '{print($2)}')
local ee_mysql_max_connections=$(mysql -e "show variables" | grep "^max_connections" | awk '{print($2)}')
local ee_mysql_max_used_connections=$(mysql -e "show global status" | grep Max_used_connections | awk '{print($2)}')
ee_lib_echo
ee_lib_echo "MySQL ($ee_mysql_version) on $EE_MYSQL_HOST:"
ee_lib_echo_escape "port\t\t\t\t \033[37m$ee_mysql_port"
ee_lib_echo_escape "wait_timeout\t\t\t \033[37m$ee_mysql_wait_timeout"
ee_lib_echo_escape "interactive_timeout\t\t \033[37m$ee_mysql_interactive_timeout"
ee_lib_echo_escape "max_used_connections\t\t \033[37m$ee_mysql_max_used_connections/$ee_mysql_max_connections"
ee_lib_echo_escape "datadir\t\t\t\t \033[37m$ee_mysql_data_dir"
ee_lib_echo_escape "socket\t\t\t\t \033[37m$ee_mysql_socket"
ee_lib_echo
ee_lib_echo "MySQL ($ee_mysql_version) on $EE_MYSQL_HOST:"
ee_lib_echo_escape "port\t\t\t\t \033[37m$ee_mysql_port"
ee_lib_echo_escape "wait_timeout\t\t\t \033[37m$ee_mysql_wait_timeout"
ee_lib_echo_escape "interactive_timeout\t\t \033[37m$ee_mysql_interactive_timeout"
ee_lib_echo_escape "max_used_connections\t\t \033[37m$ee_mysql_max_used_connections/$ee_mysql_max_connections"
ee_lib_echo_escape "datadir\t\t\t\t \033[37m$ee_mysql_data_dir"
ee_lib_echo_escape "socket\t\t\t\t \033[37m$ee_mysql_socket"
else
ee_lib_echo "MYSQL not installed"
fi
}

41
src/lib/ee_lib_nginx_info.sh

@ -2,23 +2,28 @@
function ee_lib_nginx_info()
{
local ee_nginx_version=$(nginx -v 2>&1 | cut -d':' -f2 | cut -d' ' -f2 | cut -d'/' -f2)
local ee_nginx_user=$(grep ^user /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_nginx_processes=$(grep worker_processes /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_nginx_connections=$(grep worker_connections /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_nginx_keep_alive=$(grep keepalive_timeout /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_fastcgi_timeout=$(grep fastcgi_read_timeout /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_clinet_max_body_size=$(grep client_max_body_size /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_nginx_allowed_ip_add=$(grep ^allow /etc/nginx/common/acl.conf | cut -d' ' -f2 | cut -d';' -f1 | tr '\n' ' ')
ee_lib_package_check $EE_NGINX_PACKAGE
if [ "$EE_PACKAGE_NAME" != "" ]; then
local ee_nginx_version=$(nginx -v 2>&1 | cut -d':' -f2 | cut -d' ' -f2 | cut -d'/' -f2)
local ee_nginx_user=$(grep ^user /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_nginx_processes=$(grep worker_processes /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_nginx_connections=$(grep worker_connections /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_nginx_keep_alive=$(grep keepalive_timeout /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_fastcgi_timeout=$(grep fastcgi_read_timeout /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_clinet_max_body_size=$(grep client_max_body_size /etc/nginx/nginx.conf | cut -d' ' -f2 | cut -d';' -f1)
local ee_nginx_allowed_ip_add=$(grep ^allow /etc/nginx/common/acl.conf | cut -d' ' -f2 | cut -d';' -f1 | tr '\n' ' ')
ee_lib_echo
ee_lib_echo
ee_lib_echo "NGINX ($ee_nginx_version):"
ee_lib_echo_escape "user\t\t\t\t \033[37m$ee_nginx_user"
ee_lib_echo_escape "worker_processes\t\t \033[37m$ee_nginx_processes"
ee_lib_echo_escape "worker_connections\t\t \033[37m$ee_nginx_connections"
ee_lib_echo_escape "keepalive_timeout\t\t \033[37m$ee_nginx_keep_alive"
ee_lib_echo_escape "fastcgi_read_timeout\t\t \033[37m$ee_fastcgi_timeout"
ee_lib_echo_escape "client_max_body_size\t\t \033[37m$ee_clinet_max_body_size"
ee_lib_echo_escape "allow\t\t\t\t \033[37m$ee_nginx_allowed_ip_add"
ee_lib_echo
ee_lib_echo
ee_lib_echo "NGINX ($ee_nginx_version):"
ee_lib_echo_escape "user\t\t\t\t \033[37m$ee_nginx_user"
ee_lib_echo_escape "worker_processes\t\t \033[37m$ee_nginx_processes"
ee_lib_echo_escape "worker_connections\t\t \033[37m$ee_nginx_connections"
ee_lib_echo_escape "keepalive_timeout\t\t \033[37m$ee_nginx_keep_alive"
ee_lib_echo_escape "fastcgi_read_timeout\t\t \033[37m$ee_fastcgi_timeout"
ee_lib_echo_escape "client_max_body_size\t\t \033[37m$ee_clinet_max_body_size"
ee_lib_echo_escape "allow\t\t\t\t \033[37m$ee_nginx_allowed_ip_add"
else
ee_lib_echo "NGINX not installed"
fi
}

92
src/lib/ee_lib_php_info.sh

@ -1,52 +1,56 @@
# PHP information
function ee_lib_php_info()
{
#Collect information from php.ini
local ee_php_version=$(php -v | head -n1 | cut -d' ' -f2 | cut -d'+' -f1)
local ee_php_memory=$(grep ^memory_limit /etc/php5/fpm/php.ini | awk '{print $3}')
local ee_php_expose=$(grep ^expose_php /etc/php5/fpm/php.ini | cut -d'=' -f2 | cut -d' ' -f2)
local ee_php_post_max_size=$(grep post_max_size /etc/php5/fpm/php.ini | cut -d'=' -f2 | cut -d' ' -f2)
local ee_php_upload_max_filesize=$(grep upload_max_filesize /etc/php5/fpm/php.ini | cut -d'=' -f2 | cut -d' ' -f2)
local ee_php_max_execution_time=$(grep max_execution_time /etc/php5/fpm/php.ini | cut -d'=' -f2 | cut -d' ' -f2)
ee_lib_package_check php5-fpm
if [ "$EE_PACKAGE_NAME" != "" ]; then
#Collect information from php.ini
local ee_php_version=$(php -v | head -n1 | cut -d' ' -f2 | cut -d'+' -f1)
local ee_php_memory=$(grep ^memory_limit /etc/php5/fpm/php.ini | awk '{print $3}')
local ee_php_expose=$(grep ^expose_php /etc/php5/fpm/php.ini | cut -d'=' -f2 | cut -d' ' -f2)
local ee_php_post_max_size=$(grep post_max_size /etc/php5/fpm/php.ini | cut -d'=' -f2 | cut -d' ' -f2)
local ee_php_upload_max_filesize=$(grep upload_max_filesize /etc/php5/fpm/php.ini | cut -d'=' -f2 | cut -d' ' -f2)
local ee_php_max_execution_time=$(grep max_execution_time /etc/php5/fpm/php.ini | cut -d'=' -f2 | cut -d' ' -f2)
ee_lib_echo
ee_lib_echo "PHP ($ee_php_version):"
ee_lib_echo_escape "user\t\t\t\t \033[37m$EE_PHP_USER"
ee_lib_echo_escape "expose_php\t\t\t \033[37m$ee_php_expose"
ee_lib_echo_escape "memory_limit\t\t\t \033[37m$ee_php_memory"
ee_lib_echo_escape "post_max_size\t\t\t \033[37m$ee_php_post_max_size"
ee_lib_echo_escape "upload_max_filesize\t\t \033[37m$ee_php_upload_max_filesize"
ee_lib_echo_escape "max_execution_time\t\t \033[37m$ee_php_max_execution_time"
#Collect information from $ee_php_pool and debug.conf
for ee_php_pool in www.conf debug.conf;do
local ee_php_ping_path=$(grep ^ping.path /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_status_path=$(grep ^pm.status_path /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_process_manager=$(grep "^pm =" /etc/php5/fpm/pool.d/$ee_php_pool | awk '{print $3}')
local ee_php_max_requests=$(grep ^pm.max_requests /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_max_children=$(grep ^pm.max_children /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_start_servers=$(grep ^pm.start_servers /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_min_spare_servers=$(grep ^pm.min_spare_servers /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_max_spare_servers=$(grep ^pm.max_spare_servers /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_request_terminate_timeout=$(grep ^request_terminate_timeout /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_xdebug_check=$( grep "php_admin_flag\[xdebug.profiler_enable_trigger\]" /etc/php5/fpm/pool.d/$ee_php_pool | grep on &> /dev/null && echo on || echo off)
local ee_php_listen=$(grep '^listen =' /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
ee_lib_echo
ee_lib_echo "Information about $ee_php_pool"
ee_lib_echo_escape "ping.path\t\t\t \033[37m$ee_php_ping_path"
ee_lib_echo_escape "pm.status_path\t\t\t \033[37m$ee_php_status_path"
ee_lib_echo_escape "process_manager\t\t\t \033[37m$ee_php_process_manager"
ee_lib_echo_escape "pm.max_requests\t\t\t \033[37m$ee_php_max_requests"
ee_lib_echo_escape "pm.max_children\t\t\t \033[37m$ee_php_max_children"
ee_lib_echo_escape "pm.start_servers\t\t \033[37m$ee_php_start_servers"
ee_lib_echo_escape "pm.min_spare_servers\t\t \033[37m$ee_php_min_spare_servers"
ee_lib_echo_escape "pm.max_spare_servers\t\t \033[37m$ee_php_max_spare_servers"
ee_lib_echo_escape "request_terminate_timeout\t \033[37m$ee_php_request_terminate_timeout"
ee_lib_echo_escape "xdebug.profiler_enable_trigger\t \033[37m$ee_xdebug_check"
ee_lib_echo_escape "listen\t\t\t\t \033[37m$ee_php_listen"
done
ee_lib_echo "PHP ($ee_php_version):"
ee_lib_echo_escape "user\t\t\t\t \033[37m$EE_PHP_USER"
ee_lib_echo_escape "expose_php\t\t\t \033[37m$ee_php_expose"
ee_lib_echo_escape "memory_limit\t\t\t \033[37m$ee_php_memory"
ee_lib_echo_escape "post_max_size\t\t\t \033[37m$ee_php_post_max_size"
ee_lib_echo_escape "upload_max_filesize\t\t \033[37m$ee_php_upload_max_filesize"
ee_lib_echo_escape "max_execution_time\t\t \033[37m$ee_php_max_execution_time"
#Collect information from $ee_php_pool and debug.conf
for ee_php_pool in www.conf debug.conf;do
local ee_php_ping_path=$(grep ^ping.path /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_status_path=$(grep ^pm.status_path /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_process_manager=$(grep "^pm =" /etc/php5/fpm/pool.d/$ee_php_pool | awk '{print $3}')
local ee_php_max_requests=$(grep ^pm.max_requests /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_max_children=$(grep ^pm.max_children /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_start_servers=$(grep ^pm.start_servers /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_min_spare_servers=$(grep ^pm.min_spare_servers /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_max_spare_servers=$(grep ^pm.max_spare_servers /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_php_request_terminate_timeout=$(grep ^request_terminate_timeout /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
local ee_xdebug_check=$( grep "php_admin_flag\[xdebug.profiler_enable_trigger\]" /etc/php5/fpm/pool.d/$ee_php_pool | grep on &> /dev/null && echo on || echo off)
local ee_php_listen=$(grep '^listen =' /etc/php5/fpm/pool.d/$ee_php_pool | cut -d'=' -f2| cut -d' ' -f2)
ee_lib_echo
ee_lib_echo "Information about $ee_php_pool"
ee_lib_echo_escape "ping.path\t\t\t \033[37m$ee_php_ping_path"
ee_lib_echo_escape "pm.status_path\t\t\t \033[37m$ee_php_status_path"
ee_lib_echo_escape "process_manager\t\t\t \033[37m$ee_php_process_manager"
ee_lib_echo_escape "pm.max_requests\t\t\t \033[37m$ee_php_max_requests"
ee_lib_echo_escape "pm.max_children\t\t\t \033[37m$ee_php_max_children"
ee_lib_echo_escape "pm.start_servers\t\t \033[37m$ee_php_start_servers"
ee_lib_echo_escape "pm.min_spare_servers\t\t \033[37m$ee_php_min_spare_servers"
ee_lib_echo_escape "pm.max_spare_servers\t\t \033[37m$ee_php_max_spare_servers"
ee_lib_echo_escape "request_terminate_timeout\t \033[37m$ee_php_request_terminate_timeout"
ee_lib_echo_escape "xdebug.profiler_enable_trigger\t \033[37m$ee_xdebug_check"
ee_lib_echo_escape "listen\t\t\t\t \033[37m$ee_php_listen"
done
else
ee_lib_echo "PHP not installed"
fi
}

5
src/modules/stack/install/ee_mod_setup_mysql.sh

@ -5,8 +5,7 @@ function ee_mod_setup_mysql()
ee_lib_echo "Setting up Percona MySQL, please wait..."
# Setting wait_timeout = 30 & interactive_timeout = 60
grep "_timeout" /etc/mysql/my.cnf &>> $EE_COMMAND_LOG
if [ $? -ne 0 ]; then
sed -i "/#max_connections/a wait_timeout = 30 \ninteractive_timeout = 60" /etc/mysql/my.cnf
if [ ! -f /etc/mysql/my.cnf ]; then
echo -e "[mysqld] \nwait_timeout = 30 \ninteractive_timeout = 60" &>> /etc/mysql/my.cnf
fi
}

Loading…
Cancel
Save