LNMP+discuzz源码安装
Bison安装—编译mysql需要
Shell> tar zxvf bison-3.0.tar.gz
Shell> cd bison-3.0
Shell> ./configure –prefix=/usr/local/bison
Shell> make
Shell> make install
Cmake安装—编译mysql需要
Shell> tar zxvf cmake-2.8.10.2.tar.gz
Shell> cd cmake-2.8.10.2
Shell> ./configure –prefix=/usr/local/cmake
Shell> make
Shell> make install
修改环境变量
Shell> echo “export PATH=$PATH:/usr/local/bison/bin:/usr/local/cmake/bin” >> /etc/profile
Shell> source /etc/profile
Mysql的安装
Shell> groupadd mysql
Shell> useradd –G mysql mysql
Shell> tar zxvf mysql-5.5.37.tar.gz
Shell> cd mysql-5.5.37
Shell> cmake –DCMAKE_INSTALL_PREFIX=/usr/local/mysql –DDEFAULT_CHARSET=utf8
Shell> make
Shell> make install
Shell> cd /usr/local/mysql
Shell> cp support-files/my-medium.cnf ./my.cnf
修改环境变量
Shell> echo “export PATH=$PATH:/usr/local/mysql/bin” >> /etc/profile
Shell> source /etc/profile
Mysql的初始配置及启动
Shell> chown –R mysql:mysql /usr/local/mysql
Shell> /usr/local/mysql/scripts/mysql_install_db –basedir=/usr/local/mysql –user=mysql
Shell> mysqld_safe &
Shell> mysqladmin –u root password ‘root’
Nginx安装
Shell> groupadd nginx
Shell> useradd nginx
Shell> tar zxvf ngnix-1.7.0
Shell> cd ngnix-1.7.0
Shell> ./configure –prefix=/usr/local/nginx
Shell> make
Shell> make install
Shell> chown –R nginx:nginx /usr/local/nginx
修改环境变量
Shell> echo “export PATH=$PATH:/usr/local/nginx/sbin”
Shell> source /etc/profile
启动nginx
Shell>nginx
测试nginx
http://localhost
Libiconv安装—php编译需要
Shell> tar zxvf libiconv-1.14.tar.gz
Shell> cd libiconv-1.14
Shell> ./configure –prefix=/usr/local/libiconv
Shell> vi srclib/stdio.h
Shell> make
Shell> make install
Php安装
Shell> tar zxvf php-5.5.12.tar.gz
Shell> cd php-5.5.12
Shell> ./configure –prefix=/usr/local/php –with-iconv-dir=/usr/local/libiconv –enable-fpm –with-mysql=/usr/localmysql
Shell> make
Shell> make test
Shell> make install
Shell> echo “export PATH=$PATH:/usr/local/php/bin:/usr/local/php/sbin” >>/etc/profile
Shell> source /etc/profile
php配置
Shell> cp php.ini-development /usr/local/php/php.ini
Shell> cd /usr/local/php
Shell> cp etc/php-fpm.conf.default etc/php-fpm.conf
Shell> vi /usr/local/php/php.ini
Shell> /usr/local/php/etc/php-fpm.conf
启动php-fpm
Shell> /usr/local/php/sbin/php-fpm
查看运行端口状况
Shell> netstat –nlupt
添加nginx对php-fpm支持
… …
php测试
Shell> cd /usr/local/nginx/html
Shell> mv index.html index.html.bak
Shell> echo “” > index.php
http://localhost
Discuzz安装配置
Shell> unzip –x Discuz_X3.1_SC_UTF-8.zip
Shell> mv Discuz_X3.1_SC_UTF-8 discuz
Shell> mv discuz/* /usr/local/nginx/html/.
Shell> cd /usr/local/nginx/html
Shell> cp –R upload.* ./.
Shell> chown –R nginx:nginx /usr/local/nginx/html/*
Shell> http://localhost
如下图:
1 à
2 à如果出现红“x”,检查discuz文件夹权限
3à
4 à
5 à新应用需要zlib文件库支持