CentOS7.5(LAMP环境)部署FileRun个人网盘系统---超详细,一看就会系列

FileRun个人网盘介绍

在以往我使用的都是OwnCloud私人网盘。但随着需求的增加和文件的增多,OwnCloud慢慢的有点"力不从心",不仅下载速度有所下降,而且还经常出现加载不出来的情况。因此我发现了FileRun个人网盘,发现FileRun的性能挺好,界面整洁美观。并且FileRun内部集很多插件,支持上百种文档编辑,并且自带编辑器功能,可以在线编辑。而且稳定。支持各种客户端。因此打算使用使用FileRun体验一下。

说明:本人也是参考官方文档完成部署。
官网地址:https://filerun.com/
CentOS7安装官网地址:http://blog.filerun.com/how-to-install-filerun-on-centos-7/
在这里插入图片描述

环境说明

CentOS7.5
Win10
VmWare16
采用LAMP(apache+mariadb+php)环境:MariaDB10(不要小于5.7版本),PHP7.4(不要小于5.6版本,7版本的性能更好)
虚拟机需要能连接外网

开始部署

基础环境配置

说明:关闭firewalld(防火墙),关闭selinux,清除iptable规则
1、关闭firewalld(防火墙)

systemctl stop firewalld
systemctl disable firewalld

2、关闭selinux

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

3、清除iptable规则

iptables -F
iptables -X
iptables -Z
/usr/sbin/iptables-save

安装Apache

yum install -y httpd
systemctl restart httpd.service      #启动Apache
systemctl enable httpd               #设置开机自启

这里访问本地ip可以检测apache的效果,不再演示。

安装 MariaDB 10

说明:FileRun 需要 MariaDB 10 或 MySQL 版本 5.7(或更高版本)。鉴于 CentOS 7 默认提供了较旧的 MariaDB/MySQL,我们首先需要更新 yum 存储库。

1、更新Yum仓库

[root@node3 ~]# vi /etc/yum.repos.d/MariaDB10.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2、安装MariaDB10

yum install -y mariadb-server mariadb
systemctl restart mariadb           #启动MariaDB服务
systemctl enable mariadb            #设置开机自启

3、初始化MariaDB

[root@node3 ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):              #直接回车
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
 
Set root password? [Y/n] y                       #是否给root用户设置密码
New password:                                    #设置root密码 
Re-enter new password:                           #确认密码
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y                   #直接y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y            #直接y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y       #直接y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y             #直接y
 ... Success! 

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

4、使用root用户账号创建FileRun 数据库和将访问它的用户帐户,并设置FileRun用户权限

[root@node3 ~]# mysql -u root -p123456                #root,密码123456,进入MariaDB
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.1.48-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>CREATE DATABASE filerun;           #创建filerun数据库
MariaDB [(none)]> GRANT ALL ON filerun.* to 'filerun'@'localhost' IDENTIFIED BY 'YOUR-DB-PASSWORD';   #创建filerun用户,并设置其权限
MariaDB [(none)]> FLUSH PRIVILEGES;                 #刷新操作
MariaDB [(none)]> exit                              #退出MariaDB

安装 PHP-FPM 7.4

说明:FileRun 需要 PHP 版本 7.1 或更高版本。鉴于 CentOS 7 默认提供较旧的 PHP 版本 5.4,我们首先需要更新 yum 存储库:
1、更新php的Yum仓库

yum install -y epel-release yum-utils
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm

2、启用PHP 7.4 Remi 存储库:

yum-config-manager --enable remi-php74

3、安装PHP 7.4:

yum install -y php-fpm php        

4、启动php服务

systemctl enable php-fpm.service
systemctl restart php-fpm.service

5、检测php服务是否开启。php默认监听的端口9090,只要9090端口开启则PHP服务可以

[root@node3 ~]# ss -ntpul
...
tcp    LISTEN     0      128                          127.0.0.1:9000                                             *:*                   users:(("php-fpm",pid=2121,fd=8),("php-fpm",pid=2120,fd=8),("php-fpm",pid=2119,fd=8),("php-fpm",pid=2118,fd=8),("php-fpm",pid=2117,fd=8),("php-fpm",pid=2116,fd=6))
...

将httpd和php连接起来

1、为了使Apache与PHP-FPM一起工作,我们可以在每个应该使用PHP-FPM的指令中使用该指令(参见 http://wiki.apache.org/httpd/PHP-FPM)。
我们通过编辑Apache配置文件来做到这一点。

vi /etc/httpd/conf/httpd.conf
#直接在给文件的末尾,添加如下内容:
<IfModule proxy_module>  
  ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/$1       #意思是进行PHP文件的匹配,并指定php解释器的位置。
</IfModule>

如下:
在这里插入图片描述
2、接下来,在同一配置文件中,找到指令并追加:DirectoryIndexindex.php

vi /etc/httpd/conf/httpd.conf
...
<IfModule dir_module>
    DirectoryIndex index.html index.php             #这道此指令,并添加:"index.php"内容,意思是是https检索以.php结尾的文件
</IfModule>
...

如下:
在这里插入图片描述
3、重新启动Apache,现在PHP已经安装好了。(如果重启失败,就是以上步骤做错了)

systemctl restart httpd.service

配置PHP

说明:想要运行FileRun服务需要众多PHP模块,(最重要的模块是ioncube)
1、使用Yum安装部分模块

yum install -y php-imagick php-mbstring php-opcache php-pdo php-mysqlnd php-gd php-xml php-zip

2、由于存储库中未包含ioncube模块,所以使用压缩包安装

cd /usr/lib64/php/modules
yum install -y wget
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz --no-check-certificate  #下载ioncube模块的安装包   #这个如果报错,检查网络。
tar xvfz ioncube_loaders_lin_x86-64.tar.gz            #解压安装包

配置FileRun 所需的所有设置

说明:创建个文件,该文件将由 PHP 自动附加到其配置中。
1、这一步就是设置FileRun所需要的php配置。

vi /etc/php.d/01_filerun.ini
#添加如下内容:
expose_php              = Off  
error_reporting         = E_ALL & ~E_NOTICE  
display_errors          = Off  
display_startup_errors  = Off  
log_errors              = On  
ignore_repeated_errors  = Off  
allow_url_fopen         = On  
allow_url_include       = Off  
variables_order         = "GPCS"  
allow_webdav_methods    = On  
memory_limit            = 128M  
max_execution_time      = 300  
output_buffering        = Off  
output_handler          = ""  
zlib.output_compression = Off  
zlib.output_handler     = ""  
safe_mode               = Off  
register_globals        = Off  
magic_quotes_gpc        = Off  
upload_max_filesize     = 20M  
post_max_size           = 20M  
enable_dl               = Off  
disable_functions       = ""  
disable_classes         = ""  
session.save_handler     = files  
session.use_cookies      = 1  
session.use_only_cookies = 1  
session.auto_start       = 0  
session.cookie_lifetime  = 0  
session.cookie_httponly  = 1  
date.timezone            = "UTC"

zend_extension = /usr/lib64/php/modules/ioncube/ioncube_loader_lin_7.4.so

注意:您可以在此处找到最新的 FileRun 推荐 PHP 设置:https://docs.filerun.com/php_configuration

2、重新启动 PHP-FPM 服务使其生效

systemctl restart php-fpm.service

安装FileRun

1、下载文件在 Web 服务器的根文件夹中运行 :/var/www/html/

cd /var/www/html/
wget -O FileRun.zip https://filerun.com/download-latest-centos-7 --no-check-certificate      #下载FileRun安装包

2、解压缩 FileRun 安装包:

yum install -y unzip
unzip FileRun.zip               #解压FileRun.zip安装包
mv FileRun.zip /root/           #移除没必要的安装包

3、由于 root 用户拥有的其他文件和文件夹将无法由 Apache 写入,所以调整文件夹权限以允许 Apache 写入 FileRun 临时数据文件夹。:

chown -R apache:apache system/data/
#如果没有关闭selinux,执行如下命令:
chcon -t httpd_sys_rw_content_t -R system/data

浏览器访问FileRun,并初始配置FileRun

1、浏览器输入:192.168.9.132
在这里插入图片描述

2、单击以继续。查看服务器要求检查,并确保没有红色错误消息:Next
在这里插入图片描述
3、单击以继续数据库连接设置:
在这里插入图片描述

4、记住超级用户(superuser)和它的初始密码,切记:一定要记住此密码。
在这里插入图片描述
5、使用superuser超级用户和初始密码登陆:
在这里插入图片描述

设置新的superuser密码

1、一进去FileRun的主界面,系统就会让你重新设置superuser用户的密码
点击"ok":
在这里插入图片描述
在这里插入图片描述

汉化FileRun

进到FileRun主页面之后发现全是英文,很不爽,因此汉化(但也只能汉化个60%)。
汉化需要个汉化包:
https://www.itheader.com/wp-content/uploads/2020/03/chinese.zip(这个我也是从网上找的,有点老2020年的,但是能用)
下载到Win之后,解压,会有个:"chinese.php"文件,稍后会用到。
在这里插入图片描述

在这里插入图片描述
然后刷新页面,会看到已经汉化成功:
效果如下:虽说不明显,但是有总比没有强。
在这里插入图片描述

给FileRun办法SSL证书使其安全连接

由于我没有域名,不在颁发SSL证书,如果有需要,后续在更新此操作。

配置FileRun文件存储路径

说明:首次登录时,系统将提示您使用主文件夹配置 FileRun 超级用户帐户。将主文件夹路径设置为指向位于 Web 服务器公共区域的文件夹。
您可以创建一个文件夹并将所有FileRun文件存储在那里:比如:/opt/目录下,这里就以/opt/目录为例。
注意:如果没有这一步将不能上传文件等一系列操作。

1、将/opt/目录作为存储路径,并设置此目录的用户和用户组都为apache

chown -R apache:apache /opt/

2、Web界面配置/opt/目录
在这里插入图片描述

3、重新登陆192.168.9.132
可以看到已经能上传文件了:
在这里插入图片描述
下面创建个a目录,并上传个文件,如果能上传表示成功。
到此FileRun就能上传文档,图片,视频,音乐了。
下面的图片,视频,音乐之后在文件夹中上传才会看到。

安装图像磁性

我们在实现个复杂的功能:生成缩略图
要为图像文件,摄影文件甚至PDF文档生成缩略图时可以用到这个功能。

wget https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm --no-check-certificate
rpm -Uvh rpmfusion-free-release*rpm
yum install -y libheif
yum install -y ImageMagick*

Web界面配置:
在这里插入图片描述

看看FileRun集成的插件

在这里插入图片描述

在这里插入图片描述

可以看到还是很丰富的,因此FileRun用起来更加方便。关于FileRun还有很多操作,后续更新…

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

让我三行代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值