优米云盘linux版安装手册
Tofloor
poster avatar
‌量子巡游者
Moderator
2018-04-17 20:34
Author
本帖最后由 MMDMM 于 2020-6-10 11:52 编辑

优米云盘linux版安装手册

发布于:2018年3月31日下午9:01
优米云盘linux版安装手册
以下安装是在root用户下进行,用户最好具备基本的linux知识

一、安装libreoffice
  1. yum install libreoffice-headless
    yum install libreoffice-writer
    yum install libreoffice-impress
    yum install libreoffice-calc
    yum install libreoffice-draw
    yum install libreoffice-langpack-zh-Hans
Copy the Code

二、安装mysql

centos7默认没有mysql的源
首先安装wget
  1. yum install wget
Copy the Code
安装mysql-community-release-el7-5.noarch.rpm包
  1. rpm -ivh mysql-community-release-el7-5.noarch.rpm
Copy the Code
安装这个包后,会获得两个mysql的yum repo源:
  1. /etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo。
Copy the Code

安装mysql
  1. yum install mysql-server
    yum install mysql-devel
Copy the Code

重置密码:
  1. chown -R root:root /var/lib/mysql
    service mysqld restart
  2. mysql -u root
mysql > use mysql;
  • mysql > update user set password=password(‘123456′) where user=’root’;
  • mysql > FLUSH PRIVILEGES;
  • mysql > exit;
    Copy the Code

    三、安装apache
    1. yum install httpd
    Copy the Code
    启动apache
    1. systemctl start httpd
    Copy the Code
    (默认系统重启后apache没有自动启动,请自行设置一下)

    防火墙开启80端口
    1. firewall-cmd –zone=public –add-port=80/tcp –permanent
      systemctl stop firewalld.service
      systemctl start firewalld.service
    Copy the Code

    现在可以在外网访问web服务了

    四、安装php

    由于php需要phalcon扩展,而这个扩展必须要求5.6及以上版本,centos7自带的是5.4版本,所以不能用centos7自带的php包
    如果系统已经装了php5.6以下版本,请先删除,参考这个贴子
    1. rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
      yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64
      yum install php56w-devel
    Copy the Code

    五、下面编译安装phalcon

    先安装必要的工具:
    1. yum install gcc libtool pcre-devel git
      git clone –depth=1 “git://github.com/phalcon/cphalcon.git”
    Copy the Code
    (或直接在github上下载压缩包,这样速度快点)
    1. cd cphalcon/build
      ./install
    Copy the Code
    安装后在ini文件中添加扩展:在/etc/php.d/目录下新建phalcon.ini,里面加上extension=phalcon.so



    Reply Favorite View the author
    All Replies
    avatar
    ‌量子巡游者
    Moderator
    2018-04-17 20:35
    #1
    本帖最后由 MMDMM 于 2020-6-10 11:56 编辑

    六、apahce设置
    需要做两件事情:
    1、开启伪静态
    修改/etc/httpd/conf/httpd.conf文件
    1. #
      # Possible values for the Options directive are “None”, “All”,
      # or any combination of:
      #  Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
      #
      # Note that “MultiViews” must be named *explicitly* — “Options All”
      # doesn’t give it to you.
      #
      # The Options directive is both complicated and important.  Please see
      # for more information.
      #
      Options Indexes FollowSymLinks
      #
      # AllowOverride controls what directives may be placed in .htaccess files.
      # It can be “All”, “None”, or any combination of the keywords:
      #  Options FileInfo AuthConfig Limit
      #
      AllowOverride None
      #
      # Controls who can get stuff from this server.
      #
      Require all granted
      >
    Copy the Code
    把:AllowOverride None 改成:AllowOverride All 再重启apache systemctl restart httpd

    2、做反向代理,优米云服务可通过apache被外网访问,这样就不需要对外提供两个端口了(本手册中只需要80端口就可以客户端登录及网页后台登录了)
    做反向代理需在etc/httpd/conf.d/目录下新增一个文件proxy.conf
    加入以下内容:
    1. ProxyRequests Off
      ProxyPass /app/file http://127.0.0.1:1891/app/file
      ProxyPassReverse /app/file http://127.0.0.1:1891/app/file
      ProxyPass /app/notice http://127.0.0.1:1891/app/notice
      ProxyPassReverse /app/notice http://127.0.0.1:1891/app/notice
      ProxyPass /app/user http://127.0.0.1:1891/app/user
      ProxyPassReverse /app/user http://127.0.0.1:1891/app/user
    Copy the Code

    注意:1891端口是优米云服务的端口,没特殊需要不要改动
    另外,不要直接把 http://127.0.0.1:1891/app
    做反向代理,这会把服务器的一些内部通讯暴露给外网,增加系统隐患。

    七、关闭centos自带的SELinux
    SELinux的安全机制极为严格,且使用白名单机制,如没特殊需求请关闭,若不想关闭请自行研究如何配置
    如何关闭请参考这篇文章

    八、安装sphinx
    sphinx是一个全文搜索引擎,采用编译安装
    1. wget http://sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz
      tar xzvf sphinx-2.2.11-release.tar.gz
      cd sphinx-2.2.11-release
    Copy the Code
    在centos7上需要修改一个文件才能正常使用,修改config/config.h文件,在最后一行加上:#define USE_LITTLE_ENDIAN = 1,然后再开始
    1. ./configure –prefix=/usr/local/sphinx/
      make
      make install
    Copy the Code

    如果make遇到错误,先安装编译器
    1. yum install gcc gcc-c++
    Copy the Code


    Reply View the author
    avatar
    Lyvnee
    deepin
    2018-04-18 00:51
    #2
    在deepin论坛用yum安装不怕被打吗?
    Reply View the author
    avatar
    180******16
    deepin
    2018-04-18 01:09
    #3
    这是个广告
    Reply View the author
    avatar
    司南
    deepin
    2018-04-18 02:04
    #4
    必须要用root吗?
    Reply View the author