标签:
LNMP源码包搭建
linux centos
nginx 版本1.8.0 下载地址:http://nginx.org/en/download.html
mysql 版本5.0.56 下载地址:
php 版本5.6.15 下载地址:
这些源码包都上传到或下载到该目录下: /usr/local/
1.安装nginx
安装之前先安装下各种依赖
# yum -y install zlib-devel pcre-devel openssl-devel gcc
# tar -xf nginx-1.8.0.tar.gz
# cd nginx-1.8.0
# ./configure --prefix=/usr/local/nginx --with-openssl=/usr/include/openssl --with-pcre --with-http_stub_status_module
# make && make install
启动nginx
# /usr/local/nginx/sbin/nginx
查看是否启动
# ps aux | grep nginx
2.安装mysql
安装之前先安装下依赖
# yum -y install ncurses-devel gcc-c++
# useradd -M -s /sbin/nologin mysql
# tar -xf mysql-5.0.56.tar.gz
# cd mysql-5.0.56
# ./configure --prefix=/usr/local/mysql --without-debug --with-extra-charsets=utf8,gbk --enable-assembler --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-unix-socket-path=/tmp/mysql.sock --with-ssl
# make && make install
#编译的时间比较漫长。。
# cp /usr/local/mysql-5.0.56/support-files/my-medium.cnf /etc/my.cnf
# cp /usr/local/mysql-5.0.56/support-files/mysql.server /etc/init.d/mysqld
# chmod +x /etc/init.d/mysqld
# ln -s /usr/local/mysql/bin/* /usr/local/bin/
# ln -s /usr/local/mysql/lib/mysql/lib* /usr/lib/
# mysql_install_db --user=mysql
# chown -R root:mysql /usr/local/mysql/
# chown -R mysql:mysql /usr/local/mysql/var/
# service mysqld start
# mysql
标签:
原文地址:http://www.cnblogs.com/firstForEver/p/4943335.html