博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
(三)、LNMP的搭建,并制作rpm包
阅读量:5344 次
发布时间:2019-06-15

本文共 5321 字,大约阅读时间需要 17 分钟。

中小型规模网站集群架构:yum仓库搭建

: Ago-linux运维群:93324526


编译的三条命令的规则

./configure    就是在本地创建了一个Makefile文件 (也就是指定一下各种配置参数)make           就是在执行Makefile这个文件里的内容。生成文件在源码包make install   把make生成的文件 移动到指定的目录下面 没指定就默认/usr/local

超链已经有了nginx的搭建

LNMP的搭建

1.Nginx-1.10.2搭建

#1.安装依赖包yum install -y  pcre-devel openssl-devel #2.下载源码包wget http://nginx.org/download/nginx-1.10.2.tar.gz#3.创建www用户useradd  -s /sbin/nologin -M www#4.编译安装./configure  --user=www --group=www --prefix=/application/nginx-1.10.2 --with-http_stub_status_module  --with-http_ssl_modulemakemake install#5.创建软链ln -s nginx-1.10.2/ nginx

2.php-5.5.32搭建

cd /server/files#1.安装依赖包yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel curl-devel openssl-devel -yyum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel -y#2.安装字符集转换库---libiconv wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar zxf libiconv-1.14.tar.gzcd libiconv-1.14./configure --prefix=/usr/local/libiconvmake && make install#3.安装其它相关程序---libmcryptwget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repoyum -y install libmcrypt-devel mhash mcryptrpm -qa libmcrypt-devel mhash mcrypt #4.编译安装wget http://tw1.php.net/distributions/php-5.5.32.tar.gztar xf php-5.5.32.tar.gzcd php-5.5.32./configure --prefix=/application/php-5.5.32 \--with-mysql=mysqlnd \--with-pdo-mysql=mysqlnd \--with-iconv-dir=/usr/local/libiconv \--with-freetype-dir \--with-jpeg-dir \--with-png-dir \--with-zlib \--with-libxml-dir=/usr \--enable-xml \--disable-rpath \--enable-bcmath \--enable-shmop \--enable-sysvsem \--enable-inline-optimization \--with-curl \--enable-mbregex \--enable-fpm \--enable-mbstring \--with-mcrypt \--with-gd \--enable-gd-native-ttf \--with-openssl \--with-mhash \--enable-pcntl \--enable-sockets \--with-xmlrpc \--enable-soap \--enable-short-tags \--enable-static \--with-xsl \--with-fpm-user=www \--with-fpm-group=www \--enable-ftp \--enable-opcache=no可能出现问题解决:ln -s /application/mysql/lib/libmysqlclient.so.18  /usr/lib64/touch ext/phar/phar.pharmake && make installln -s /application/php-5.5.32/ /application/php#5.配置文件的复制cp php.ini-production /application/php/lib/php.inicd /application/php/etc/cp php-fpm.conf.default php-fpm.conf

需要在本地使用mysql的话请编译时,改此参数

--with-mysql=mysql路径

3.MySQL搭建.使用二进制安装

#1.下载安装包cd /server/fileswget http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.6/mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz#2.安装,并创建用户和授权tar xf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gzmv mysql-5.6.34-linux-glibc2.5-x86_64 /application/mysql-5.6.34ln -s /application/mysql-5.6.34/ /application/mysqluseradd  mysql  -M -s /sbin/nologin -u 899chown -R mysql.mysql /application/mysql#3.初始化数据库cd /application/mysql./scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/application/mysql/data/#4.修改启动文件\cp support-files/mysql.server /etc/init.d/mysqldsed -i 's#/usr/local/mysql#/application/mysql#g' /etc/init.d/mysqldsed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe#5.复制配置文件并启动\cp /application/mysql/my.cnf /etc/my.cnf/etc/init.d/mysqld start

rpm包制作

1.php

单独打包libiconv和在php安装之前先安装一下libiconv
ini和php-fpm.conf两个文件记得先移动再打包
vi /server/scripts/after_php.sh#!/bin/shln -s /application/php-5.5.32  /application/phpfpm -s dir -t rpm -n php -v 5.5.32 -d 'libmcrypt-devel mhash mcrypt zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel curl-devel openssl-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel'  --after-install /server/scripts/after_php.sh -f /application/php-5.5.32/

2.MySQL

vi /server/scripts/mysql_rpm.shuseradd  mysql  -M -s /sbin/nologin -u 899chown -R mysql.mysql /application/mysql*cd /application/mysql./scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/application/mysql/data/\cp support-files/mysql.server /etc/init.d/mysqldsed -i 's#/usr/local/mysql#/application/mysql#g' /etc/init.d/mysqldsed -i 's#/usr/local/mysql#/application/mysql#g' /application/mysql/bin/mysqld_safe#5.复制配置文件并启动\cp /application/mysql/my.cnf /etc/my.cnf/etc/init.d/mysqld startfpm -s dir -t rpm -n mysql -v 5.6.34  --post-install /server/scripts/mysql_rpm.sh -f /application/mysql-5.6.34/

3.sersync制作

1-配置文件
   
    
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
       
       
       
   
   
       
       
       
       
       
   
   
   
       
       
       
       
   
   
   
   
   
 
   
       
       
   
   
   
   
       
   
   
   
   
       
       
       
   
   
2脚本编写
vi /server/scripts/sersync_rpm.sh#!/bin/sh/usr/local/sersync/bin/sersync -d -r -o /usr/local/sersync/conf/confxml.xmlecho '/usr/local/sersync/bin/sersync -d -r -o /usr/local/sersync/conf/confxml.xml' >> /etc/rc.local
3-rpm制作
fpm -s dir -t rpm -n sersync -v 1.1 --post-install /server/scripts/sersync_rpm.sh -f /usr/local/sersync

转载于:https://www.cnblogs.com/can-H/articles/6657917.html

你可能感兴趣的文章
如何实现基于ssh框架的投票系统的的质量属性
查看>>
SQL Server Profiler:使用方法和指标说明
查看>>
[What I should read] 基于windows server的分布式开发和部署
查看>>
Eclipse优化设置
查看>>
【注意事项】APP左右横滑设计
查看>>
linux中强大的screen命令
查看>>
js时间冒泡,阻止事件冒泡
查看>>
java面试题总结
查看>>
spring与quartz的整合
查看>>
Selenium-百度登录简单例子
查看>>
2014中国软件开发者调查(一):Java最受欢迎 第二语言JS使用比例最高
查看>>
词典 (noi OpenJudge)
查看>>
Visual Stdio 2010 抢先体验
查看>>
如何用ssh挂载远程目录
查看>>
常用的系统查询语句
查看>>
10651
查看>>
Leetcode: Convert Sorted List to Binary Search Tree
查看>>
ionic3-ng4学习见闻--(aot方式打包问题解决方案)
查看>>
Android系统Recovery工作原理之使用update.zip升级过程分析(三)
查看>>
使用GridFsTemplate在Mongo中存取文件
查看>>