部署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 还有问题,删除原来的目录,重新解压编译(安装过程较长)