1.Mysql安装
* yum install gcc-c++ ncurses-devel -y ##解决依赖性
* tar zxf mysql-boost-5.7.17.tar.gz ##解压文件
* tar zxf mysql-boost-5.7.17.tar.gz ##安装CMAKE工具
* useradd -M -d /usr/local/lnmp/nginx -s /sbin/nologin -u 800 nginx ##添加用户
* cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql -DMYSQL_DATADIR=/usr/local/lnmp/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all
## 在解压目录下安装
* rm -fr CMakeCache.txt ##清理缓存
* make && make install ##编译和安装
* groupadd -g 27 mysq
* useradd -u 27 -g 27 -s /sbin/nologin -M -d /usr/local/lnmp/mysql/ mysq ##添加用户
* vim /etc/passwd ##修改用户路径
* cd /usr/local/lnmp/mysql/support-files/
* cp my-default.cnf /etc/my.cnf ##复制配置文件
* cd /usr/local/lnmp/mysql/bin/
vim ~/.bash_profile ##修改环境变量
* source~/.bash_profile ##使环境变量生效
* chown mysql.mysql . -R ##修改用户和用户组
* mysqld --initialize --user=mysql ##安装
* chown root.root . -R
chown mysql data -R
* cp mysql.server /etc/init.d/mysqld ##添加mysqld命令
* /etc/init.d/mysqld start ##开启Mysql
* mysql_secure_installation ##Mysql初始化
测试:
2.PHP 安装
* tar jxf php-5.6.20.tar.bz2 cd php-5.6.20 ##解压文件,进入文件目录
* ./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-gmp --with-gettext --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt --with-mhash
## 在解压目录下安装
* yum install libxml2-devel -y ##解决依赖性
yum install curl-devel -y
yum install libjpeg-devel -y
yum install libpng-devel -y
yum install freetype-devel -y
yum install gmp-devel -y
rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm
rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpm
yum install net-snmp-devel -y
yum install -y bison
rpm -ivh re2c-0.13.5-1.el6.x86_64.rpm
* make ##编译和安装
make install
* cd /php-5.6.20
cp php.ini-prodection /usr/local/lnmp/php/etc/php.ini ##复制配置文件
cd /sapi/fpm
cp init.d.php-fpm /etc/init.d/php-fpm ##添加PHP命令
chmod +x /etc/init.d/php-fpm
* vim /usr/local/lnmp/php/etc/php.ini ##修改配置文件
* cd /usr/local/lnmp/php/etc
cp php-fpm.conf.default php-fpm.conf
* vim php-fpm.conf
*
*
* /etc/init.d/php-fpm start ##开启服务
* vim ~/.bash_profile
* source~/.bash_profile
* vim /usr/local/lnmp/ngix/conf/nginx.conf
* nginx -s reload
测试
3.论坛安装 Discuz
* unzip Discuz_X3.2_SC_UTF8.zip
* mv upload/ /usr/local/lnmp/nginx/html/bbs
* cd /usr/local/lnmp/nginx/html/bbs/
* chmod 777 config/ data/ uc_client/ uc_server/ -R
* vim /usr/local/lnmp/php/etc/php.int
* /etc/init.d/php-fpm reload
* cd /usr/local/lnmp/mysql/
* chmod 755 /usr/local/lnmp/mysql/data/
* cd /usr/local/lnmp/nginx/html/ bbs/install
* rm -fr index.php