建站服务器
1.安装依赖包: 2.安装zlib 3.添加用户 4.编译安装nginx 5.添加脚本 重新装载: 启动nginx 二、安装PHP 1.安装依赖包 2.安装libmcrypt 3.安装libxml2 4.安装libpng 5.安装jpeg9 6.安装gettext 7.安装libpng 8.安装freetype 9.安装libiconv 10.安装php-5.6 11.添加用户 12.配置php 13.安装opcache 14.添加opcacheyuminstallopensslopenssl-develpcreGeoIPperl-develperlperl-ExtUtils-EmbedGeoIP-devellibatomiclibatomic_ops-devel
tar-xfzlib-1.2.11.tar.gz
cdzlib-1.2.11
./configure
make
makeinstall
addusernginx-s/sbin/nologin
tar-xfnginx-1.10.3.tar.gz
cdnginx-1.10.3
./configure\\
--prefix=/usr/local/nginx\\
--pid-path=/usr/local/nginx\\
--user=nginx\\
--group=nginx\\
--with-threads\\
--with-file-aio\\
--with-http_ssl_module\\
--with-http_v2_module\\
--with-http_addition_module\\
--with-http_sub_module\\
--with-http_dav_module\\
--with-http_flv_module\\
--with-http_mp4_module\\
--with-http_perl_module\\
--with-http_geoip_module\\
--with-http_gunzip_module\\
--with-http_auth_request_module\\
--with-mail\\
--with-http_gzip_static_module\\
--with-http_auth_request_module\\
--with-http_random_index_module\\
--with-http_secure_link_module\\
--with-http_degradation_module\\
--with-http_slice_module\\
--with-http_stub_status_module\\
--with-http_perl_module\\
--with-zlib=/tmp/soft/zlib-1.2.11\\
--with-stream\\
--with-stream_ssl_module\\
--with-pcre\\
--with-libatomic
make
makeinstall
cd/etc/init.d/
vimnginx
#!/bin/bash
#nginxStartupscriptfortheNginxHTTPServer
#itisv.0.0.2version.
#chkconfig:-8515
#description:Nginxisahigh-performancewebandproxyserver.
#Ithasalotoffeatures,butit\'snotforeveryone.
#processname:nginx
#pidfile:/usr/local/nginx/logs/nginx.pid
#config:/usr/local/nginx/conf/nginx.conf
nginxd=/usr/local/nginx/sbin/nginx
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_pid=/usr/local/nginx/logs/nginx.pid
RETVAL=0
prog=nginx
#Sourcefunctionlibrary.
./etc/rc.d/init.d/functions
#Sourcenetworkingconfiguration.
./etc/sysconfig/network
#Checkthatnetworkingisup.
[${NETWORKING}=no]&&exit0
[-x$nginxd]||exit0
#Startnginxdaemonsfunctions.
start(){
if[-e$nginx_pid];then
echonginxalreadyrunning....
exit1
fi
echo-n$Starting$prog:
daemon$nginxd-c${nginx_config}
RETVAL=$?
echo
[$RETVAL=0]&&touch/var/lock/subsys/nginx
return$RETVAL
}
#Stopnginxdaemonsfunctions.
stop(){
echo-n$Stopping$prog:
killproc$nginxd
RETVAL=$?
echo
[$RETVAL=0]&&rm-f/var/lock/subsys/nginx/usr/local/nginx/logs/nginx.pid
}
#reloadnginxservicefunctions.
reload(){
echo-n$Reloading$prog:
#kill-HUP`cat${nginx_pid}`
killproc$nginxd-HUP
RETVAL=$?
echo
}
#Seehowwewerecalled.
case$1in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
stop
start
;;
status)
status$prog
RETVAL=$?
;;
*)
echo$Usage:$prog{start|stop|restart|reload|status|help}
exit1
esac
exit$RETVAL
systemctldaemon-reload
systemctlstartnginx.service
yum-yinstallmakeapr*autoconfautomakecurl-develgccgcc-c++zlib-developensslopenssl-develpcre-develgdkernelkeyutilspatchperlkernel-headersmpfrcppglibclibgomplibstdc++-develpplcloog-pplkeyutils-libs-devellibcom_err-devellibsepol-devellibselinux-develkrb5-develzlib-devellibXpm*freetypelibjpeg*libpng*php-commonphp-gdncurses*libtool*libxml2libxml2-develpatch
tar-xflibmcrypt-2.5.8.tar.gz
cdlibmcrypt-2.5.8
./configure
make
makeinstall
tar-xflibxml2-2.8.0.tar.gz
cdlibxml2-2.8.0
./configure--prefix=/usr/local/libxml2
make
makeinstall
tar-xflibpng-1.5.28.tar.xz
cdlibpng-1.5.28
./configure--prefix=/usr/local/libpng
make
makeinstall
tar-xfjpegsrc.v9b.tar.gz
cdjpeg-9b/
./configure--prefix=/usr/local/jpeg9--enable-shared
make
makeinstall
tar-xfgettext-0.19.8.tar.xz
cdgettext-0.19.8
./configure
make
makeinstall
tar-xflibgd-2.2.4.tar.xz
cdlibgd-2.2.4
./configure--prefix=/usr/local/libgd--with-zlib--with-png=/usr/local/libpng--with-jpeg=/usr/local/jpeg9
make
makeinstall
wgethttp://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz
tar-xffreetype-2.7.1.tar.gz
cdfreetype-2.7.1
./configure--prefix=/usr/local/freetype
make
makeinstall
tar-xflibiconv-1.15.tar.gz
cdlibiconv-1.15
./configure--prefix=/usr/local/libiconv
make
makeinstall
tar-xfphp-5.6.30.tar.xz
cdphp-5.6.30
./configure--prefix=/usr/local/php5--with-config-file-path=/usr/local/php5/etc--with-mysql--with-Mysqli--with-pdo-MYSQL--enable-pdo--with-pdo-sqlite--with-iconv--with-zlib--enable-xml--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curlwrappers--enable-mbregex--enable-fpm--enable-mbstring--enable-ftp--enable-gd-native-ttf--enable-opcache--with-openssl--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--without-pear--with-gettext--enable-session--with-mcrypt--with-curl--with-libxml-dir=/usr/local/libxml2--with-gd--with-jpeg-dir=/usr/local/jpeg9--with-png-dir=/usr/local/libpng--with-freetype-dir=/usr/local/freetype
make
makeinstall
adduser-s/sbin/nologinphp
cpphp.ini-production/usr/local/php5/etc/php.ini
rm-f/etc/php.ini
ln-s/usr/local/php5/etc/php.ini/etc/php.ini
cp/usr/local/php5/etc/php-fpm.conf.default/usr/local/php5/etc/php-fpm.conf
cpsapi/fpm/init.d.php-fpm/etc/rc.d/init.d/php-fpm
chmod+x/etc/rc.d/init.d/php-fpm
cd/tmp/soft/php-5.6.30
cdext/opcache/
#/usr/local/php5/bin/phpize
#./configure--with-php-config=/usr/local/php5/bin/php-config
#make
#makeinstall
Installingsharedextensions:/usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/
InstallingPHPCLIbinary:/usr/local/php5/bin/
InstallingPHPCLImanpage:/usr/local/php5/php/man/man1/
InstallingPHPFPMbinary:/usr/local/php5/sbin/
InstallingPHPFPMconfig:/usr/local/php5/etc/
InstallingPHPFPMmanpage:/usr/local/php5/php/man/man8/
InstallingPHPFPMstatuspage:/usr/local/php5/php/php/fpm/
InstallingPHPCGIbinary:/usr/local/php5/bin/
InstallingPHPCGImanpage:/usr/local/php5/php/man/man1/
Installingbuildenvironment:/usr/local/php5/lib/php/build/
Installingheaderfiles:/usr/local/php5/include/php/
Installinghelperprograms:/usr/local/php5/bin/
program:phpize
program:php-config
Installingmanpages:/usr/local/php5/php/man/man1/
page:phpize.1
page:php-config.1
/tmp/soft/php-5.6.30/build/shtoolinstall-cext/phar/phar.phar/usr/local/php5/bin
ln-s-fphar.phar/usr/local/php5/bin/phar
InstallingPDOheaders:/usr/local/php5/include/php/ext/pdo/
vim/etc/php.ini
.....
[opcache]
zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/opcache.so
opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=4
opcache.max_accelerated_files=8000
opcache.max_wasted_percentage=5
opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.revalidate_freq=0
opcache.revalidate_path=0
opcache.save_comments=0
opcache.load_comments=0
opcache.force_restart_timeout=3600
当前名称:LNP安装部署
标题链接:http://kswsj.cn/article/cgggjs.html