搭建lnmp架构及其优点

部署nginx:

yum install -y  gcc  pcre-devel openssl-devel   ##安装
./configure --prefix=/usr/local/bin/nginx   --with-http_ssl_module --with-file-aio --with-http_stub_status_module
make && make install

将nginx的目录加入环境变量:

vim /root/.bash_profile 

在这里插入图片描述

nginx
netstat -antlp

在这里插入图片描述
部署mysql:mysql-boot包官网
编译选项:

yum install -y cmake gcc-c++ ncurses-devel
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql \ #安装位置 
 -DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock \ #指定套接字文件位置 
 -DEXTRA_CHARSETS=all \ #扩展字符集 
 -DDEFAULT_CHARSET=utf8 \ #默认字符集 
 -DDEFAULT_COLLATION=utf8_general_ci \ #默认字符校对 
 -DWITH_INNOBASE_STORAGE_ENGINE=1 \ #安装myisam 存储引擎 
 -DWITH_MYISAM_STORAGE_ENGINE=1 \ #安装innodb存储引擎 
 -DWITH_MEMORY_STORAGE_ENGINE=1 \ #安装memory存储引擎 
 -DWITH_READLINE=1 \ #支持readline库 
 -DENABLED_LOCAL_INFILE=1 \ #启用加载本地数据 
 -DMYSQL_USER=mysql \ #指定mysql运行用户 
 -DMYSQL_TCP_PORT=3306 

可能会看到这样的报错:

CMake Error at cmake/boost.cmake:81 (MESSAGE):
You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>
This CMake script will look for boost in <directory>. If it is not there,
it will download and unpack it (in that directory) for you.
If you are inside a firewall, you may need to use an http proxy:
export http_proxy=http://example.com:80

解决:

缺少 -DWITH_BOOST=<directory>参数
重新编译时加上下面的参数: 
-DWITH_BOOST=boost/boost_1_59_0/
-DDOWNLOAD_BOOST=1

重新编译时,需要清除原来的对象文件和缓存信息:

make clean
rm -fr CmakeCache.txt

后面编译过程中可能会有一个 warnin:

CMake Warning at cmake/bison.cmake:20 (MESSAGE):
Bison executable not found in PATH
Call Stack (most recent call first):
sql/CMakeLists.txt:514 (INCLUDE)

解决:

yum install -y bison

安装:

make && make install ##如果 make 还有问题,删除原来的目录,重新解压编译(安装过程较长) 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值