源码包搭建lanmp架构

来源:互联网 发布:免费的海关数据网站 编辑:程序博客网 时间:2024/05/16 12:43

lanmp架构搭建

**实验环境全部是redhat6.5
主要架构全部在server1上搭建
server2,server3只提供两台简单的apache服务器
server1:172.25.254.1
server2:172.25.254.2
server3:172.25.254.3**

搭建nginx服务器

http://nginx.org/en/download.html
先从网上搞到该安装包

nginx-1.12.0.tar.gz [root@server1 ~]# tar zxf nginx-1.12.0.tar.gz
[root@server1 nginx-1.12.0]# ls auto CHANGES.ru configure html
man src CHANGES conf contrib LICENSE README

解压后先将下面两行注释,在编译Nginx时,默认以debug模式进行,而在debug模式下会插入很多跟踪和ASSERT之类的信息,编译完成后,一个Nginx要有好几兆字节。在编译前取消Nginx的debug模式,编译完成后Nginx只有几百千字节,因此可以在编译之前,修改相关源码,取消debug模式

[root@server1 cc]# vim /root/nginx-1.12.0/auto/cc/gcc 171 # debug 172

CFLAGS=”$CFLAGS -g”

[root@server1 core]# vim nginx.h #这样可以让其他人看不到版本号
14 #define NGINX_VER “nginx”
接下来开始编译

[root@server1 nginx-1.12.0]# ./configure
–prefix=/usr/local/lnmp/nginx –with-http_ssl_module –with-http_stub_status_module –with-threads –with-file-aio checking for OS + Linux 2.6.32-431.el6.x86_64 x86_64 checking for C
compiler … not found

./configure: error: C compiler cc is not found

缺少C的编译器
[root@server1 nginx-1.12.0]# yum install -y gcc
继续编译

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using
–without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with
nginx by using –with-pcre= option.

[root@server1 nginx-1.12.0]# yum install -y pcre-devel

./configure: error: SSL modules require the OpenSSL library. You can
either do not enable the modules, or install the OpenSSL library into
the system, or build the OpenSSL library statically from the source
with nginx by using –with-openssl= option.

[root@server1 nginx-1.12.0]# yum install -y openssl-devel
根据报错提示安装相关依赖性

到此时编译完成,多出来一个Makefile

[root@server1 nginx-1.12.0]# lsauto     CHANGES.ru  configure  html     Makefile  objs    srcCHANGES  conf        contrib    LICENSE  man       README[root@server1 nginx-1.12.0]# make   #读取Makefile,编译make -f objs/Makefilemake[1]: Entering directory `/root/nginx-1.12.0'~~~~~~      ##波浪线是我把中间东西省略了,粘过来太多了make[1]: Leaving directory `/root/nginx-1.12.0'[root@server1 nginx-1.12.0]# make installmake -f objs/Makefile installmake[1]: Entering directory `/root/nginx-1.12.0'~~~~~~~~~make[1]: Leaving directory `/root/nginx-1.12.0'

做了个软链接,方便使用,完全可以不做,看个人。
如果不加软连接,执行时,就需要这样/usr/local/lnmp/nginx/sbin/nginx
或者可以将这个路径添加到环境变量里

[root@server1 conf]# ln -s /usr/local/lnmp/nginx/sbin/nginx /usr/local/sbin/[root@server1 conf]# nginx[root@server1 conf]# netstat -antlpe | grep :80tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      0          17721      6166/nginx          [root@server1 conf]# curl -I localhostHTTP/1.1 200 OKServer: nginx/1.12.0Date: Thu, 31 Aug 2017 08:55:48 GMTContent-Type: text/htmlContent-Length: 612Last-Modified: Thu, 31 Aug 2017 05:17:01 GMTConnection: keep-aliveETag: "59a79bcd-264"Accept-Ranges: bytes

现在去浏览器里面测试就可以看到nginx的测试页了

[

root@server1 ~]# lscpu         #查看一下CPU信息Architecture:          x86_64CPU op-mode(s):        32-bit, 64-bitByte Order:            Little EndianCPU(s):                2On-line CPU(s) list:   0,1Thread(s) per core:    1Core(s) per socket:    1Socket(s):             2NUMA node(s):          1Vendor ID:             GenuineIntelCPU family:            6Model:                 60Stepping:              1CPU MHz:               2593.992BogoMIPS:              5187.98Hypervisor vendor:     KVMVirtualization type:   fullL1d cache:             32KL1i cache:             32KL2 cache:              4096KNUMA node0 CPU(s):     0,1[root@server1 conf]# vim nginx.conf  3 worker_processes  2;        #nginx进程数,建议设置为等于CPU总核心数。  4 worker_cpu_affinity 01 10;      ##定义Nginx运行的用户和用户组,cpu亲和力配置,让不同的进程使用不同的cpu 14     worker_connections  4096;   #单个后台worker process进程的最大并发链接数[root@server1 conf]# sysctl -a | grep file  #file-max是设置 系统所有进程一共可以打开的文件数量fs.file-nr = 416    0   98845fs.file-max = 98845
[root@server1 conf]# vim /etc/security/limits.conf ##Linux PAM(插入式认证模块,Pluggable Authentication Modules)中 pam_limits.so 的配置文件,而且只针对于单个会话。51 nginx           -       nproc           4096     #进程的最大数目52 nginx           -       nofile          4096     #打开文件的最大数目切换到nginx用户查看他的限制##########:(){ :|: & };:########无限生成进程好像

实验一下nginx功能

[root@server1 conf]# vim nginx.conf119 server {120         listen 80;121         server_name www.redhat.com;122 123         location /{124                 root /web1; #默认的路径125                 index index.html;   #默认的访问文件126         }127 }128 129 server {130         listen 80;131         server_name www.linux.com;132 133         location /{134                 root /web2;135                 index index.html;136         }137 }[root@server1 conf]# nginx -t       #检测语法nginx: the configuration file /usr/local/lnmp/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/lnmp/nginx/conf/nginx.conf test is successful[root@server1 conf]# nginx -s reload[root@server1 conf]# mkdir /web1 /web2[root@server1 conf]# vim /web1/index.html[root@server1 conf]# vim /web2/index.html

去浏览器测试,用域名访问,可以看到刚才写的配置文件,

制作一个证书,以https访问

[root@server1 conf]# vim nginx.conf99     server {100         listen       443 ssl;101         server_name  localhost;102 103         ssl_certificate      cert.pem;104         ssl_certificate_key  cert.pem;105 106         ssl_session_cache    shared:SSL:1m;107         ssl_session_timeout  5m;108 109         ssl_ciphers  HIGH:!aNULL:!MD5;110         ssl_prefer_server_ciphers  on;111 112         location / {113             root   html;114             index  index.html index.htm;115         }116     }[root@server1 conf]# cd /etc/pki/tls/certs/[root@server1 certs]# make cert.pemumask 77 ; \    PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \    PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \    /usr/bin/openssl req -utf8 -newkey rsa:2048 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \    cat $PEM1 >  cert.pem ; \    echo ""    >> cert.pem ; \    cat $PEM2 >> cert.pem ; \    rm -f $PEM1 $PEM2Generating a 2048 bit RSA private key..............+++........+++writing new private key to '/tmp/openssl.fwAAnV'-----You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----Country Name (2 letter code) [XX]:CNState or Province Name (full name) []:ShaanxiLocality Name (eg, city) [Default City]:xi'anOrganization Name (eg, company) [Default Company Ltd]:redhatOrganizational Unit Name (eg, section) []:linuxCommon Name (eg, your name or your server's hostname) []:server1Email Address []:xsh@linux.org[root@server1 certs]# lsca-bundle.crt        cert.pem         Makefileca-bundle.trust.crt  make-dummy-cert  renew-dummy-cert[root@server1 certs]# mv cert.pem /usr/local/lnmp/nginx/conf/

去浏览器测试,输入https://172.25.254.1 然后下载证书,就可以访问到了

[root@server1 conf]# vim nginx.conf119 server {120         listen 80;121         server_name www.redhat.com;122         rewrite ^(.*)https://$server_name$1 permanent   #将输入域名永久重定向到https119 server {120         listen 80;121         server_name www.redhat.com;122         rewrite ^(.*) http://www.linux.com$1 permanent;    #将www.redhat.com永久重定向到http://www.linux.com

新开两个虚拟机,充当apache服务器,server2,server3

[root@server1 conf]# vim nginx.conf18 http { 19         upstream linux {        #添加upstream模块,默认是平衡轮校模式linux是名字,自定义 20                 server 172.25.254.2:80;      #支持端口转发,可以自定义端口 21                 server 172.25.254.3:80; 22         }135 server {136         listen 80;137         server_name www.linux.com;138 139         location /{140                 proxy_pass http://linux;    #将来自www.linux.com的请求都扔给linux这个模块

在浏览器访问www.linux.com实现server2,server3负载均衡

ip_hash[root@server1 conf]# vim nginx.conf 18 http { 19         upstream linux { 20                 server 172.25.254.2:80; 21                 server 172.25.254.3:80; 22                 ip_hash;    #实验里优先选择的是上面的,也就是2实验效果并不能很好的看到
[root@server1 conf]# vim nginx.conf 18 http { 19         upstream linux { 20                 server 172.25.254.2:80; 21                 server 172.25.254.3:80; 22                 least_conn; #最小连接,首先连接负载最小的对一个用压测工具加负载,测试时会发现没有负载的那台主机连接数会更多
[root@server1 conf]# vim nginx.conf 18 http { 19         upstream linux { 20                 server 172.25.254.2:80 weight=2; 21                 server 172.25.254.3:80; 22                 server 172.25.254.1:8080 backup;

加权重。可以使能力更强的服务器负载更多,加本机的apache可以在两个apache服务端同时挂了之后给用户显示设定好的信息,backup只在两台服务器都挂掉的同时才会出来顶替工作,压力也就最小。

安装mysql

先去官网搞到安装包,我下的是5.7
https://dev.mysql.com/downloads/mysql/

[root@server1 ~]# tar zxf mysql-boost-5.7.17.tar.gz [root@server1 mysql-5.7.17]# 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 -DWITH_PARTITION_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_BOOST=boost/boost_1_59_0/boost/-bash: cmake: command not found需要cmake编译[root@server1 ~]# rpm -ivh cmake-2.8.12.2-4.el6.x86_64.rpm warning: cmake-2.8.12.2-4.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEYerror: Failed dependencies:    libarchive.so.2()(64bit) is needed by cmake-2.8.12.2-4.el6.x86_64用yum安装[root@server1 ~]# yum install -y cmake-2.8.12.2-4.el6.x86_64.rpm 继续编译~~~~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-- Configuring incomplete, errors occurred!See also "/root/mysql-5.7.17/CMakeFiles/CMakeOutput.log".See also "/root/mysql-5.7.17/CMakeFiles/CMakeError.log".缺少C语言编辑工具,以及c++,gcc已经安装过了[root@server1 mysql-5.7.17]# yum install -y gcc-c++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:80Call Stack (most recent call first):  cmake/boost.cmake:167 (COULD_NOT_FIND_BOOST)  CMakeLists.txt:455 (INCLUDE)-- Configuring incomplete, errors occurred!See also "/root/mysql-5.7.17/CMakeFiles/CMakeOutput.log".See also "/root/mysql-5.7.17/CMakeFiles/CMakeError.log".是因为boost库路径写错了需要更改为:-DWITH_BOOST=boost/boost_1_59_0/~~~~~~~~~~~~~~CMake Error at cmake/readline.cmake:64 (MESSAGE):  Curses library not found.  Please install appropriate package,      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.Call Stack (most recent call first):  cmake/readline.cmake:107 (FIND_CURSES)  cmake/readline.cmake:197 (MYSQL_USE_BUNDLED_EDITLINE)  CMakeLists.txt:483 (MYSQL_CHECK_EDITLINE)-- Configuring incomplete, errors occurred!See also "/root/mysql-5.7.17/CMakeFiles/CMakeOutput.log".See also "/root/mysql-5.7.17/CMakeFiles/CMakeError.log".错误提示缺少ncurses-devel依赖性[root@server1 mysql-5.7.17]# yum install -y ncurses-devel依赖性装好后,要删除旧的对象文件和缓存信息然后重新编译,终于成功了,但是,但是,但是,他有一个警告,受不了,必须解决~~~~~~~~~~~~~CMake Warning at cmake/bison.cmake:20 (MESSAGE):  Bison executable not found in PATHCall Stack (most recent call first):  libmysqld/CMakeLists.txt:187 (INCLUDE)~~~~~~~这个是缺少bison库[root@server1 mysql-5.7.17]# yum install -y bison[root@server1 mysql-5.7.17]# rm -fr CMakeCache.txt[root@server1 mysql-5.7.17]# make clean 继续编译,完美[root@server1 mysql-5.7.17]# make[root@server1 mysql-5.7.17]# make install至此安装完成
[root@server1 lnmp]# cd /usr/local/lnmp/mysql/[root@server1 mysql]# du -sh2.0G    .[root@server images]# du -sh vm112G vm1[root@server1 mysql]# rpm -qa|grep mysqlmysql-libs-5.1.71-1.el6.x86_64[root@server1 etc]# cp my.cnf my.cnf.bak    #备份[root@server1 etc]# cd /usr/local/lnmp/mysql/[root@server1 support-files]# cp /usr/local/lnmp/mysql/support-files/my-default.cnf /etc/my.cnfcp: overwrite `/etc/my.cnf'? y[root@server1 support-files]# cp mysql.server /etc/init.d//mysqld[root@server1 mysql]# useradd -u 27 -s /sbin/nologin mysql[root@server1 mysql]# id mysqluid=27(mysql) gid=500(mysql) groups=500(mysql)[root@server1 mysql]# groupmod -g 27 mysql[root@server1 mysql]# id mysqluid=27(mysql) gid=27(mysql) groups=27(mysql)[root@server1 mysql]# chown mysql.mysql -R .[root@server1 bin]# vim ~/.bash_profile 10 PATH=$PATH:$HOME/bin:/usr/local/lnmp/mysql/bin[root@server1 bin]# source ~/.bash_profile [root@server1 bin]# echo $PATH/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin:/usr/local/lnmp/mysql/bin[root@server1 bin]# mysql_install_db --user=mysql --basedir=/usr/local/lnmp/mysql/ --datadir=/usr/local/lnmp/mysql/data2017-09-04 08:27:16 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize2017-09-04 08:28:02 [WARNING] The bootstrap log isn't empty:2017-09-04 08:28:02 [WARNING] 2017-09-04T00:27:17.214976Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead2017-09-04T00:27:17.230484Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)2017-09-04T00:27:17.230496Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)[root@server1 mysql]# cd /usr/local/lnmp/mysql/data/[root@server1 data]# rm -fr *[root@server1 mysql]# mysqld --initialize2017-09-04T00:31:12.990906Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2017-09-04T00:31:12.990945Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.2017-09-04T00:31:12.990948Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.2017-09-04T00:31:14.787894Z 0 [Warning] InnoDB: New log files created, LSN=457902017-09-04T00:31:15.182023Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2017-09-04T00:31:15.310713Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 5c57b47d-9108-11e7-8027-52540079fd4a.2017-09-04T00:31:15.343125Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2017-09-04T00:31:15.343678Z 1 [Note] A temporary password is generated for root@localhost: :g;!QxwZS3Wm

[

root@server1 mysql]# mysqlERROR 2002 (HY000): Can't connect to local MySQL server through socket '/usr/local/lnmp/mysql/data/mysql.sock' (2)[root@server1 data]# /etc/init.d/mysqld startStarting MySQL.Logging to '/usr/local/lnmp/mysql/data/server1.err'. SUCCESS! [root@server1 data]# mysql -pEnter password: Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.7.17Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql> alter user root@localhost identified by 'Xsh+1203'    -> ;Query OK, 0 rows affected (0.00 sec)mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || performance_schema || sys                |+--------------------+4 rows in set (0.00 sec)[root@server1 data]# mysql_secure_installation -p   按提示完成安全设置Enter password: 然后一路y,除了改密码那项,或者根据提示选择你想要的

安装php

http://php.net/downloads.php

[root@server1 ~]# tar jxf php-5.6.20.tar.bz2 [root@server1 ~]# cd php-5.6.20[root@server1 php-5.6.20]# ./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-mysql --with-mysqli --with-openssl --with-pdo-mysql --enable-mysqlnd --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-pear --with-gettext --with-gmp --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~~~~~~~~~configure: error: xml2-config not found. Please check your libxml2 installation.[root@server1 php-5.6.20]# yum install -y libxml2-devel继续编译~~~~~~~~~~~~~configure: error: Please reinstall the libcurl distribution -    easy.h should be in <curl-dir>/include/curl/[root@server1 php-5.6.20]# yum install -y curl-devel继续编译~~~~~~~~~~~~~configure: error: jpeglib.h not found.[root@server1 php-5.6.20]# yum install -y libjpeg[root@server1 php-5.6.20]# yum install -y libjpeg-devel继续编译~~~~~~~~~~~~~checking for jpeg_read_header in -ljpeg... yesconfigure: error: png.h not found.[root@server1 php-5.6.20]# yum install -y libpng libpng-devel继续编译 ~~~~~~~~~~~~~If configure fails try --with-xpm-dir=<DIR>configure: error: freetype-config not found.[root@server1 php-5.6.20]# yum install -y freetype-devel继续编译 ~~~~~~~~~~~~~configure: error: Unable to locate gmp.h[root@server1 php-5.6.20]# yum install -y gmp-devel继续编译 ~~~~~~~~~~~~~configure: error: mcrypt.h not found. Please reinstall libmcrypt.yum源里没有这个依赖性,先去找包[root@server1 ~]# lscmake-2.8.12.2-4.el6.x86_64.rpm         mysql-5.7.17               nginx-1.12.0.tar.gzlibmcrypt-2.5.8-9.el6.x86_64.rpm        mysql-boost-5.7.17.tar.gz  php-5.6.20libmcrypt-devel-2.5.8-9.el6.x86_64.rpm  nginx-1.12.0               php-5.6.20.tar.bz2[root@server1 ~]# yum install -y libmcrypt-*继续编译~~~~~~~~~~~~~configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.[root@server1 php-5.6.20]# yum install -y net-snmp net-snmp-devel继续编译~~~~~~~~~~~~~[root@server1 php-5.6.20]# make[root@server1 php-5.6.20]# make install
[root@server1 php-5.6.20]# cd /usr/local/lnmp/php/[root@server1 php]# lsbin  etc  include  lib  php  sbin  var[root@server1 php]# cd etc/[root@server1 etc]# lspear.conf  php-fpm.conf.default[root@server1 etc]# cp php-fpm.conf.default php-fpm.conf[root@server1 php-5.6.20]# cp php.ini-production /usr/local/lnmp/php/etc/php.ini[root@server1 etc]# vim php.ini 1150 mysql.default_socket =/usr/local/lnmp/mysql/data/mysql.sock1209 mysqli.default_socket = /usr/local/lnmp/mysql/data/mysql.sock[root@server1 etc]# cd /root/php-5.6.20/sapi/fpm/[root@server1 fpm]# cp init.d.php-fpm /etc/init.d/php-fpm[root@server1 fpm]# chmod +x /etc/init.d/php-fpm[root@server1 etc]# /etc/init.d/php-fpm startStarting php-fpm [04-Sep-2017 20:40:58] ERROR: [pool www] cannot get uid for user 'nginx'[04-Sep-2017 20:40:58] ERROR: FPM initialization failed failed[root@server1 conf]# useradd -u 800 nginx [root@server1 conf]# /etc/init.d/php-fpm startStarting php-fpm  done[root@server1 conf]# vim /usr/local/lnmp/nginx/conf/nginx.conf 50         location / { 51             root   html; 52             index  index.php index.html index.htm; 53         } 72         location ~ \.php$ { 73             root           html; 74             fastcgi_pass   127.0.0.1:9000; 75             fastcgi_index  index.php; 76            #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name; 77             include        fastcgi.conf; 78         }[root@server1 html]# vim index.php<?phpphpinfo()?>

在浏览器测试,可以访问到index.php的内容
至此lanmp架构搭建完成

在nginx上安装一个论坛模块

[root@server1 ~]# yum install -y unzip[root@server1 ~]# lscmake-2.8.12.2-4.el6.x86_64.rpm         mysql-5.7.17               php-5.6.20Discuz_X3.2_SC_UTF8.zip                 mysql-boost-5.7.17.tar.gz  php-5.6.20.tar.bz2libmcrypt-2.5.8-9.el6.x86_64.rpm        nginx-1.12.0libmcrypt-devel-2.5.8-9.el6.x86_64.rpm  nginx-1.12.0.tar.gz[root@server1 ~]# unzip Discuz_X3.2_SC_UTF8.zip [root@server1 ~]# mv upload/ /usr/local/lnmp/nginx/html/bbs[root@server1 ~]# cd /usr/local/lnmp/nginx/html/bbs[root@server1 bbs]# lsadmin.php  config           data         home.php    misc.php    search.php  uc_clientapi        connect.php      favicon.ico  index.php   plugin.php  source      uc_serverapi.php    cp.php           forum.php    install     portal.php  static      userapp.phparchiver   crossdomain.xml  group.php    member.php  robots.txt  template[root@server1 bbs]# chmod 777 -R config/ data uc_client/ uc_server/

然后在浏览器里访问172.25.254.1/bbs,就可以到DISCUZ安装界面了不过会报错,说权限不够
[root@server1 bbs]# chmod 755 /usr/local/lnmp/mysql/data/
这下就可以跳到Discuz安装界面了

原创粉丝点击