1.Mysql安裝php
* yum install gcc-c++ ncurses-devel -y ##解決依賴性html
* tar zxf mysql-boost-5.7.17.tar.gz ##解壓文件
mysql
* tar zxf mysql-boost-5.7.17.tar.gz ##安裝CMAKE工具
nginx
* useradd -M -d /usr/local/lnmp/nginx -s /sbin/nologin -u 800 nginx ##添加用戶
c++
* 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
## 在解壓目錄下安裝sql
* rm -fr CMakeCache.txt ##清理緩存
vim
* make && make install ##編譯和安裝
api
* groupadd -g 27 mysq
緩存
* useradd -u 27 -g 27 -s /sbin/nologin -M -d /usr/local/lnmp/mysql/ mysq ##添加用戶
bash
* 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