我是靠谱客的博主 无语鼠标,这篇文章主要介绍搭建edusoho,现在分享给大家,希望可以做个参考。

目录

服务器系统
更新第三方源并升级系统
安装和配置Nginx
安装和配置PHP
安装MySql创建EduSoho数据库
安装EduSoho
安装discuz

​ 服务器系统

#服务器系统
#系统:阿里云centos6.8_64

​ 更新第三方源并升级系统
(CentOS默认的标准源里没有nginx软件包)

安装CentOS第三方yum源
#安装下载工具wget
yum install wget
#下载atomic yum源

复制代码
1
wget http://www.atomicorp.com/installers/atomic

#安装

复制代码
1
sh ./atomic

 

升级CentOS系统
#更新yum软件包

复制代码
1
yum check-update

#更新系统

复制代码
1
yum update

关闭防火墙 

阿里云的防火墙默认是关闭的,要控制端口可以去设置安全组
#检测防火墙是否关闭

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
[root@hy ~]# getenforce Disabled [root@hy ~]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination

​ 安装和配置Nginx

复制代码
1
yum install nginx

 

#启动

复制代码
1
service nginx start

 

#设为开机启动

复制代码
1
2
3
chkconfig nginx on vi /etc/nginx/nginx.conf

 

在http{}配置中加入:

复制代码
1
client_max_body_size 1024M;

 


​ 添加配置文件

复制代码
1
vi /etc/nginx/conf.d/edusoho.conf

 



加入以下配置:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
server { listen 80; server_name ip; root /usr/share/nginx/edusoho/web; access_log /var/log/nginx/edusoho.access.log; error_log /var/log/nginx/edusoho.error.log; location / { index app.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } location ~ ^/udisk { internal; root /usr/share/nginx/edusoho/app/data/; } location ~ ^/(app|app_dev).php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect; fastcgi_param HTTP_X-Accel-Mapping /udisk=/usr/share/nginx/edusoho/app/data/udisk; fastcgi_buffer_size 128k; fastcgi_buffers 8 128k; } location ~* .(jpg|jpeg|gif|png|ico|swf)$ { expires 3y; access_log off; gzip off; } location ~* .(css|js)$ { access_log off; expires 3y; } location ~ ^/files/.*.(php|php5)$ { deny all; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; include fastcgi_params; } }


#重启nginx

复制代码
1
/etc/init.d/nginx restart

 

## 安装和配置PHP

配置安装包源

复制代码
1
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

 

安装PHP和相关插件  

复制代码
1
yum install -y php55w php55w-cli php55w-curl php55w-fpm php55w-intl php55w-mcrypt php55w-mysql php55w-gd php55w-mbstring php55w-xml php55w-dom


修改PHP配置  
#编辑php.ini , 将以下配置的值修改为1024M

复制代码
1
2
3
4
vi /etc/php.ini post_max_size = 1024M memory_limit = 1024M upload_max_filesize = 1024M

 



配置PHP-FPM 
#启动php-fpm

复制代码
1
/etc/rc.d/init.d/php-fpm start

 

#设置开机启动

复制代码
1
chkconfig php-fpm on

安装MySql创建EduSoho数据库

安装MySql
#询问是否要安装,输入Y即可自动安装,直到安装完成

复制代码
1
yum install mysql mysql-server

 

#拷贝配置文件(注意:如果/etc目录下面默认有一个my.cnf,直接覆盖即可)

复制代码
1
cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

#启动MySQL

复制代码
1
/etc/init.d/mysqld start

 

#设为开机启动

复制代码
1
chkconfig mysqld on

 

#mysql进入数据库,设置密码(安装完默认密码为空)

复制代码
1
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('initpassword');

 

创建EduSoho数据库 
#登录数据库

复制代码
1
mysql -uroot -pinitpassword

 

#创建数据库及账号

复制代码
1
2
3
CREATE DATABASE edusoho DEFAULT CHARACTER SET utf8 ; GRANT ALL PRIVILEGES ON `edusoho`.* TO 'esuser'@'localhost' IDENTIFIED BY 'edusoho'; quit;

 

注意:这里为edusoho数据库创建了一个用户名,用户名为:esuser,密码为edusoho,在后面安装的第三步需要用到,不建议直接填写root账户。 


下载和解压EduSoho

复制代码
1
2
3
4
cd /usr/share/nginx wget http://download.edusoho.com/edusoho-Version.tar.gz (注:将VERSION替换为当前EduSoho最新版本号,可从官网www.edusoho.com查询获取) tar zxvf edusoho-Version.tar.gz chown apache:apache edusoho/ -Rf

 

​ 配置完成后,请使用ip访问安装,浏览器输入ip回车后自动跳转到**EduSoho**安装界面  

安装discuz

获取discuz源码

复制代码
1
2
3
4
5
6
7
8
/usr/share/nginx mkdir discuz cd !$ wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip yum install unzip -y unzip Discuz_X3.2_SC_UTF8.zip mv upload/* . rm -rf Discuz_X3.2_SC_UTF8.zip upload/ utility/ readme/

 


配置nginx

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
vim discuz.conf server { #监听端口 listen 8000; #服务器文件目录 root /usr/share/nginx/discuz; #首页文件 index index.html index.php; #域名 server_name www.test.com www.test2.com; #php解析 location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/discuz$fastcgi_script_name; include fastcgi_params; } }

 


# 检测nginx配置是否正确

复制代码
1
nginx -t

 

#重载nginx服务

复制代码
1
nginx -s reload

 

配置数据库

复制代码
1
2
3
create database discuz; grant all on discuz.* to 'discuz'@'localhost' identified by 'discuz'; chmod -R 777 data uc_server/data/ uc_client/data config

 

**安装discuz**

访问ip:8000,自动跳转到到**discuz**安装页面

转载于:https://www.cnblogs.com/herosyuan/p/9792210.html

最后

以上就是无语鼠标最近收集整理的关于搭建edusoho的全部内容,更多相关搭建edusoho内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(59)

评论列表共有 0 条评论

立即
投稿
返回
顶部