一.配置解析php

编辑nginx配置文件/usr/local/nginx/conf/nginx.conf

[root@huh ~]# vim /usr/local/nginx/conf/nginx.conf

我们需要将php的配置行打开,找到这么几行:

        #location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

1.将"fastcgi_pass 127.0.0.1:9000;"改为“fastcgi_pass   unix:/tmp/www.sock;”

2.将“fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;”

改为"fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html$fastcgi_script_name;"

改动后的结果:

        location ~ \.php$ {
root html;
fastcgi_pass unix:/tmp/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
include fastcgi_params;
}

注:1./usr/local/nginx/html是网站根目录的所在,网页只有放在这儿才能被找到

  2.php当前监听的套接字文件为/tmp/www.sock,nginx通过这个文件和php通信

二.检查nginx配置是否正确,重新加载nginx

[root@huh ~]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@huh ~]#
[root@huh ~]# /usr/local/nginx/sbin/nginx -s reload

三.关闭防火墙selinux和iptables

关闭selinux:

[root@huh ~]# vim /etc/selinux/config
将"SELINUX=enforcing"配置行改为"SELINUX=disabled",保存退出!
[root@huh ~]# getenforce
Enforcing

注:getenforce是临时关闭selinux的命令

清空iptables的filter表:

[root@huh ~]# iptables -F
[root@huh ~]# /etc/init.d/iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables: [确定]

注:1."iptables -F" 命令将iptables的默认表filter表清空。

  2."/etc/init.d/iptables save"将当前规则保存

四.测试解析php

测试能否访问web主页:

[root@huh ~]# curl localhost -I
HTTP/1.1 200 OK

我们也可以使用浏览器去访问,在浏览器中输服务器IP地址即可!本次实验虚拟机IP为192.168.199.226)

测试解析php:

[root@huh ~]# cd /usr/local/nginx/html/
[root@huh html]# vim info.php
写入内容为:
<?php
    phpinfo();
?>

访问php文件:

http://192.168.199.226/info.php

php文件加载成功!

五.安装Discuz

下载解压discuz:

[root@huh ~]# mkdir /data/www
[root@huh ~]# cd /data/www
[root@huh www]# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip
[root@huh www]# unzip Discuz_X3.2_SC_GBK.zip
[root@huh www]# mv upload/* ./
[root@huh www]# rm -rf readme/ utility/ upload/ Discuz_X3.2_SC_GBK.zip

修改nginx配置文件,将其默认访问目录为/data/www:

[root@huh www]# vim /usr/local/nginx/conf/nginx.conf

1.找到如下配置行:

        location / {
root html;
index index.html index.htm;
}

并将其改为:

        root   /data/www;
index index.html index.htm index.php;

2.找到配置行"            fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html$fastcgi_script_name;"将其中的/usr/local/nginx/html替换为/data/www

保存退出!

[root@huh www]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@huh www]# /usr/local/nginx/sbin/nginx -s reload

浏览器再次使用ip地址访问,开始安装discuz!

六.discuz在web上的配置

1.显示Discuz安装向导后,点击我同意

2.在服务器上执行如下命令,将那些红叉消除:

[root@huh www]# cd /data/www/
[root@huh www]# chown -R php-fpm config data uc_client/data uc_server/data

3.点击下一步

4.选择全新安装discuz,点击下一步

5.在mysql上创建数据库和用户:

[root@huh ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
mysql> create database discuz;
Query OK, 1 row affected (0.00 sec) mysql> grant all on discuz.* to 'huh'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.01 sec) mysql> quit
Bye

6.填写数据库信息和管理员信息:

填写数据库信息:
  数据库服务器:localhost
  数据库名:discuz
  数据库用户名:huh
  数据库密码:123456
  ***(其它保持不变)
填写管理员信息
  管理员账号:admin
  管理员密码:123456
  重复密码:123456

安装成功!

004.测试解析php,安装discuz的更多相关文章

  1. centos LAMP第二部分apache配置 下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转 配置apache的访问日志 配置静态文件缓存 配置防盗链 访问控制 apache rewrite 配置开机启动apache tcpdump 第二十节课

    centos    LAMP第二部分apache配置  下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转  配置apache的访问日志  配置静态文件缓存  配置防盗链 ...

  2. OpenWrt+nginx+php安装discuz

    下面这个图片是本次的硬件资源:一个无线路由器的开发板,一个8G的u盘,一条手机的数据线(可以作为串口和供电使用),一条网线,一个USB Hub. <ignore_js_op>        ...

  3. Linux安装Discuz

    安装lamp环境 安装参考 安装Discuz 1.进入官网 2.进入Discuz! 程序发布 3.选择最新版本 4.进入git地址 5.克隆下载 5. 确认Apache中的DocumentRoot配置 ...

  4. 实战!基于lamp安装Discuz论坛-技术流ken

    简介 我前面的博客已经详细介绍了lamp采用yum安装以及编译安装的方式,这篇博客将基于yum安装的lamp架构来实战安装Discuz论坛,你可以任选其一来完成. 系统环境 centos7.5 服务器 ...

  5. centos6.8安装Discuz!X3.1(PHP论坛)

    1.首先搭建apache+mysql+php环境: 一.安装 MySQL 首先来进行 MySQL 的安装.打开超级终端,输入: [root@localhost ~]# yum install mysq ...

  6. CentOS7.x-lnmp环境下安装Discuz论坛

    1.安装lnmp.这里采用一键安装的包 yum -y install wget wget http://soft.vpser.net/lnmp/lnmp1.6-full.tar.gz 2.加压安装ln ...

  7. 安装Discuz

    1.下载Discuz 版本文件 http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip 2.下载PHP http://window ...

  8. 【阿里云产品公测】ACE安装Discuz超详细图文教程

    作者:阿里云用户51干警网 hello.今天我们来在阿里云ACE上安装discuz. 因为本人不喜欢X3.2的版本,这次我使用的是DZX2.5. 首先的是准备工作: 一.申请阿里云ACE内测 http ...

  9. 本地安装discuz

    出处:http://jingyan.baidu.com/article/b87fe19eb57ff252183568d9.html 网站建目前都很简单,建站容易,管理难,网站做大优化更难.本人有建站经 ...

随机推荐

  1. 新浪云SAE使用入门,教你如何发布自己的网站

    新浪云sae是一个免费的web服务器,SAE的Web服务器采用分布式部署的方式,开发者将代码部署到SAE前端机后,会通过同步的方式,将代码部署到SAE所有的Web服务器.相当于在每一台Web服务器上都 ...

  2. .Net 开源项目资源大全

    伯乐在线已在 GitHub 上发起「DotNet 资源大全中文版」的整理.欢迎扩散.欢迎加入. https://github.com/jobbole/awesome-dotnet-cn (注:下面用 ...

  3. CSS3梅花三弄特效

    效果预览:http://hovertree.com/texiao/js/22/ 效果图: 代码如下: <html> <head> <meta http-equiv=&qu ...

  4. Andriod小项目——在线音乐播放器

    转载自: http://blog.csdn.net/sunkes/article/details/51189189 Andriod小项目——在线音乐播放器 Android在线音乐播放器 从大一开始就已 ...

  5. 解决jdk1.8上编译dubbo失败

    首先从https://github.com/alibaba/dubbo/archive/master.zip下载最新源码,目前最新版本为2.5.4-SNAPSHOT. 我使用的是JDK 1.8.0_0 ...

  6. 推荐15款创建漂亮幻灯片的 jQuery 插件

    对于设计师,开发者,摄影师或任何创造性的个人和企业,他们自己的网站是展示他们的技能和服务的最佳场所.你可能打算设计一个新的个人作品网站,不管你是从头开始或使用模板,都会需要使用 jQuery 幻灯片插 ...

  7. 使用requireJS的shim参数 解决插件 jquery.ui 等插件问题

    没有requireJS框架之前,如果我们想使用jquery框架,会在HTML页面中通过<script>标签加载, 这个时候jquery框架生成全局变量$和jQuery等全局变量.如果项目中 ...

  8. jQuery - 全国省市县三级联动

    最近有空用jquery做了一个全国省市县的三级联动,在以后或许可以用的到 ,遗憾的是我还没用封装,等有空看能不能封装成一个插件 废话不多说,贴上代码: <!doctype html> &l ...

  9. SharePoint 快捷获取列表栏内部名称

    在列表设置页面点击浏览器书签获取列表字段内部名称,使用效果如下图: 如何使用: 修改浏览器上任意书签的url地址为以下代码,注意:代码中不能有换行符 javascript:(function(){va ...

  10. Metasploit各版本对比

    功能特性   描述 Metasploit  Framework Metasploit  Community Metasploit  Express Metasploit Pro Pricing     ...