{"id":238,"date":"2019-02-15T20:13:47","date_gmt":"2019-02-15T12:13:47","guid":{"rendered":"http:\/\/www.wurend.com\/?p=238"},"modified":"2019-03-07T17:51:17","modified_gmt":"2019-03-07T09:51:17","slug":"%e5%9c%a8centos%e5%92%8c%e8%a1%8d%e7%94%9f%e4%ba%a7%e5%93%81%e4%b8%8a%e5%ae%89%e8%a3%85%e9%80%82%e7%94%a8%e4%ba%8elinux%e7%9a%84document-server%ef%bc%88%e5%9c%a8%e7%ba%bf%e5%8a%9e%e5%85%ac%e5%a5%97","status":"publish","type":"post","link":"https:\/\/www.wurend.com\/?p=238","title":{"rendered":"\u5728CentO\u5b89\u88c5\u5728\u7ebf\u529e\u516c\u5957\u4ef6"},"content":{"rendered":"\n<p>\u5728CentOS\u548c\u884d\u751f\u4ea7\u54c1\u4e0a\u5b89\u88c5\u9002\u7528\u4e8eLinux\u7684Document Server\uff08\u5728\u7ebf\u529e\u516c\u5957\u4ef6\uff09<\/p>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_01\"><h2 id=\"h2-0\">\u4ecb\u7ecd<\/h2><\/div><\/div>\n\n\n\n<p><strong>Document Server<\/strong>\u662f\u4e00\u4e2a\u5728\u7ebf\u529e\u516c\u5957\u4ef6\uff0c\u5305\u62ec\u7528\u4e8e\u6587\u672c\uff0c\u7535\u5b50\u8868\u683c\u548c\u6f14\u793a\u6587\u7a3f\u7684\u67e5\u770b\u5668\u548c\u7f16\u8f91\u5668\uff0c\u4e0eOffice Open XML\u683c\u5f0f\u5b8c\u5168\u517c\u5bb9\uff1a.docx\uff0c.xlsx\uff0c.pptx\uff0c\u5e76\u5b9e\u73b0\u534f\u4f5c\u7f16\u8f91\u3002\n\n<\/p>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_01\"><h2 id=\"h2-1\">\u529f\u80fd<\/h2><\/div><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>\u6587\u6863\u7f16\u8f91\u5668<\/li><li>\u7535\u5b50\u8868\u683c\u7f16\u8f91\u5668<\/li><li>\u6f14\u793a\u7f16\u8f91\u5668<\/li><li>iOS\u7684\u6587\u6863\u5e94\u7528\u7a0b\u5e8f<\/li><li>\u534f\u540c\u7f16\u8f91<\/li><li>\u8c61\u5f62\u6587\u5b57\u7684\u652f\u6301<\/li><li>\u652f\u6301\u6240\u6709\u6d41\u884c\u683c\u5f0f\uff1aDOC\uff0cDOCX\uff0cTXT\uff0cODT\uff0cRTF\uff0cODP\uff0cEPUB\uff0cODS\uff0cXLS\uff0cXLSX\uff0cCSV\uff0cPPTX\uff0cHTML<\/li><\/ul>\n\n\n\n<p>\u5982\u679c\u8981\u5c06<strong>Document Server<\/strong>\u4e0e<strong>\u793e\u533a<\/strong><strong>\u670d\u52a1\u5668<\/strong>\u4e00\u8d77\u4f7f\u7528\uff0c\u5219\u5fc5\u987b\u5c06\u5b83\u4eec\u5b89\u88c5\u5728\u4e24\u53f0\u4e0d\u540c\u7684\u8ba1\u7b97\u673a\u4e0a\u3002<\/p>\n\n\n\n<p>\u672c\u6307\u5357\u5c06\u5411\u60a8\u5c55\u793a\u5982\u4f55\u5c06<strong>Document Server<\/strong>&nbsp;Linux\u7248\u672c\u5b89\u88c5\u5230\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u3002<\/p>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_01\"><h2 id=\"h2-2\">\u7cfb\u7edf\u8981\u6c42<\/h2><\/div><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4e2d\u592e\u5904\u7406\u5668\u53cc\u6838<strong>2 GHz<\/strong>\u6216\u66f4\u9ad8<\/li><li>\u5185\u5b58<strong>2 GB<\/strong>\u6216\u66f4\u591a<\/li><li>\u786c\u76d8\u81f3\u5c11<strong>40 GB<\/strong>\u7684\u53ef\u7528\u7a7a\u95f4<\/li><li>\u5176\u4ed6\u8981\u6c42\u81f3\u5c11<strong>2 GB<\/strong>\u7684\u6389\u671f<\/li><li>OSRHEL&nbsp;<strong>7<\/strong>\u6216CentOS&nbsp;<strong>7<\/strong><\/li><li>\u5176\u4ed6\u8981\u6c42<ul><li><strong>PostgreSQL<\/strong>\uff1a<strong>9.1<\/strong>\u6216\u66f4\u9ad8\u7248\u672c<\/li><li><strong>NGINX<\/strong>\uff1a\u7248\u672c<strong>1.3.13<\/strong>\u6216\u66f4\u9ad8\u7248\u672c<\/li><li><strong>Node.js<\/strong>\uff1a\u7248\u672c<strong>8.12.0<\/strong><\/li><li><strong>Redis\u7684<\/strong><\/li><li><strong>\u7684RabbitMQ<\/strong><\/li><\/ul><\/li><\/ul>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_01\"><h2 id=\"h2-3\">\u5b89\u88c5\u4f9d\u8d56\u9879<\/h2><\/div><\/div>\n\n\n\n<h5 class=\"wp-block-heading\">\u6dfb\u52a0\u5305\u542b\u6700\u65b0Node.js\u5305\u7248\u672c\u7684\u5b58\u50a8\u5e93<\/h5>\n\n\n\n<p>\u6dfb\u52a0\u5b58\u50a8\u5e93\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -sL https:\/\/rpm.nodesource.com\/setup_8.x | sudo bash -<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">\u5b89\u88c5\u6700\u65b0\u7684NGINX\u8f6f\u4ef6\u5305\u7248\u672c<\/h5>\n\n\n\n<p>\u8981\u4e3aRHEL \/ CentOS\u8bbe\u7f6eyum\u5b58\u50a8\u5e93\uff0c\u8bf7\u521b\u5efa<code>\/etc\/yum.repos.d\/nginx.repo<\/code>\u4f7f\u7528\u4ee5\u4e0b\u5185\u5bb9\u547d\u540d\u7684\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[nginx]\nname=nginx repo\nbaseurl=http:\/\/nginx.org\/packages\/OS\/7\/$basearch\/\ngpgcheck=0\nenabled=1<\/code><\/pre>\n\n\n\n<p>\n\n\u66ff\u6362<code>OS<\/code>\u4e3a<code>rhel<\/code>\u6216<code>centos<\/code>\u53d6\u51b3\u4e8e\u4f7f\u7528\u7684\u5206\u5e03\uff08<a href=\"http:\/\/nginx.org\/en\/linux_packages.html#stable\" target=\"_blank\" rel=\"noreferrer noopener\">\u5b98\u65b9\u8bf4\u660e<\/a>\uff09\u3002\n\n<\/p>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-4\"> \u5b89\u88c5<strong>NGINX<\/strong>\uff1a <\/h3><\/div><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install nginx<\/code><\/pre>\n\n\n\n<p>\n\n\u4e4b\u540e\u7f16\u8f91<code>\/etc\/nginx\/nginx.conf<\/code><strong>NGINX<\/strong>\u914d\u7f6e\u6587\u4ef6\uff0c\u4f7f\u5176\u770b\u8d77\u6765\u5982\u4e0b\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>user                    nginx;\nworker_processes      1;\nerror_log             \/var\/log\/nginx\/error.log warn;\npid                   \/var\/run\/nginx.pid;\nevents {\n  worker_connections  1024;\n}\nhttp {\n  include             \/etc\/nginx\/mime.types;\n  default_type        application\/octet-stream;\n  log_format          main  '$remote_addr - $remote_user [$time_local] \"$request\" '\n                            '$status $body_bytes_sent \"$http_referer\" '\n                            '\"$http_user_agent\" \"$http_x_forwarded_for\"';\n  access_log          \/var\/log\/nginx\/access.log  main;\n  sendfile            on;\n  #tcp_nopush         on;\n  keepalive_timeout   65;\n  #gzip               on;\n  include             \/etc\/nginx\/conf.d\/*.conf;\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-5\"> \u5b89\u88c5EPEL\u5b58\u50a8\u5e93 <\/h3><\/div><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install epel-release<\/code><\/pre>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-6\"> \u5b89\u88c5\u548c\u914d\u7f6ePostgreSQL <\/h3><\/div><\/div>\n\n\n\n<p><strong>\u5b89\u88c5<\/strong>\u60a8\u7684CentOS\u7248\u672c\u4e2d\u5305\u542b<strong>\u7684PostgreSQL<\/strong>\u7248\u672c\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install postgresql postgresql-server<\/code><\/pre>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-7\"> <strong>\u521d\u59cb\u5316PostgreSQL\u6570\u636e\u5e93<\/strong> <\/h3><\/div><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>service postgresql initdb \nchkconfig postgresql on<\/code><\/pre>\n\n\n\n<p><strong>\u6253\u5f00<\/strong>&nbsp;IPv4\u548cIPv6 localhost&nbsp;<strong>\u7684\u201c\u4fe1\u4efb\u201d\u8eab\u4efd\u9a8c\u8bc1\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p><code>\/var\/lib\/pgsql\/data\/pg_hba.conf<\/code>\u5728\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u6253\u5f00\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u627e\u5230\u8be5<code>host all all 127.0.0.1\/32 ident<\/code>\u5b57\u7b26\u4e32\u5e76\u5c06\u5176\u66ff\u6362\u4e3a\u4ee5\u4e0b\u5b57\u7b26\u4e32\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>host    all             all             127.0.0.1\/32            trust<\/code><\/pre>\n\n\n\n<p>\n\n\u7136\u540e\u627e\u5230\u8be5<code>host all all ::1\/128 ident<\/code>\u5b57\u7b26\u4e32\u5e76\u5c06\u5176\u66ff\u6362\u4e3a\u4ee5\u4e0b\u5b57\u7b26\u4e32\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>host    all             all             ::1\/128                 trust<\/code><\/pre>\n\n\n\n<p>\n\n\u4fdd\u5b58\u66f4\u6539\u3002\n\n<\/p>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-8\"> <strong>\u91cd\u542fPostgreSQL\u670d\u52a1<\/strong>\uff1a <\/h3><\/div><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>service postgresql restart<\/code><\/pre>\n\n\n\n<p><strong>\u521b\u5efaPostgreSQL\u6570\u636e\u5e93\u548c\u7528\u6237<\/strong>\uff1a<\/p>\n\n\n\n<p>\u9996\u5148\u8fd0\u884c\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/tmp<\/code><\/pre>\n\n\n\n<p><code>could not change directory to \"\/root\"<\/code>\u4eceroot\u8fd0\u884c\u65f6\u963b\u6b62\u8b66\u544a\u3002\u7136\u540e\u5fc5\u987b\u521b\u5efa\u6570\u636e\u5e93\u548c\u7528\u6237\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -u postgres psql -c \"CREATE DATABASE onlyoffice;\"\nsudo -u postgres psql -c \"CREATE USER onlyoffice WITH password 'onlyoffice';\"\nsudo -u postgres psql -c \"GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;\"<\/code><\/pre>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-9\"> \u5b89\u88c5Redis <\/h3><\/div><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install redis<\/code><\/pre>\n\n\n\n<p>\n\n\u542f\u52a8redis\u670d\u52a1\u5e76\u542f\u7528\u542f\u52a8\u65f6\u542f\u52a8\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service redis start\nsystemctl enable redis<\/code><\/pre>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-10\"> \u5b89\u88c5RabbitMQ <\/h3><\/div><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install rabbitmq-server<\/code><\/pre>\n\n\n\n<p>\n\n\u542f\u52a8rabbitmq\u670d\u52a1\u5e76\u542f\u52a8\u542f\u52a8\u65f6\u542f\u52a8\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service rabbitmq-server start\nsystemctl enable rabbitmq-server<\/code><\/pre>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_01\"><h2 id=\"h2-11\"> \u5b89\u88c5\u6587\u4ef6\u670d\u52a1\u5668 <\/h2><\/div><\/div>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-12\"> \u6dfb\u52a0\u6587\u4ef6\u670d\u52a1\u5668\u5b58\u50a8\u5e93 <\/h3><\/div><\/div>\n\n\n\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6dfb\u52a0yum&nbsp;<strong>Document Server<\/strong>\u5b58\u50a8\u5e93\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install http:\/\/download.onlyoffice.com\/repo\/centos\/main\/noarch\/onlyoffice-repo.noarch.rpm<\/code><\/pre>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-13\"> \u5b89\u88c5\u6587\u4ef6\u670d\u52a1\u5668 <\/h3><\/div><\/div>\n\n\n\n<p>\n\n\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install onlyoffice-documentserver<\/code><\/pre>\n\n\n\n<p>\n\n\u8fd0\u884c\u76f8\u5173\u670d\u52a1\u5e76\u5728\u542f\u52a8\u65f6\u542f\u7528\u5b83\u4eec\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service supervisord start\nsystemctl enable supervisord\nservice nginx start\nsystemctl enable nginx<\/code><\/pre>\n\n\n\n<p>\u4e4b\u540e\uff0c<strong>\u6587\u6863\u670d\u52a1\u5668<\/strong>\u5c06\u4f5c\u4e3a\u8fdb\u7a0b\u8fd0\u884c\u3002\u8be5\u5305\u5c06\u50cf\u4efb\u4f55\u5176\u4ed6rpm\u5305\u4e00\u6837\u66f4\u65b0\u3002<\/p>\n\n\n\n<p>\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<a href=\"http:\/\/api.onlyoffice.com\/editors\/basic\">\u63d0\u4f9b\u7684API<\/a>\u5c06<strong>Document Server<\/strong>\u8fde\u63a5\u5230<a href=\"https:\/\/helpcenter.onlyoffice.com\/server\/linux\/document\/connect-document-server.aspx\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>\u793e\u533a\u670d\u52a1\u5668<\/strong><\/a>\u6216\u5c06\u5176\u96c6\u6210\u5230\u60a8\u81ea\u5df1\u7684\u6587\u6863\u7ba1\u7406\u7cfb\u7edf\u4e2d\u3002<\/p>\n\n\n\n<div class=\"wp-block-pandastudio-title\"><div class=\"title_style_02\"><h3 id=\"h3-14\"> \u66f4\u6539\u9ed8\u8ba4\u6587\u6863\u670d\u52a1\u5668\u7aef\u53e3 <\/h3><\/div><\/div>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<strong>Document Server<\/strong>\u4f7f\u7528\u7aef\u53e3<strong>80<\/strong>\u4fa6\u542c\u4f20\u5165\u8fde\u63a5\u3002\u4ece\u7248\u672c<strong>4.3<\/strong>\u5f00\u59cb\uff0c\u5982\u679c\u60a8\u6253\u7b97\u4f7f\u7528<strong>\u6587\u6863\u670d\u52a1\u5668<\/strong>\u800c\u4e0d\u662f\u9ed8\u8ba4\u7aef\u53e3\uff0c\u5219\u53ef\u4ee5\u66f4\u6539<strong>\u6587\u4ef6\u670d\u52a1\u5668<\/strong>\u7684\u7aef\u53e3\u3002<\/p>\n\n\n\n<p>\u4e3a\u6b64\uff0c\u60a8\u9700\u8981\u7f16\u8f91\u8fd0\u884c\u8be5\u547d\u4ee4\u7684<strong>DS_PORT<\/strong>\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export DS_PORT=&lt;PORT_NUMBER><\/code><\/pre>\n\n\n\n<p>\u8bf7\u5199\u5165\u7aef\u53e3\u53f7\u800c\u4e0d\u662f<code>&lt;PORT_NUMBER&gt;<\/code>\u4e0a\u9762\u7684\u547d\u4ee4\u3002<\/p>\n\n\n\n<p>\u8b66\u544a\u5982\u679c\u8981\u5c06<strong>\u6587\u4ef6\u670d\u52a1\u5668<\/strong>\u534f\u8bae\u66f4\u6539\u4e3aHTTPS\uff0c\u8bf7\u4e0d\u8981\u5c06\u7aef\u53e3\u66f4\u6539\u4e3a<strong>443<\/strong>\uff0c\u800c\u662f\u4f7f\u7528<a href=\"https:\/\/helpcenter.onlyoffice.com\/server\/linux\/document\/switch-to-https.aspx\">\u6b64\u8bf4\u660e<\/a>\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Switch52\">\u5c06Document Server v5.2\u53ca\u66f4\u9ad8\u7248\u672c\u5207\u6362\u4e3aHTTPS<\/h4>\n\n\n\n<p>\u5728\u5f00\u59cb\u5c06<strong>\u6587\u4ef6\u670d\u52a1\u5668<\/strong>\u5207\u6362\u4e3aHTTPS\u534f\u8bae\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u521b\u5efa\u5b89\u5168\u8bc1\u4e66\u548c\u8bc1\u4e66\u79c1\u94a5\u3002\u5c06\u5b83\u4eec\u653e\u5165\u5b89\u88c5\u4e86<strong>Document Server<\/strong>\u7684\u8ba1\u7b97\u673a\u4e0a\u7684<strong>\u6587\u4ef6<\/strong>\u5939\u4e2d\u3002<\/p>\n\n\n\n<p>\u83b7\u5f97\u8bc1\u4e66\u540e\uff0c\u8bf7\u7ee7\u7eed\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<p>\u505c\u6b62NGINX\u670d\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service nginx stop<\/code><\/pre>\n\n\n\n<p>\n\n\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4<code>onlyoffice-documentserver-ssl.conf.template<\/code>\u5c06<code>onlyoffice-documentserver.conf<\/code>\u6587\u4ef6\u590d\u5236\u5230\u6587\u4ef6\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp -f \/etc\/onlyoffice\/documentserver\/nginx\/onlyoffice-documentserver-ssl.conf.template \/etc\/onlyoffice\/documentserver\/nginx\/onlyoffice-documentserver.conf<\/code><\/pre>\n\n\n\n<p>\u7f16\u8f91<code>\/etc\/onlyoffice\/documentserver\/nginx\/onlyoffice-documentserver.conf<\/code>\u6587\u4ef6\uff0c\u66f4\u6539\u5b9e\u9645\u4f7f\u7528\u7684\u53cc\u82b1\u62ec\u53f7<strong>{{&#8230;}}<\/strong>\u4e2d\u7684\u6240\u6709\u53c2\u6570\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>{{SSL_CERTIFICATE_PATH}}<\/strong>&nbsp;&#8211; \u60a8\u83b7\u5f97\u7684SSL\u8bc1\u4e66\u7684\u8def\u5f84;<\/li><li><strong>{{SSL_KEY_PATH}}<\/strong>&nbsp;&#8211; SSL\u8bc1\u4e66\u79c1\u94a5\u7684\u8def\u5f84;<\/li><li><strong>{{SSL_VERIFY_CLIENT}}<\/strong>&nbsp;-\u5ba2\u6237\u7aef\u8bc1\u4e66\u7684\u9a8c\u8bc1\u662f\u5426\u88ab\u542f\u7528\uff08\u5177\u6709\u53ef\u7528\u503c<code>on<\/code>\uff0c<code>off<\/code>\uff0c<code>optional<\/code>\u548c<code>optional_no_ca<\/code>\uff09;<\/li><li><strong>{{CA_CERTIFICATES_PATH}}<\/strong>&nbsp;&#8211; \u5ba2\u6237\u7aef\u8bc1\u4e66\u7684\u8def\u5f84\uff0c\u5982\u679c\u4f7f\u7528\u4e0a\u4e00\u4e2a\u53c2\u6570\u542f\u7528\uff0c\u5c06\u9a8c\u8bc1\u8be5\u8def\u5f84;<\/li><li><strong>{{ONLYOFFICE_HTTPS_HSTS_MAXAGE}}<\/strong>&nbsp;&#8211; \u9ad8\u7ea7\u914d\u7f6e\u9009\u9879\uff0c\u7528\u4e8e\u5728<strong>\u6587\u4ef6\u670d\u52a1\u5668<\/strong>&nbsp;NGINX vHost\u914d\u7f6e\u4e2d\u8bbe\u7f6eHSTS max-age\uff0c\u4ec5\u5728\u4f7f\u7528SSL\u65f6\u9002\u7528\uff08\u901a\u5e38\u9ed8\u8ba4\u4e3a<code>31536000<\/code>\u8db3\u591f\u5b89\u5168\uff09;<\/li><li><strong>{{SSL_DHPARAM_PATH}}<\/strong>&nbsp;&#8211; Diffie-Hellman\u53c2\u6570\u7684\u8def\u5f84;<\/li><\/ul>\n\n\n\n<p>\u6709\u5173\u914d\u7f6e\u6587\u4ef6\u4e2d\u4f7f\u7528\u7684SSL\u53c2\u6570\u7684\u66f4\u591a\u4fe1\u606f\uff0c&nbsp;\u8bf7\u53c2\u9605<a href=\"http:\/\/nginx.org\/docs\/http\/ngx_http_ssl_module.html\" target=\"_blank\" rel=\"noreferrer noopener\">NGINX\u6587\u6863<\/a>\u3002<\/p>\n\n\n\n<p>\u4e5f\u53ef\u6309\u5982\u4e0b\u914d\u7f6e\u8fdb\u884c\u4fee\u6539\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>include \/etc\/nginx\/includes\/onlyoffice-http.conf;\n\n## Normal HTTP host\nserver {\n  listen 0.0.0.0:80;\n  listen [::]:80 default_server;\n  server_name xxx.com ;#\u4f60\u7684\u57df\u540d\n  server_tokens off;\n\n  ## Redirects all traffic to the HTTPS host\n  root \/nowhere; ## root doesn't have to be a valid path since we are redirecting\n  rewrite ^ https:\/\/xxx.com ;#\u4f60\u7684\u57df\u540d permanent;\n}\n\n#HTTP host for internal services\nserver {\n  listen 80;\n  #listen [::]:80;\n  server_name xxx.com ;#\u4f60\u7684\u57df\u540d\n  server_tokens off;\n  \n  include \/etc\/nginx\/includes\/onlyoffice-documentserver-common.conf;\n  include \/etc\/nginx\/includes\/onlyoffice-documentserver-docservice.conf;\n}\n\n## HTTPS host\nserver {\n  listen 443 ssl http2;\n  #listen [::]:443 ssl http2;\n  server_name xxx.com ;#\u4f60\u7684\u57df\u540d\n  root \/usr\/share\/nginx\/html;\n\n  ## Strong SSL Security\n  ## https:\/\/raymii.org\/s\/tutorials\/Strong_SSL_Security_On_nginx.html\n  ssl on;\n  ssl_certificate \/app\/1778033_office.jgdtd.com.cer;\n  ssl_certificate_key \/app\/1778033_office.jgdtd.com.key;\n  ssl_verify_client off;\n\n  ssl_ciphers \"EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH\";\n\n  ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;\n  ssl_session_cache  builtin:1000  shared:SSL:10m;\n\n  ssl_prefer_server_ciphers   on;\n\n  add_header Strict-Transport-Security max-age=31536000;\n  # add_header X-Frame-Options SAMEORIGIN;\n  add_header X-Content-Type-Options nosniff;\n\n  ## [Optional] If your certficate has OCSP, enable OCSP stapling to reduce the overhead and latency of running SSL.\n  ## Replace with your ssl_trusted_certificate. For more info see:\n  ## - https:\/\/medium.com\/devops-programming\/4445f4862461\n  ## - https:\/\/www.ruby-forum.com\/topic\/4419319\n  ## - https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-configure-ocsp-stapling-on-apache-and-nginx\n  # ssl_stapling on;\n  # ssl_stapling_verify on;\n  # ssl_trusted_certificate \/etc\/nginx\/ssl\/stapling.trusted.crt;\n  # resolver 208.67.222.222 208.67.222.220 valid=300s; # Can change to your DNS resolver if desired\n  # resolver_timeout 10s;\n\n  ## [Optional] Generate a stronger DHE parameter:\n  ##   cd \/etc\/ssl\/certs\n  ##   sudo openssl dhparam -out dhparam.pem 4096\n  ##\n  # ssl_dhparam \/etc\/ssl\/certs\/dhparam.pem;\n\n  include \/etc\/nginx\/includes\/onlyoffice-documentserver-*.conf;\n\n}\n<\/code><\/pre>\n\n\n\n<p>\n\n\u5b8c\u6210\u6240\u6709\u66f4\u6539\u540e\uff0c\u60a8\u53ef\u4ee5\u518d\u6b21\u542f\u52a8NGINX\u670d\u52a1\uff1a\n\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service nginx start<\/code><\/pre>\n\n\n\n<p>\n\n\u5728nextcloud\u91cc\u9762\u94fe\u63a5onloffice\u6587\u4ef6\u670d\u52a1\u5668\u65f6\u987b\u5728\u57df\u540d\u540e\u9762\u6dfb\u52a0\u4e0a\u7aef\u53e3\u53f7\u3002\u5426\u5219\u4f1a\u62a5\u9519\uff01\uff01\uff01\n\n<\/p>\n\n\n\n<div class=\"wp-block-pandastudio-modal\"><button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#uuid-timestamp-1550232792678\">\u5b98\u65b9\u6587\u6863<\/button><div class=\"modal fade\" id=\"uuid-timestamp-1550232792678\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\"><div class=\"modal-dialog\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;<\/span><\/button><h4 class=\"modal-title\" id=\"myModalLabel\">\u672a\u6807\u9898<\/h4><\/div><div class=\"modal-body\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p><a href=\"https:\/\/helpcenter.onlyoffice.com\/server\/linux\/document\/linux-installation-centos.aspx\">https:\/\/helpcenter.onlyoffice.com\/server\/linux\/document\/linux-installation-centos.aspx<\/a><\/p>\n<\/div>\n<\/div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">\u5173\u95ed<\/button>\n\n<\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5728CentOS\u548c\u884d\u751f\u4ea7\u54c1\u4e0a\u5b89\u88c5\u9002\u7528\u4e8eLinux\u7684Document Server\uff08\u5728\u7ebf\u529e\u516c\u5957\u4ef6\uff09 Documen [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":361,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[20,3],"class_list":["post-238","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-centos","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=238"}],"version-history":[{"count":0,"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/posts\/238\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=\/wp\/v2\/media\/361"}],"wp:attachment":[{"href":"https:\/\/www.wurend.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wurend.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}