Browse Source

Add Aapche2.4 MPM and mode

lj2007331@gmail.com 6 years ago
parent
commit
cec2a22145

+ 1 - 1
README.md

@@ -18,7 +18,7 @@ Script properties:
 - Jemalloc optimize MySQL, Nginx
 - Providing add a virtual host script, include Let's Encrypt SSL certificate
 - Provide Nginx/Tengine/OpenResty/Apache/Tomcat, MySQL/MariaDB/Percona, PHP, Redis, Memcached, phpMyAdmin upgrade script
-- Provide local backup,remote backup(rsync between servers),Aliyun OSS,Qcloud COS,UPYUN,QINIU,Amazon S3,Google Drive and Dropbox script
+- Provide local,remote(rsync between servers),Aliyun OSS,Qcloud COS,UPYUN,QINIU,Amazon S3,Google Drive and Dropbox backup script
 - Provided under HHVM install CentOS 6,7
 
 ## How to use

+ 3 - 3
config/index.html

@@ -175,7 +175,7 @@
 			              <li>Alibabacloud</li>
 			              <li>DNSPOD</li>
 			            </ul>
-			            <a href="https://www.alibabacloud.com/help/faq-detail/35854.htm" target="_blank" type="button" class="btn btn-lg btn-block btn-primary">BROWSE DOCS</a>
+			            <a href="https://www.alibabacloud.com/help/faq-detail/35854.htm" target="_blank" type="role" class="btn btn-lg btn-block btn-primary">BROWSE DOCS</a>
 			          </div>
 			        </div>
 			        <div class="card mb-4 box-shadow">
@@ -189,7 +189,7 @@
 			              <li>Del virtual host: ./vhost.sh --del</li>
 			              <li>Manage FTP account: ./pureftpd_vhost.sh</li>
 			            </ul>
-			            <a href="https://lempstack.com/install/" target="_blank" type="button" class="btn btn-lg btn-block btn-primary">BROWSE DOCS</a>
+			            <a href="https://lempstack.com/install/" target="_blank" type="role" class="btn btn-lg btn-block btn-primary">BROWSE DOCS</a>
 			          </div>
 			        </div>
 			        <div class="card mb-4 box-shadow">
@@ -203,7 +203,7 @@
 			              <li>Manage FTP account: ./pureftpd_vhost.sh</li>
 			              <li>Backup: ./backup_setup.sh</li>
 			            </ul>
-			            <a href="https://lempstack.com/install/" target="_blank" type="button" class="btn btn-lg btn-block btn-primary">BROWSE DOCS</a>
+			            <a href="https://lempstack.com/install/" target="_blank" type="role" class="btn btn-lg btn-block btn-primary">BROWSE DOCS</a>
 			          </div>
 			        </div>
 			      </div>

+ 3 - 3
config/index_cn.html

@@ -175,7 +175,7 @@
 			              <li>DNSPOD</li>
 			              <li>Cloudflare</li>
 			            </ul>
-			            <a href="https://help.aliyun.com/document_detail/29716.html" target="_blank" type="button" class="btn btn-lg btn-block btn-primary">详细教程</a>
+			            <a href="https://help.aliyun.com/document_detail/29716.html" target="_blank" type="role" class="btn btn-lg btn-block btn-primary">详细教程</a>
 			          </div>
 			        </div>
 			        <div class="card mb-4 box-shadow">
@@ -189,7 +189,7 @@
 			              <li>删除虚拟主机 ./vhost.sh --del</li>
 			              <li>管理FTP账号 ./pureftpd_vhost.sh</li>
 			            </ul>
-			            <a href="https://oneinstack.com/install/" target="_blank" type="button" class="btn btn-lg btn-block btn-primary">详细教程</a>
+			            <a href="https://oneinstack.com/install/" target="_blank" type="role" class="btn btn-lg btn-block btn-primary">详细教程</a>
 			          </div>
 			        </div>
 			        <div class="card mb-4 box-shadow">
@@ -203,7 +203,7 @@
 			              <li>管理FTP账号 ./pureftpd_vhost.sh</li>
 			              <li>备份 ./backup_setup.sh</li>
 			            </ul>
-			            <a href="https://oneinstack.com/install/" target="_blank" type="button" class="btn btn-lg btn-block btn-primary">详细教程</a>
+			            <a href="https://oneinstack.com/install/" target="_blank" type="role" class="btn btn-lg btn-block btn-primary">详细教程</a>
 			          </div>
 			        </div>
 			      </div>

+ 19 - 13
include/apache-2.4.sh

@@ -57,7 +57,7 @@ Install_Apache24() {
   if [ -e /bin/systemctl ]; then
     /bin/cp ../init.d/httpd.service /lib/systemd/system/
     sed -i "s@/usr/local/apache@${apache_install_dir}@g" /lib/systemd/system/httpd.service
-    systemctl enable httpd 
+    systemctl enable httpd
   else
     /bin/cp ${apache_install_dir}/bin/apachectl /etc/init.d/httpd
     sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
@@ -79,19 +79,26 @@ Install_Apache24() {
   fi
   sed -i "s@AddType\(.*\)Z@AddType\1Z\n    AddType application/x-httpd-php .php .phtml\n    AddType application/x-httpd-php-source .phps@" ${apache_install_dir}/conf/httpd.conf
   sed -i "s@#AddHandler cgi-script .cgi@AddHandler cgi-script .cgi .pl@" ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_proxy.so)@\1@' ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_proxy_fcgi.so)@\1@' ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_suexec.so)@\1@' ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_vhost_alias.so)@\1@' ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_rewrite.so)@\1@' ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_deflate.so)@\1@' ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_expires.so)@\1@' ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_ssl.so)@\1@' ${apache_install_dir}/conf/httpd.conf
-  sed -ri 's@^#(.*mod_http2.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_proxy.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_proxy_fcgi.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_suexec.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_vhost_alias.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_rewrite.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_deflate.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_expires.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_ssl.so)@\1@' ${apache_install_dir}/conf/httpd.conf
+  sed -ri 's@^#(LoadModule.*mod_http2.so)@\1@' ${apache_install_dir}/conf/httpd.conf
   sed -i 's@DirectoryIndex index.html@DirectoryIndex index.html index.php@' ${apache_install_dir}/conf/httpd.conf
   sed -i "s@^DocumentRoot.*@DocumentRoot \"${wwwroot_dir}/default\"@" ${apache_install_dir}/conf/httpd.conf
   sed -i "s@^<Directory \"${apache_install_dir}/htdocs\">@<Directory \"${wwwroot_dir}/default\">@" ${apache_install_dir}/conf/httpd.conf
   sed -i "s@^#Include conf/extra/httpd-mpm.conf@Include conf/extra/httpd-mpm.conf@" ${apache_install_dir}/conf/httpd.conf
+  if [ "${apache_mpm_option}" == '2' ]; then 
+    sed -ri 's@^(LoadModule.*mod_mpm_event.so)@#\1@' ${apache_install_dir}/conf/httpd.conf
+    sed -i 's@^#LoadModule mpm_prefork_module@LoadModule mpm_prefork_module@' ${apache_install_dir}/conf/httpd.conf
+  elif [ "${apache_mpm_option}" == '3' ]; then 
+    sed -ri 's@^(LoadModule.*mod_mpm_event.so)@#\1@' ${apache_install_dir}/conf/httpd.conf
+    sed -i 's@^#LoadModule mpm_worker_module@LoadModule mpm_worker_module@' ${apache_install_dir}/conf/httpd.conf
+  fi
 
   #logrotate apache log
   cat > /etc/logrotate.d/apache << EOF
@@ -110,6 +117,7 @@ ${wwwlogs_dir}/*apache.log {
 EOF
 
   mkdir ${apache_install_dir}/conf/vhost
+  [ "${apache_mode_option}" != '2' ] && Apache_fcgi=$(echo -e "<Files ~ (\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md)\$>\n    Order allow,deny\n    Deny from all\n  </Files>\n  <FilesMatch \\.php\$>\n    SetHandler \"proxy:unix:/dev/shm/php-cgi.sock|fcgi://localhost\"\n  </FilesMatch>")
   cat > ${apache_install_dir}/conf/vhost/0.conf << EOF
 <VirtualHost *:$TMP_PORT>
   ServerAdmin admin@example.com
@@ -121,9 +129,7 @@ EOF
     Order allow,deny
     Deny from all
   </Files>
-  <FilesMatch \.php$>
-    SetHandler "proxy:unix:/dev/shm/php-cgi.sock|fcgi://localhost"
-  </FilesMatch>
+  ${Apache_fcgi}
 <Directory "${wwwroot_dir}/default">
   SetOutputFilter DEFLATE
   Options FollowSymLinks ExecCGI

+ 3 - 3
include/php-5.3.sh

@@ -91,7 +91,7 @@ Install_PHP53() {
   patch -p1 < ../debian_patches_disable_SSLv2_for_openssl_1_0_0.patch
   make clean
   [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
-  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
     --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
     --with-apxs2=${apache_install_dir}/bin/apxs --disable-fileinfo \
@@ -149,7 +149,7 @@ Install_PHP53() {
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
 
-  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ]; then
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
     if [ -e /bin/systemctl ]; then
       /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
@@ -247,7 +247,7 @@ EOF
 
     service php-fpm start
 
-  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" != '2' ]; then 
     service httpd restart
   fi
   popd > /dev/null

+ 3 - 3
include/php-5.4.sh

@@ -87,7 +87,7 @@ Install_PHP54() {
   pushd php-${php54_ver} > /dev/null
   make clean
   [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
-  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
     --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
     --with-apxs2=${apache_install_dir}/bin/apxs --disable-fileinfo \
@@ -144,7 +144,7 @@ Install_PHP54() {
   sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen@' ${php_install_dir}/etc/php.ini
   [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' ${php_install_dir}/etc/php.ini
 
-  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ]; then
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
     if [ -e /bin/systemctl ]; then
       /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
@@ -242,7 +242,7 @@ EOF
 
     service php-fpm start
 
-  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     service httpd restart
   fi
   popd > /dev/null

+ 3 - 3
include/php-5.5.sh

@@ -86,7 +86,7 @@ Install_PHP55() {
   pushd php-${php55_ver} > /dev/null
   [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
   [ "${phpcache_option}" == '1' ] && phpcache_arg='--enable-opcache' || phpcache_arg='--disable-opcache'
-  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
     --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
     --with-apxs2=${apache_install_dir}/bin/apxs ${phpcache_arg} --disable-fileinfo \
@@ -157,7 +157,7 @@ opcache.enable_cli=1
 ;opcache.optimization_level=0
 EOF
 
-  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ]; then
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
     if [ -e /bin/systemctl ]; then
       /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
@@ -255,7 +255,7 @@ EOF
 
     service php-fpm start
 
-  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     service httpd restart
   fi
   popd > /dev/null

+ 3 - 3
include/php-5.6.sh

@@ -87,7 +87,7 @@ Install_PHP56() {
   make clean
   [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
   [ "${phpcache_option}" == '1' ] && phpcache_arg='--enable-opcache' || phpcache_arg='--disable-opcache'
-  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
     --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
     --with-apxs2=${apache_install_dir}/bin/apxs ${phpcache_arg} --disable-fileinfo \
@@ -160,7 +160,7 @@ opcache.enable_cli=1
 ;opcache.optimization_level=0
 EOF
 
-  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ]; then
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
     if [ -e /bin/systemctl ]; then
       /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
@@ -258,7 +258,7 @@ EOF
 
     service php-fpm start
 
-  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     service httpd restart
   fi
   popd > /dev/null

+ 3 - 3
include/php-7.0.sh

@@ -88,7 +88,7 @@ Install_PHP70() {
   ./buildconf
   [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
   [ "${phpcache_option}" == '1' ] && phpcache_arg='--enable-opcache' || phpcache_arg='--disable-opcache'
-  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
     --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
     --with-apxs2=${apache_install_dir}/bin/apxs ${phpcache_arg} --disable-fileinfo \
@@ -166,7 +166,7 @@ opcache.consistency_checks=0
 ;opcache.optimization_level=0
 EOF
 
-  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ]; then
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
     if [ -e /bin/systemctl ]; then
       /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
@@ -264,7 +264,7 @@ EOF
 
     service php-fpm start
 
-  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     service httpd restart
   fi
   popd > /dev/null

+ 3 - 3
include/php-7.1.sh

@@ -88,7 +88,7 @@ Install_PHP71() {
   ./buildconf
   [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
   [ "${phpcache_option}" == '1' ] && phpcache_arg='--enable-opcache' || phpcache_arg='--disable-opcache'
-  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
     --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
     --with-apxs2=${apache_install_dir}/bin/apxs ${phpcache_arg} --disable-fileinfo \
@@ -166,7 +166,7 @@ opcache.consistency_checks=0
 ;opcache.optimization_level=0
 EOF
 
-  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ]; then
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
     if [ -e /bin/systemctl ]; then
       /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
@@ -264,7 +264,7 @@ EOF
 
     service php-fpm start
 
-  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     service httpd restart
   fi
   popd > /dev/null

+ 3 - 3
include/php-7.2.sh

@@ -82,7 +82,7 @@ Install_PHP72() {
   ./buildconf
   [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
   [ "${phpcache_option}" == '1' ] && phpcache_arg='--enable-opcache' || phpcache_arg='--disable-opcache'
-  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
     --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
     --with-apxs2=${apache_install_dir}/bin/apxs ${phpcache_arg} --disable-fileinfo \
@@ -159,7 +159,7 @@ opcache.consistency_checks=0
 ;opcache.optimization_level=0
 EOF
 
-  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ]; then
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
     if [ -e /bin/systemctl ]; then
       /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
@@ -257,7 +257,7 @@ EOF
 
     service php-fpm start
 
-  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     service httpd restart
   fi
   popd > /dev/null

+ 3 - 3
include/php-7.3.sh

@@ -82,7 +82,7 @@ Install_PHP73() {
   ./buildconf
   [ ! -d "${php_install_dir}" ] && mkdir -p ${php_install_dir}
   [ "${phpcache_option}" == '1' ] && phpcache_arg='--enable-opcache' || phpcache_arg='--disable-opcache'
-  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  if [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     ./configure --prefix=${php_install_dir} --with-config-file-path=${php_install_dir}/etc \
     --with-config-file-scan-dir=${php_install_dir}/etc/php.d \
     --with-apxs2=${apache_install_dir}/bin/apxs ${phpcache_arg} --disable-fileinfo \
@@ -159,7 +159,7 @@ opcache.consistency_checks=0
 ;opcache.optimization_level=0
 EOF
 
-  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ]; then
+  if [ ! -e "${apache_install_dir}/bin/apxs" -o "${Apache_main_ver}" == '24' ] && [ "${apache_mode_option}" != '2' ]; then
     # php-fpm Init Script
     if [ -e /bin/systemctl ]; then
       /bin/cp ${oneinstack_dir}/init.d/php-fpm.service /lib/systemd/system/
@@ -257,7 +257,7 @@ EOF
 
     service php-fpm start
 
-  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ]; then
+  elif [ "${apache_option}" == '2' ] || [ "${Apache_main_ver}" == '22' ] || [ "${apache_mode_option}" == '2' ]; then
     service httpd restart
   fi
   popd > /dev/null

+ 1 - 3
include/python.sh

@@ -92,9 +92,7 @@ EOF
 
 Uninstall_Python() {
   if [ -e "${python_install_dir}/bin/python" ]; then
-    echo; echo "${CMSG}Python uninstall completed${CEND}"
+    echo "${CMSG}Python uninstall completed${CEND}"
     rm -rf ${python_install_dir}
-  else
-    echo; echo "${CWARNING}Python does not exist! ${CEND}"
   fi
 }

+ 40 - 2
install.sh

@@ -37,7 +37,7 @@ dbinstallmethod=1
 
 version() {
   echo "version: 2.0"
-  echo "updated date: 2019-01-04"
+  echo "updated date: 2019-01-17"
 }
 
 Show_Help() {
@@ -47,6 +47,8 @@ Show_Help() {
   --version, -v               Show version info
   --nginx_option [1-3]        Install Nginx server version
   --apache_option [1-2]       Install Apache server version
+  --apache_mode_option [1-2]  Apache2.4 mode, 1(default): php-fpm, 2: mod_php
+  --apache_mpm_option [1-3]   Apache2.4 MPM, 1(default): event, 2: prefork, 3: worker 
   --php_option [1-8]          Install PHP version
   --php_vn [53~73]            Install another version of php in OneinStack
   --phpcache_option [1-4]     Install PHP opcode cache, default: 1 opcache
@@ -70,7 +72,7 @@ Show_Help() {
   "
 }
 ARG_NUM=$#
-TEMP=`getopt -o hvV --long help,version,nginx_option:,apache_option:,php_option:,php_vn:,phpcache_option:,php_extensions:,tomcat_option:,jdk_option:,db_option:,dbrootpwd:,dbinstallmethod:,pureftpd,redis,memcached,phpmyadmin,hhvm,python,ssh_port:,iptables,reboot -- "$@" 2>/dev/null`
+TEMP=`getopt -o hvV --long help,version,nginx_option:,apache_option:,apache_mode_option:,apache_mpm_option:,php_option:,php_vn:,phpcache_option:,php_extensions:,tomcat_option:,jdk_option:,db_option:,dbrootpwd:,dbinstallmethod:,pureftpd,redis,memcached,phpmyadmin,hhvm,python,ssh_port:,iptables,reboot -- "$@" 2>/dev/null`
 [ $? != 0 ] && echo "${CWARNING}ERROR: unknown argument! ${CEND}" && Show_Help && exit 1
 eval set -- "${TEMP}"
 while :; do
@@ -94,6 +96,14 @@ while :; do
       [[ ! ${apache_option} =~ ^[1-2]$ ]] && { echo "${CWARNING}apache_option input error! Please only input number 1~2${CEND}"; exit 1; }
       [ -e "${apache_install_dir}/bin/httpd" ] && { echo "${CWARNING}Aapche already installed! ${CEND}"; unset apache_option; }
       ;;
+    --apache_mode_option)
+      apache_mode_option=$2; shift 2
+      [[ ! ${apache_mode_option} =~ ^[1-2]$ ]] && { echo "${CWARNING}apache_mode_option input error! Please only input number 1~2${CEND}"; exit 1; }
+      ;;
+    --apache_mpm_option)
+      apache_mpm_option=$2; shift 2
+      [[ ! ${apache_mpm_option} =~ ^[1-3]$ ]] && { echo "${CWARNING}apache_mpm_option input error! Please only input number 1~3${CEND}"; exit 1; }
+      ;;
     --php_option)
       php_option=$2; shift 2
       [[ ! ${php_option} =~ ^[1-8]$ ]] && { echo "${CWARNING}php_option input error! Please only input number 1~8${CEND}"; exit 1; }
@@ -274,6 +284,34 @@ if [ ${ARG_NUM} == 0 ]; then
             break
           fi
         done
+        # Apache2.4 mode and Apache2.4 MPM
+        if [ "${apache_option}" == '1' ]; then
+          while :; do echo
+            echo 'Please select Apache2.4 mode:'
+            echo -e "\t${CMSG}1${CEND}. php-fpm"
+            echo -e "\t${CMSG}2${CEND}. mod_php"
+            read -e -p "Please input a number:(Default 1 press Enter) " apache_mode_option
+            apache_mode_option=${apache_mode_option:-1}
+            if [[ ! ${apache_mode_option} =~ ^[1-2]$ ]]; then
+              echo "${CWARNING}input error! Please only input number 1~2${CEND}"
+            else
+              break
+            fi
+          done
+          while :; do echo
+            echo 'Please select Apache2.4 MPM:'
+            echo -e "\t${CMSG}1${CEND}. event"
+            echo -e "\t${CMSG}2${CEND}. prefork"
+            echo -e "\t${CMSG}3${CEND}. worker"
+            read -e -p "Please input a number:(Default 1 press Enter) " apache_mpm_option
+            apache_mpm_option=${apache_mpm_option:-1}
+            if [[ ! ${apache_mpm_option} =~ ^[1-3]$ ]]; then
+              echo "${CWARNING}input error! Please only input number 1~3${CEND}"
+            else
+              break
+            fi
+          done
+        fi
         # Tomcat
         while :; do echo
           echo 'Please select tomcat server:'

+ 1 - 0
uninstall.sh

@@ -270,6 +270,7 @@ Print_PHP() {
 Uninstall_PHP() {
   [ -e "/etc/init.d/php-fpm" ] && { service php-fpm stop > /dev/null 2>&1; rm -f /etc/init.d/php-fpm; }
   [ -e "/lib/systemd/system/php-fpm.service" ] && { systemctl stop php-fpm > /dev/null 2>&1; systemctl disable php-fpm > /dev/null 2>&1; rm -f /lib/systemd/system/php-fpm.service; }
+  [ -e "${apache_install_dir}/conf/httpd.conf" ] && [ -n "`grep libphp ${apache_install_dir}/conf/httpd.conf`" ] && sed -i '/libphp/d' ${apache_install_dir}/conf/httpd.conf
   [ -e "${php_install_dir}" ] && { rm -rf ${php_install_dir}; echo "${CMSG}PHP uninstall completed! ${CEND}"; }
   [ -e "${imagick_install_dir}" ] && rm -rf ${imagick_install_dir}
   [ -e "${gmagick_install_dir}" ] && rm -rf ${gmagick_install_dir}

+ 2 - 2
versions.txt

@@ -41,8 +41,8 @@ pgsql_ver=11.1
 mongodb_ver=4.0.5
 
 # JDK
-jdk110_ver=11.0.1
-jdk18_ver=1.8.0_192
+jdk110_ver=11.0.2
+jdk18_ver=1.8.0_202
 jdk17_ver=1.7.0_80
 jdk16_ver=1.6.0_45
 

+ 2 - 2
vhost.sh

@@ -756,7 +756,7 @@ Apache_log() {
 
 Create_apache_conf() {
   if [ "${Apache_main_ver}" == '24' ]; then
-    if [ -e "/dev/shm/php-cgi.sock" ] && [ -n "`grep -E ^LoadModule.*mod_proxy_fcgi.so ${apache_install_dir}/conf/httpd.conf`" ]; then
+    if [ -e "${php_install_dir}/sbin/php-fpm" ] && [ -n "`grep -E ^LoadModule.*mod_proxy_fcgi.so ${apache_install_dir}/conf/httpd.conf`" ]; then
       Apache_fcgi=$(echo -e "<Files ~ (\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md)\$>\n    Order allow,deny\n    Deny from all\n  </Files>\n  <FilesMatch \\.php\$>\n    SetHandler \"proxy:unix:/dev/shm/php-cgi.sock|fcgi://localhost\"\n  </FilesMatch>")
     fi
   fi
@@ -877,7 +877,7 @@ EOF
 
   # Apache
   if [ "${Apache_main_ver}" == '24' ]; then
-    if [ -e "/dev/shm/php-cgi.sock" ] && [ -n "`grep -E ^LoadModule.*mod_proxy_fcgi.so ${apache_install_dir}/conf/httpd.conf`" ]; then
+    if [ -e "${php_install_dir}/sbin/php-fpm" ] && [ -n "`grep -E ^LoadModule.*mod_proxy_fcgi.so ${apache_install_dir}/conf/httpd.conf`" ]; then
       Apache_fcgi=$(echo -e "<Files ~ (\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md)\$>\n    Order allow,deny\n    Deny from all\n  </Files>\n  <FilesMatch \\.php\$>\n    SetHandler \"proxy:unix:/dev/shm/php-cgi.sock|fcgi://localhost\"\n  </FilesMatch>")
     fi
   fi