仓酷云

标题: 带来一篇CentOS7 编译装置LNMP [打印本页]

作者: 若天明    时间: 2015-1-14 20:25
标题: 带来一篇CentOS7 编译装置LNMP
欢迎大家来到仓酷云论坛!
LNMP(Linux-Nginx-Mysql-PHP),本文在CentOS7.0上编译LNMP试试鲜,全文基础上都是接纳手动编译安排...依附yum帮我装置了GCC和automake..写这个器材耗时有点久了...尼玛太花工夫啦,Linux运维交换群:344177552
次要软件版本:
  1. nginx-1.6.0php-5.3.5mysql-5.5.6
复制代码
yum源设置(实在没甚么修改)
  1. [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
复制代码
编译工具装置
  1. [root@ipython~]#yuminstallgcc-c++automakeautoconfbzip2
复制代码
zlib库(供应数据紧缩用的函式库):
  1. [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的撑持)
  1. [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的撑持)
  1. [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工具(谷歌内存办理套件)
  1. [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(不注释)
  1. [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库(字符终端处置库)
  1. [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(数据库)
  1. [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库(字符编码转换)
  1. [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库)
  1. [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库(图片库)
  1. [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库(图片库)
  1. [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(字库)
  1. [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库(加密算法)
  1. [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库(加密)
  1. [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传输)
  1. [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库(画图)
  1. [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(库编译撑持)
  1. [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的库文件到场静态同享
  1. [root@ipython~]#yuminstallgcc-c++automakeautoconfbzip20
复制代码
PHP(一种言语吧)
  1. [root@ipython~]#yuminstallgcc-c++automakeautoconfbzip21
复制代码
好了...看图
带来一篇CentOS7 编译装置LNMP
登录/注册后可看大图

本文出自“IT辰逸”博客,请务必保存此出处http://itchenyi.blog.51cto.com/4745638/1437686
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!
作者: 莫相离    时间: 2015-1-16 17:54
标题: 带来一篇CentOS7 编译装置LNMP
Linux简单,占内存少,特别是对于程序开发人员来说很方便,如果说windows的成功在于其方便用户的窗口管理界面。
作者: 谁可相欹    时间: 2015-1-21 07:15
上课传授的不仅仅是知识,更重要的是一些道理,包括一些做人的道理,讲课时也抓住重点,循序渐进,让同学理解很快;更可贵的是不以你过去的成绩看问题.
作者: 灵魂腐蚀    时间: 2015-1-30 11:08
其中不乏很多IT精英的心血。我们学透以后更可以做成自己的OS!?
作者: 飘灵儿    时间: 2015-2-6 11:08
我感觉linux的学习,学习编程~!~!就去学习C语言编程!!
作者: 只想知道    时间: 2015-2-16 05:49
有疑问前,知识学习前,先用搜索。
作者: 第二个灵魂    时间: 2015-3-5 01:44
在学习linux的工程中,linux学习方法有很多种,这里是小编的学习心得,给大家拿出来分享一下。
作者: 老尸    时间: 2015-3-11 22:44
当然你不需搭建所有服务,可以慢慢来。自己多动手,不要非等着别人帮你解决问题。
作者: 简单生活    时间: 2015-3-19 17:08
工具书对于学习者而言是相当重要的。一本错误观念的工具书却会让新手整个误入歧途。目前国内关于Linux的书籍有很多不过精品的不多。
作者: 分手快乐    时间: 2015-3-30 13:26
学习Linux,应该怎样学,主要学些什么,一位Linux热心学习者,一段学习Linux的风云经验,历时十二个小时的思考总结,近十位网络Linux学习者权威肯定,为您学习Linux指明方向。




欢迎光临 仓酷云 (http://ckuyun.com/) Powered by Discuz! X3.2