|
@@ -24,9 +24,9 @@ Install_Apache-2-4() {
|
|
|
[ ! -d "$apache_install_dir" ] && mkdir -p $apache_install_dir
|
|
|
/bin/cp -R ../apr-$apr_version ./srclib/apr
|
|
|
/bin/cp -R ../apr-util-$apr_util_version ./srclib/apr-util
|
|
|
- [ "$ZendGuardLoader_yn" == 'y' -o "$ionCube_yn" == 'y' ] && MPM=prefork || MPM=worker
|
|
|
- ./configure --prefix=$apache_install_dir --enable-headers --enable-deflate --enable-mime-magic --enable-so --enable-rewrite --enable-ssl --with-ssl --enable-expires --enable-static-support --enable-suexec --disable-userdir --with-included-apr --with-mpm=$MPM --disable-userdir
|
|
|
+ LDFLAGS=-ldl ./configure --prefix=$apache_install_dir --with-mpm=prefork --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
|
|
|
make -j ${THREAD} && make install
|
|
|
+ unset LDFLAGS
|
|
|
if [ -e "$apache_install_dir/conf/httpd.conf" ]; then
|
|
|
echo "${CSUCCESS}Apache installed successfully! ${CEND}"
|
|
|
popd
|
|
@@ -62,9 +62,12 @@ Install_Apache-2-4() {
|
|
|
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 -i 's@^#LoadModule rewrite_module@LoadModule rewrite_module@' $apache_install_dir/conf/httpd.conf
|
|
|
- sed -i 's@^#LoadModule\(.*\)mod_deflate.so@LoadModule\1mod_deflate.so@' $apache_install_dir/conf/httpd.conf
|
|
|
- sed -i 's@^#LoadModule\(.*\)mod_ssl.so@LoadModule\1mod_ssl.so@' $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 -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
|
|
@@ -73,54 +76,54 @@ Install_Apache-2-4() {
|
|
|
#logrotate apache log
|
|
|
cat > /etc/logrotate.d/apache << EOF
|
|
|
$wwwlogs_dir/*apache.log {
|
|
|
-daily
|
|
|
-rotate 5
|
|
|
-missingok
|
|
|
-dateext
|
|
|
-compress
|
|
|
-notifempty
|
|
|
-sharedscripts
|
|
|
-postrotate
|
|
|
-[ -f $apache_install_dir/logs/httpd.pid ] && kill -USR1 \`cat $apache_install_dir/logs/httpd.pid\`
|
|
|
-endscript
|
|
|
+ daily
|
|
|
+ rotate 5
|
|
|
+ missingok
|
|
|
+ dateext
|
|
|
+ compress
|
|
|
+ notifempty
|
|
|
+ sharedscripts
|
|
|
+ postrotate
|
|
|
+ [ -f $apache_install_dir/logs/httpd.pid ] && kill -USR1 \`cat $apache_install_dir/logs/httpd.pid\`
|
|
|
+ endscript
|
|
|
}
|
|
|
EOF
|
|
|
|
|
|
mkdir $apache_install_dir/conf/vhost
|
|
|
cat >> $apache_install_dir/conf/vhost/0.conf << EOF
|
|
|
<VirtualHost *:$TMP_PORT>
|
|
|
- ServerAdmin admin@linuxeye.com
|
|
|
- DocumentRoot "$wwwroot_dir/default"
|
|
|
- ServerName $TMP_IP
|
|
|
- ErrorLog "$wwwlogs_dir/error_apache.log"
|
|
|
- CustomLog "$wwwlogs_dir/access_apache.log" common
|
|
|
+ ServerAdmin admin@linuxeye.com
|
|
|
+ DocumentRoot "$wwwroot_dir/default"
|
|
|
+ ServerName $TMP_IP
|
|
|
+ ErrorLog "$wwwlogs_dir/error_apache.log"
|
|
|
+ CustomLog "$wwwlogs_dir/access_apache.log" common
|
|
|
<Directory "$wwwroot_dir/default">
|
|
|
- SetOutputFilter DEFLATE
|
|
|
- Options FollowSymLinks ExecCGI
|
|
|
- Require all granted
|
|
|
- AllowOverride All
|
|
|
- Order allow,deny
|
|
|
- Allow from all
|
|
|
- DirectoryIndex index.html index.php
|
|
|
+ SetOutputFilter DEFLATE
|
|
|
+ Options FollowSymLinks ExecCGI
|
|
|
+ Require all granted
|
|
|
+ AllowOverride All
|
|
|
+ Order allow,deny
|
|
|
+ Allow from all
|
|
|
+ DirectoryIndex index.html index.php
|
|
|
</Directory>
|
|
|
<Location /server-status>
|
|
|
- SetHandler server-status
|
|
|
- Order Deny,Allow
|
|
|
- Deny from all
|
|
|
- Allow from 127.0.0.1
|
|
|
+ SetHandler server-status
|
|
|
+ Order Deny,Allow
|
|
|
+ Deny from all
|
|
|
+ Allow from 127.0.0.1
|
|
|
</Location>
|
|
|
</VirtualHost>
|
|
|
EOF
|
|
|
|
|
|
cat >> $apache_install_dir/conf/httpd.conf <<EOF
|
|
|
<IfModule mod_headers.c>
|
|
|
- AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml text/javascript
|
|
|
- <FilesMatch "\.(js|css|html|htm|png|jpg|swf|pdf|shtml|xml|flv|gif|ico|jpeg)\$">
|
|
|
- RequestHeader edit "If-None-Match" "^(.*)-gzip(.*)\$" "\$1\$2"
|
|
|
- Header edit "ETag" "^(.*)-gzip(.*)\$" "\$1\$2"
|
|
|
- </FilesMatch>
|
|
|
- DeflateCompressionLevel 6
|
|
|
- SetOutputFilter DEFLATE
|
|
|
+ AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml text/javascript
|
|
|
+ <FilesMatch "\.(js|css|html|htm|png|jpg|swf|pdf|shtml|xml|flv|gif|ico|jpeg)\$">
|
|
|
+ RequestHeader edit "If-None-Match" "^(.*)-gzip(.*)\$" "\$1\$2"
|
|
|
+ Header edit "ETag" "^(.*)-gzip(.*)\$" "\$1\$2"
|
|
|
+ </FilesMatch>
|
|
|
+ DeflateCompressionLevel 6
|
|
|
+ SetOutputFilter DEFLATE
|
|
|
</IfModule>
|
|
|
|
|
|
ServerTokens ProductOnly
|