004.测试解析php,安装discuz

一.配置解析php

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

[[email protected] ~]# 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

[[email protected] ~]# /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
[[email protected] ~]#
[[email protected] ~]# /usr/local/nginx/sbin/nginx -s reload

三.关闭防火墙selinux和iptables

关闭selinux:

[[email protected] ~]# vim /etc/selinux/config将"SELINUX=enforcing"配置行改为"SELINUX=disabled",保存退出![[email protected] ~]# getenforceEnforcing

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

清空iptables的filter表:

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

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

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

四.测试解析php

测试能否访问web主页:

[[email protected] ~]# curl localhost -I
HTTP/1.1 200 OK

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

测试解析php:

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

访问php文件:

http://192.168.199.226/info.php

php文件加载成功!

五.安装Discuz

下载解压discuz:

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

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

[[email protected] 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

保存退出!

[[email protected] 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
[[email protected] www]# /usr/local/nginx/sbin/nginx -s reload

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

六.discuz在web上的配置

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

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

[[email protected] www]# cd /data/www/
[[email protected] www]# chown -R php-fpm config data uc_client/data uc_server/data

3.点击下一步

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

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

[[email protected] ~]# 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

安装成功!

时间: 2024-08-10 19:11:18

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

peak学Linux--基于centos 6.5搭建LAMP并安装Discuz X3.2

实验环境: VMware Workstation 10.0.0 build-1295980 centos 6.5 32位(系统ip:192.168.10.50,与物理机桥接,保证可以上外网) 所需的压缩包及下载地址 mysql-5.1.72-linux-i686-glibc23 http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.72-linux-i686-glibc23.tar.gz php-5.3.28 http://mirrors.sohu.

在centos6系统上基于session绑定实现nat模型的lvs集群,并在RS上安装Discuz论坛

实验环境:四台虚拟机,安装的操作系统是CentOS6.5,各自的功能及IP地址如下: Director: eth0 192.168.2.1(作为VIP使用),eth1:10.0.0.1(作为DIP使用) RS1: eth0:10.0.0.2 RS2: eth0:10.0.0.3 数据库服务器:安装的mariadb eth0:10.0.0.4 拓扑图: 实验步骤: 一准备数据库服务器,安装mariadb,创建一个用于远程连接数据库的用户,创建一个数据库,用于两台RS服务器连接时使用,授权给该用户对

关于本地安装discuz,上传图片sever(IO) error错误

在安装discuz成功后,上传图片时提示server (IO) error错误!!! 1. 查看错误日志error.log,发现如下错误: 09:18:01 [error] 1966#0: *50 open() " /application/nginx-1.6.3//html/bbs/static/js/common_postimg.js"failed (2: No such file or directory) , client: 10.0.0.1, server:bbs.etian

LAMP平台部署及应用(二) 安装Discuz!论坛系统

LAMP平台部署及应用(二) 安装Discuz!论坛系统 具体步骤: n 服务器端的部署 1. 准备工作 首先,应准备一台能够解析PHP网页,支持数据库的网站服务器,其中Apache.PHP.MySQL组件的版本应符合Discuz!系统的最低要求,这里此前源码编译构建的LAMP平台为例,默认首页设置为index.php. 其次,应确定论坛服务器的域名,IP地址以及访问论坛的URL地址.Discuz!论坛支持作为独立的网站运行,如://bbs.benet.com:也可以作为网站的一个目录,如://

lamp编译安装+discuz+禅道

所需软件自行准备 systemctl stop firewalld setenforce 0 1.编译安装httpd yum install -y net-tools  pcre-devel zlib-devel apr apr-devel  apr-util  apr-util-devel gcc-c++ tar -xf  httpd-2.4.25.tar.gz cd httpd-2.4.25/ ./configure --prefix=/usr/local/apache  --with-my

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

1.简介 我前面的博客已经详细介绍了lamp采用yum安装以及编译安装的方式,这篇博客将基于yum安装的lamp架构来实战安装Discuz论坛,你可以任选其一来完成. 2.系统环境 centos7.5 服务器IP:172.20.10.7/28 客户端IP:172.20.10.4/28 3.关闭安全服务 [[email protected] ~]# setenforce 0 4.安装lamp [[email protected] ~]# yum install httpd php php-mysq

脚本安装Discuz论坛(shell + Python 实现自动化安装)

实验环境 1.shell 脚本:linux centos 7 系统2.Python shell 脚本:window 系统 3.其他:python selenium 模块,谷歌浏览器, 谷歌浏览器驱动.4.discuz 链接:https://pan.baidu.com/s/1vOwN_f56wJlIzauGrFoR1Q 提取码:mijf 实验步骤 1.上传discuz包到Linux系统/opt目录下 方法一:挂载 方法二:通过Xftp软件上传 2.编写脚本package.sh (可查看上一篇博客,

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

1.安装lnmp.这里采用一键安装的包 yum -y install wget wget http://soft.vpser.net/lnmp/lnmp1.6-full.tar.gz 2.加压安装lnmp,具体参考官网安装:https://lnmp.org/install.html 解压包:tar  zxvf  lnmp1.6-full.tar.gz 进入包,执行安装脚本: 选择安装需要版本的软件 检查是否安装成功,有没有进程 ps aux|grep  nginx ps aux|grep  ph

对于最近测试LYNC2013的安装记录

最近上班,突然想测试下微软最新的lync2013系统,于是说做就做,在虚机下准备了下环境,此次测试是前后端的架构,暂时未测试Edge的架构,测试的架构如下图 本次测试环境 DC为windows server2012系统的域架构 后端数据库安装的SQL2008 R2,采用的是默认实例 Lync2013的前端是安装的Windows server2012系统 1:首先配置机器的网络及系统的权限,此次使用的是最高管理员权限登陆各系统. 2:由于我们安装的是前后端架构,我这边先准备了SQL后端数据库,先单