|
@@ -12,7 +12,7 @@ Install_Nginx() {
|
|
|
pushd ${oneinstack_dir}/src > /dev/null
|
|
|
id -u ${run_user} >/dev/null 2>&1
|
|
|
[ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
|
|
|
-
|
|
|
+
|
|
|
tar xzf pcre-$pcre_ver.tar.gz
|
|
|
tar xzf nginx-$nginx_ver.tar.gz
|
|
|
tar xzf openssl-$openssl_ver.tar.gz
|
|
@@ -21,15 +21,15 @@ Install_Nginx() {
|
|
|
#sed -i 's@#define NGINX_VERSION.*$@#define NGINX_VERSION "1.2"@' src/core/nginx.h
|
|
|
#sed -i 's@#define NGINX_VER.*NGINX_VERSION$@#define NGINX_VER "Linuxeye/" NGINX_VERSION@' src/core/nginx.h
|
|
|
#sed -i 's@Server: nginx@Server: linuxeye@' src/http/ngx_http_header_filter_module.c
|
|
|
-
|
|
|
+
|
|
|
# close debug
|
|
|
sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc
|
|
|
-
|
|
|
+
|
|
|
[ ! -d "$nginx_install_dir" ] && mkdir -p $nginx_install_dir
|
|
|
- ./configure --prefix=$nginx_install_dir --user=${run_user} --group=${run_user} --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_ver --with-pcre=../pcre-$pcre_ver --with-pcre-jit --with-ld-opt='-ljemalloc' $nginx_modules_options
|
|
|
+ ./configure --prefix=$nginx_install_dir --user=${run_user} --group=${run_user} --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_ver --with-pcre=../pcre-$pcre_ver --with-pcre-jit --with-ld-opt='-ljemalloc' $nginx_modules_options
|
|
|
make -j ${THREAD} && make install
|
|
|
if [ -e "$nginx_install_dir/conf/nginx.conf" ]; then
|
|
|
- popd
|
|
|
+ popd
|
|
|
rm -rf nginx-$nginx_ver
|
|
|
echo "${CSUCCESS}Nginx installed successfully! ${CEND}"
|
|
|
else
|
|
@@ -41,12 +41,12 @@ Install_Nginx() {
|
|
|
[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=$nginx_install_dir/sbin:\$PATH" >> /etc/profile
|
|
|
[ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep $nginx_install_dir /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=$nginx_install_dir/sbin:\1@" /etc/profile
|
|
|
. /etc/profile
|
|
|
-
|
|
|
+
|
|
|
[ "$OS" == 'CentOS' ] && { /bin/cp ../init.d/Nginx-init-CentOS /etc/init.d/nginx; chkconfig --add nginx; chkconfig nginx on; }
|
|
|
[[ $OS =~ ^Ubuntu$|^Debian$ ]] && { /bin/cp ../init.d/Nginx-init-Ubuntu /etc/init.d/nginx; update-rc.d nginx defaults; }
|
|
|
|
|
|
sed -i "s@/usr/local/nginx@$nginx_install_dir@g" /etc/init.d/nginx
|
|
|
-
|
|
|
+
|
|
|
mv $nginx_install_dir/conf/nginx.conf{,_bk}
|
|
|
if [[ ${apache_option} =~ ^[1-2]$ ]]; then
|
|
|
/bin/cp ../config/nginx_apache.conf $nginx_install_dir/conf/nginx.conf
|
|
@@ -76,7 +76,7 @@ EOF
|
|
|
sed -i "s@/data/wwwroot/default@${wwwroot_dir}/default@" $nginx_install_dir/conf/nginx.conf
|
|
|
sed -i "s@/data/wwwlogs@${wwwlogs_dir}@g" $nginx_install_dir/conf/nginx.conf
|
|
|
sed -i "s@^user www www@user ${run_user} ${run_user}@" $nginx_install_dir/conf/nginx.conf
|
|
|
-
|
|
|
+
|
|
|
# logrotate nginx log
|
|
|
cat > /etc/logrotate.d/nginx << EOF
|
|
|
${wwwlogs_dir}/*nginx.log {
|