|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!LNMP(Linux-Nginx-Mysql-PHP),本文在CentOS7.0上编译LNMP试试鲜,全文基础上都是接纳手动编译安排...依附yum帮我装置了GCC和automake..写这个器材耗时有点久了...尼玛太花工夫啦,Linux运维交换群:344177552 次要软件版本:- nginx-1.6.0php-5.3.5mysql-5.5.6
复制代码 yum源设置(实在没甚么修改)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything
复制代码 编译工具装置- [root@ipython~]#yuminstallgcc-c++automakeautoconfbzip2
复制代码 zlib库(供应数据紧缩用的函式库):- [root@ipythonlnmp]#tarzxfzlib-1.2.8.tar.gz[root@ipythonlnmp]#cdzlib-1.2.8[root@ipythonzlib-1.2.8]#./configure--prefix=/software/sharelib[root@ipythonzlib-1.2.8]#make&&makeinstall
复制代码 pcre库(rewrite的撑持)- [root@ipythonlnmp]#tarzxfpcre-8.35.tar.gz[root@ipythonlnmp]#cdpcre-8.35[root@ipythonpcre-8.35]#./configure--prefix=/software/pcre--enable-utf8--enable-unicode-properties[root@ipythonpcre-8.35]#make&&makeinstall
复制代码 OpenSSL库(https的撑持)- [root@ipythonlnmp]#tarzxfopenssl-1.0.1h.tar.gz[root@ipythonlnmp]#cdopenssl-1.0.1h[root@ipythonopenssl-1.0.1h]#./config--prefix=/software/openssl[root@ipythonopenssl-1.0.1h]#make&&makeinstall
复制代码 TCMalloc工具(谷歌内存办理套件)- [root@ipythonlnmp]#tarzxflibunwind-1.1.tar.gz[root@ipythonlnmp]#cdlibunwind-1.1[root@ipythonlibunwind-1.1]#CFLAGS=-fPIC./configure--prefix=/software/谷歌-libunwind[root@ipythonlibunwind-1.1]#makeCFLAGS=-fPIC&&makeCFLAGS=-fPICinstall[root@ipythonlnmp]#tarzxfgperftools-2.2.tar.gz[root@ipythonlnmp]#cdgperftools-2.2[root@ipythongperftools-2.2]#LDFLAGS="-L/software/谷歌-libunwind/lib"CPPFLAGS="-I/software/谷歌-libunwind/include"./configure--prefix=/software/谷歌-perftools[root@ipythongperftools-2.2]#make&&makeinstall###路径加到静态链接库###[root@ipythongperftools-2.2]#echo"/software/谷歌-libunwind/lib/">>/etc/ld.so.conf[root@ipythongperftools-2.2]#echo"/software/谷歌-perftools/lib/">>/etc/ld.so.conf[root@ipythongperftools-2.2]#echo"/software/sharelib/lib/">>/etc/ld.so.conf&&ldconfig
复制代码 Nginx(不注释)- [root@ipythonlnmp]#groupadd-g1500nginx[root@ipythonlnmp]#useradd-M-u1500-gnginx-s/sbin/nologinnginx[root@ipythonlnmp]#mkdir/var/tmp/nginx[root@ipythonlnmp]#chownnginx:nginx/var/tmp/nginx/[root@ipythonlnmp]#tarzxfnginx-1.6.0.tar.gz[root@ipythonlnmp]#cdnginx-1.6.0[root@ipythonnginx-1.6.0]#sed-is/CFLAGS="$CFLAGS-g"/#CFLAGS="$CFLAGS-g"/auto/cc/gcc[root@ipythonnginx-1.6.0]#sed-i"s#/usr/local#/software/谷歌-perftools#"auto/lib/谷歌-perftools/conf##设置参数有点长##[root@ipythonnginx-1.6.0]#./configure--prefix=/software/nginx--user=nginx--group=nginx--with-http_stub_status_module--with-http_ssl_module--with-http_realip_module--with-http_gzip_static_module--with-debug--http-client-body-temp-path=/var/tmp/nginx/client--http-proxy-temp-path=/var/tmp/nginx/proxy--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi--http-scgi-temp-path=/var/tmp/nginx/scgi--with-pcre=/root/lnmp/pcre-8.35--with-openssl=/root/lnmp/openssl-1.0.1h--with-zlib=/root/lnmp/zlib-1.2.8--with-谷歌_perftools_module[root@ipythonnginx-1.6.0]#make&&makeinstall[root@ipythonnginx-1.6.0]#mkdir/tmp/tcmalloc[root@ipythonnginx-1.6.0]#chmod0777/tmp/tcmalloc/###这文件在附件里###[root@ipythonnginx-1.6.0]#cp../nginx.conf/software/nginx/conf/[root@ipythonnginx-1.6.0]#cp../fcgi.conf/software/nginx/conf/[root@ipythonnginx-1.6.0]#chmod755/etc/init.d/nginx[root@ipythonnginx-1.6.0]#mkdir/data/{logs,www.ipython.me}[root@ipythonnginx-1.6.0]#/software/nginx/sbin/nginx[root@ipythonnginx-1.6.0]#iptables-F[root@ipythonnginx-1.6.0]#iptables-AINPUT-ptcp--dport22-jACCEPT[root@ipythonnginx-1.6.0]#iptables-AINPUT-ptcp--dport80-jACCEPT[root@ipythonnginx-1.6.0]#psaux|grepnginxroot612910.00.031120896?Ss15:360:00nginx:masterprocess/software/nginx/sbin/nginx-c/software/nginx/conf/nginx.confnginx612930.00.1315601612?S15:360:00nginx:workerprocess
复制代码 ncurses库(字符终端处置库)- [root@ipythonlnmp]#tarjxfncurses-5.9.tar.bz2[root@ipythonlnmp]#cdncurses-5.9[root@ipythonncurses-5.9]#./configure--prefix=/software/ncurses--with-shared--without-debug[root@ipythonncurses-5.9]#make&&makeinstall
复制代码 Mysql(数据库)- [root@ipythonlnmp]#/usr/sbin/groupaddmysql[root@ipythonlnmp]#/usr/sbin/useradd-s/sbin/nologin-gmysqlmysql[root@ipythonlnmp]#tarzxfmysql-5.5.6-rc.tar.gz[root@ipythonlnmp]#cdmysql-5.5.6-rc[root@ipythonmysql-5.5.6-rc]#./configure--prefix=/software/mysql/--enable-assembler--with-extra-charsets=complex--enable-thread-safe-client--with-big-tables--with-readline--with-ssl--with-embedded-server--enable-local-infile--with-plugins=partition,innobase,myisammrg--with-named-curses-libs=/software/ncurses/lib/libncurses.so.5[root@ipythonmysql-5.5.6-rc]#make&&makeinstall[root@ipythonmysql-5.5.6-rc]#mkdir/data/mysql/{binlog,relaylog}-p[root@ipythonmysql-5.5.6-rc]#chown-Rmysql:mysql/data/mysql[root@ipythonmysql-5.5.6-rc]#/software/mysql/bin/mysql_install_db--basedir=/software/mysql/--datadir=/data/mysql/--user=mysql###这文件在附件里###[root@ipythonmysql-5.5.6-rc]#cp../my.cnf/etc/my.cnf[root@ipythonmysql-5.5.6-rc]#cp../mysqld/etc/init.d/mysqld[root@ipythonmysql-5.5.6-rc]#chmod755/etc/init.d/mysqld[root@ipythonmysql-5.5.6-rc]#systemctlenablemysqld[root@ipythonmysql-5.5.6-rc]#systemctlstartmysqld[root@ipythonmysql-5.5.6-rc]#psaux|grepmysqldroot554750.10.11153481696?S16:070:00/bin/sh/software/mysql/bin/mysqld_safe--datadir=/data/mysql--pid-file=/data/mysql/mysql.pidmysql563422.711.91918248120680?Sl16:070:01/software/mysql/libexec/mysqld--basedir=/software/mysql--datadir=/data/mysql--plugin-dir=/software/mysql/lib/mysql/plugin--user=mysql--log-error=/data/mysql/mysql_error.log--open-files-limit=10240--pid-file=/data/mysql/mysql.pid--socket=/tmp/mysql.sock--port=3306
复制代码 libiconv库(字符编码转换)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything0
复制代码 libxml库(XML库)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything1
复制代码 libpng库(图片库)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything2
复制代码 jpeg库(图片库)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything3
复制代码 freetype(字库)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything4
复制代码 libmcrypt库(加密算法)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything5
复制代码 mhash库(加密)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything6
复制代码 curl库(URL传输)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything7
复制代码 gd库(画图)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything8
复制代码 libtool(库编译撑持)- [root@ipython~]#cat/etc/yum.repos.d/1.repo[1]name=1baseurl=file:///mediaenabled=1gpgcheck=0[root@ipython~]#mount/dev/cdrom/media&&yumcleanallmount:/dev/sr0iswrite-protected,mountingread-onlyLoadedplugins:fastestmirrorCleaningrepos:1Cleaningupeverything9
复制代码 将mysql的库文件到场静态同享- [root@ipython~]#yuminstallgcc-c++automakeautoconfbzip20
复制代码 PHP(一种言语吧)- [root@ipython~]#yuminstallgcc-c++automakeautoconfbzip21
复制代码 好了...看图
本文出自“IT辰逸”博客,请务必保存此出处http://itchenyi.blog.51cto.com/4745638/1437686
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|