资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

LNP安装部署

建站服务器

1.安装依赖包:

创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都网站建设、成都做网站、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的中原网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!
yuminstallopensslopenssl-develpcreGeoIPperl-develperlperl-ExtUtils-EmbedGeoIP-devellibatomiclibatomic_ops-devel

2.安装zlib

tar-xfzlib-1.2.11.tar.gz
cdzlib-1.2.11
./configure
make
makeinstall

3.添加用户

addusernginx-s/sbin/nologin

4.编译安装nginx

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

5.添加脚本

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

启动nginx

systemctlstartnginx.service

二、安装PHP

1.安装依赖包

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

2.安装libmcrypt

tar-xflibmcrypt-2.5.8.tar.gz
cdlibmcrypt-2.5.8
./configure
make
makeinstall

3.安装libxml2

tar-xflibxml2-2.8.0.tar.gz
cdlibxml2-2.8.0
./configure--prefix=/usr/local/libxml2
make
makeinstall

4.安装libpng

tar-xflibpng-1.5.28.tar.xz
cdlibpng-1.5.28
./configure--prefix=/usr/local/libpng
make
makeinstall

5.安装jpeg9

tar-xfjpegsrc.v9b.tar.gz
cdjpeg-9b/
./configure--prefix=/usr/local/jpeg9--enable-shared
make
makeinstall

6.安装gettext

tar-xfgettext-0.19.8.tar.xz
cdgettext-0.19.8
./configure
make
makeinstall

7.安装libpng

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

8.安装freetype

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

9.安装libiconv

tar-xflibiconv-1.15.tar.gz
cdlibiconv-1.15
./configure--prefix=/usr/local/libiconv
make
makeinstall

10.安装php-5.6

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

11.添加用户

adduser-s/sbin/nologinphp

12.配置php

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

13.安装opcache

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/

14.添加opcache

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://cdkjz.cn/article/cgggjs.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220