004.测试解析php,安装discuz
一.配置解析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.填写数据库信息和管理员信息:
安装成功!
004.测试解析php,安装discuz的更多相关文章
- centos LAMP第二部分apache配置 下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转 配置apache的访问日志 配置静态文件缓存 配置防盗链 访问控制 apache rewrite 配置开机启动apache tcpdump 第二十节课
centos LAMP第二部分apache配置 下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转 配置apache的访问日志 配置静态文件缓存 配置防盗链 ...
- OpenWrt+nginx+php安装discuz
下面这个图片是本次的硬件资源:一个无线路由器的开发板,一个8G的u盘,一条手机的数据线(可以作为串口和供电使用),一条网线,一个USB Hub. <ignore_js_op> ...
- Linux安装Discuz
安装lamp环境 安装参考 安装Discuz 1.进入官网 2.进入Discuz! 程序发布 3.选择最新版本 4.进入git地址 5.克隆下载 5. 确认Apache中的DocumentRoot配置 ...
- 实战!基于lamp安装Discuz论坛-技术流ken
简介 我前面的博客已经详细介绍了lamp采用yum安装以及编译安装的方式,这篇博客将基于yum安装的lamp架构来实战安装Discuz论坛,你可以任选其一来完成. 系统环境 centos7.5 服务器 ...
- centos6.8安装Discuz!X3.1(PHP论坛)
1.首先搭建apache+mysql+php环境: 一.安装 MySQL 首先来进行 MySQL 的安装.打开超级终端,输入: [root@localhost ~]# yum install mysq ...
- CentOS7.x-lnmp环境下安装Discuz论坛
1.安装lnmp.这里采用一键安装的包 yum -y install wget wget http://soft.vpser.net/lnmp/lnmp1.6-full.tar.gz 2.加压安装ln ...
- 安装Discuz
1.下载Discuz 版本文件 http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip 2.下载PHP http://window ...
- 【阿里云产品公测】ACE安装Discuz超详细图文教程
作者:阿里云用户51干警网 hello.今天我们来在阿里云ACE上安装discuz. 因为本人不喜欢X3.2的版本,这次我使用的是DZX2.5. 首先的是准备工作: 一.申请阿里云ACE内测 http ...
- 本地安装discuz
出处:http://jingyan.baidu.com/article/b87fe19eb57ff252183568d9.html 网站建目前都很简单,建站容易,管理难,网站做大优化更难.本人有建站经 ...
随机推荐
- js修改不了input的值
奇怪的input 今天想做一个通过点击按钮,修改input值的控件,但是点击按钮后,input值变成修改的值后又变回了原来的值,百思不得其解,代码如下 <form> <div cla ...
- DX9入门笔记1-D3D初始化
对3D编程期待已久,却一直叶公好龙浅尝辄止.近期在公司实习却无具体的工作安排,琢磨着学习个新的手艺,就又想起了3D Programming.这次从大名鼎鼎的龙书(Introduction to 3D ...
- 轻松理解AOP思想(面向切面编程)
本文旨在帮助还没有理解AOP的童鞋看透弄懂AOP,也欢迎高手批评指正. 先说一个Spring是什么吧,大家都是它是一个框架,但框架这个词对新手有点抽象,以致于越解释越模糊,不过它确实是个框架的,但那是 ...
- EF框架组件详述【Entity Framework Architecture】(EF基础系列篇3)
我们来看看EF的框架设计吧: The following figure shows the overall architecture of the Entity Framework. Let us n ...
- Effective java笔记(四),泛型
泛型为集合提供了编译时类型检查. 23.不要在代码中使用原生态类型 声明中具有一个或多个类型参数的类或接口统称为泛型.List<E>是一个参数化类,表示元素类型为E的列表.为了提供兼容性, ...
- WCF 数据数据 DataTable
一般在WCf数据大数据是 List集合 或者 Json. public DataTable GetProperitybyModelCode(string modelCode) { using (var ...
- (1-1)文件结构的升级(Area和Filter知识总结) - ASP.NET从MVC5升级到MVC6
ASP.NET从MVC5升级到MVC6 总目录 MVC5项目结构 带有Areas和Filter的项目结构 一般来说,小的MVC项目是不考虑领域的,但是,如果是稍微复杂一点的项目,往往是需要领域这个概念 ...
- sqlserver 时间格式函数详细
一.时间函数 在使用存储过程,sql函数的时候,会遇到一些对时间的处理.比如时间的获取与加减.这里就用到了sql自带的时间函数.下面我列出这些函数,方便日后记忆,使用. --getdate 获取当前时 ...
- css遮罩代码(已验证)
#mask { background-color: rgb(0, 0, 0); display:none; opacity: 0.0; /* Safari, Opera */ -moz-opacity ...
- [修正] 移动平台曲线不平滑的问题(如:TRectangle, TPath...等)
问题:从 XE4 以来,Firemonkey 曲线绘图在移动平台不平滑的问题一直令人诟病,提交到官方的 QC 也是族繁不及备载,官方似乎有意的避开这个问题,迟迟没有修正. 适用版本:XE4 ~ Ber ...