Centos 7 部署Seafile+Nginx

Centos 7 部署Seafile+Nginx

我们之前简单部署了Seafile服务器,如今在Seafile的基础上使用Openssl+Nginx反向代理8000端口部署。

82  cd /usr/src
   84  wget https://www.openssl.org/source/openssl-1.1.0c.tar.gz
   85  wget http://nginx.org/download/nginx-1.10.2.tar.gz
   86  tar xzf nginx-1.10.2.tar.gz && mv nginx-1.10.2.tar.gz ~
   87  tar xzf openssl-1.1.0c.tar.gz && mv openssl-1.1.0c.tar.gz ~

89  cd nginx-1.10.2
   90  ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-openssl=/usr/src/openssl-1.1.0c --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_v2_module --with-ipv6

92  make && make install
   94  useradd -s /sbin/nologin -M nginx
   95  mkdir -p /var/cache/nginx/

98  openssl genrsa -out privkey.pem 2048
   99  openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095    /*按回车后可以随便填写内容*/

101  vi /etc/nginx/nginx.conf    /*按回车后注释以下内容-并添加内容*/



/*注释内容如下*/

#    server {
#        listen       80;
#        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;

#        location / {
#            root   html;
#            index  index.html index.htm;
#        }

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
        #
#        error_page   500 502 503 504  /50x.html;
#        location = /50x.html {
#            root   html;
#        }

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #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;
        #}

# deny access to .htaccess files, if Apache‘s document root
        # concurs with nginx‘s one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
#    }

/*添加内容如下*/

server {
      listen       80;
      server_name  seafile.abc.com;        #自己的域名
      rewrite ^ https://$http_host$request_uri? permanent;    #强制将http重定向到https
    }
    server {
      listen 443;
      ssl on;
      ssl_certificate /etc/ssl/cacert.pem;           #cacert.pem 文件路径
      ssl_certificate_key /etc/ssl/privkey.pem;      #privkey.pem 文件路径
      server_name seafile.abc.com;        #自己的域名                    
      proxy_set_header X-Forwarded-For $remote_addr;
      location / {
          fastcgi_pass    127.0.0.1:8000;    #端口号
          fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
          fastcgi_param   PATH_INFO           $fastcgi_script_name;

fastcgi_param   SERVER_PROTOCOL    $server_protocol;
          fastcgi_param   QUERY_STRING        $query_string;
          fastcgi_param   REQUEST_METHOD      $request_method;
          fastcgi_param   CONTENT_TYPE        $content_type;
          fastcgi_param   CONTENT_LENGTH      $content_length;
          fastcgi_param   SERVER_ADDR         $server_addr;
          fastcgi_param   SERVER_PORT         $server_port;
          fastcgi_param   SERVER_NAME         $server_name;
          fastcgi_param   HTTPS               on;
          fastcgi_param   HTTP_SCHEME         https;

access_log      /var/log/nginx/seahub.access.log;
          error_log       /var/log/nginx/seahub.error.log;
      }
      location /seafhttp {
          rewrite ^/seafhttp(.*)$ $1 break;
          proxy_pass http://127.0.0.1:8082;
          client_max_body_size 0;
          proxy_connect_timeout  36000s;
          proxy_read_timeout  36000s;
      }
      location /media {
          root /home/cloud/seafile-server-latest/seahub;    #seahub路径
      }
    }



123  nginx -c /etc/nginx/nginx.conf
  124  ./seafile.sh start
  125   ./seahub.sh start-fastcgi

访问WEB:https://192.168.88.10/    /*如果提示404请重启服务器且执行123,124,125步骤*/

admin_User:[email protected]

psk:abc

时间: 2024-07-30 00:04:53

Centos 7 部署Seafile+Nginx的相关文章

Centos 7部署docker+nginx+keepalived实现高可用web集群

一.体系架构 在Keepalived + Nginx高可用负载均衡架构中,keepalived负责实现High-availability (HA) 功能控制前端机VIP(虚拟网络地址),当有设备发生故障时,热备服务器可以瞬间将VIP自动切换过来,实际运行中体验只有2秒钟切换时间,DNS服务可以负责前端VIP的负载均衡.nginx负责控制后端web服务器的负载均衡,将客户端的请求按照一定的算法转发给后端Real Server处理,而Real Server将响应直接返回给客户端. 二.简单原理 NG

centos 部署php+nginx+memadmin + memcached

nginx http://nginx.org/download/nginx-1.7.3.tar.gz php http://cn2.php.net/distributions/php-5.5.14.tar.gz php.memcache插件 http://pecl.php.net/get/memcache-3.0.8.tgz memadmin http://www.junopen.com/memadmin/memadmin-1.0.12.tar.gz install nginx tar -zxf

CentOS 6 部署 Nginx + PHP5 服务器

CentOS 6 部署 Nginx + PHP5 Web服务器 在 CetnOS 6 (64位) 操作系统上部署Nginx and PHP5服务器.这个过程通过 yum 命令进行RPM包安装. 可以参考 PHP 官方文档. 安装 一些必要的 YUM 库 rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/e

在CentOS 7中安装nginx服务器

简要地介绍一下,如何在CentOS 7中安装nginx服务器  下载对应当前系统版本的nginx包(package) # wget  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm  建立nginx的yum仓库 # rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm  下载并安装nginx # yum inst

基于CentOS 5.4搭建nginx+php+spawn-fcgi+mysql高性能php平台

一.安装准备 1.1平台环境: CentOS 5.4 x86_64 GNU/Linux nginx-0.8.21 php-5.2.9 spawn-fcgi-1.6.3 mysql-5.1.34 .2系统安装及分区:1.2.1操作系统安装:         安装过程中选择最少的包,采用文本模式安装,不安装图形.1.2.3系统分区:         /boot  100M    (大约100左右)          SWAP  4G      物理内存的2倍(如果你的物理内存大于4G,分配4G即可)

Web集群部署(Nginx+Keepalived+Varnish+LAMP+NFS)

Web集群部署(Nginx+Keepalived+Varnish+LAMP+NFS)  一.服务介绍   1.1 Nginx服务 Nginx是一个高性能的HTTP和反向代理服务器,也是一个支持IMAP/POP3/SMTP的代理服务器.Nginx即支持Web服务正向代理,也支持反向代理,尤其是反向代理功能十分强大.Nginx支持缓存功能,负载均衡,FASTCGI协议,支持第三方模块.时下Nginx的Web反向代理功能非常流行.   1.2 Keepalived     Keepalived见名知意

CentOS 7 下安装 Nginx

安装所需环境 Nginx 是 C语言 开发,建议在 Linux 上运行,当然,也可以安装 Windows 版本,本篇则使用 CentOS 7 作为安装环境. 一. gcc 安装安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc 环境,如果没有 gcc 环境,则需要安装: yum install gcc-c++ 二. PCRE pcre-devel 安装PCRE(Perl Compatible Regular Expressions) 是一个Perl库,包括 perl 兼容的正则表

Linux平台(Centos7)-lnmp一键式部署mysql,nginx,php,php-fpm服务

Linux平台(Centos7)-lnmp一键式部署mysql,nginx,php,php-fpm服务 1. 部署方式1:手动部署. 6 1.1. 配置防火墙. 6 1.2. 关闭firewall 6 1.3. 安装iptables防火墙. 6 1.4. 安装Apache 7 1.5. 安装MariaDB 9 1.5.1. 安装MariaDB 9 1.5.2. 启动服务. 10 1.5.3. 设置开机启动. 10 1.5.4. 为root账户设置密码. 11 1.5.5. 重启MariaDB 1

Centos 7 部署ELK Stack+beats+kafka

Centos 7 部署ELK Stack+beats+kafka整体的架构如下图:介绍篇:日志的定义:日志是带时间戳的基于时间序列的机器运行数据,包括硬件(服务器,网络设备,存储设备,IOT设备),系统(Linux&windows&docker&*bsd),数据库(Mysql&Oracle&SQL server..),应用程序(nginx,tomcat,Apache...).日志是反映设备运行真是数据,也是系统运行情况,故障分析,性能分析,安全问题追踪等问题的重要依