From a592f511323b6345d0e755eb0098fbad26289ab1 Mon Sep 17 00:00:00 2001 From: Hulk Date: Thu, 13 Jun 2019 15:37:05 +0800 Subject: [PATCH 1/2] update the install scripts. --- seafile-server-centos-7-amd64-http | 36 +++++++++++++++++++++--------- seafile-server-ubuntu-amd64-http | 28 ++++++++++++++++------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/seafile-server-centos-7-amd64-http b/seafile-server-centos-7-amd64-http index 1acbb87..75f494c 100644 --- a/seafile-server-centos-7-amd64-http +++ b/seafile-server-centos-7-amd64-http @@ -169,15 +169,25 @@ systemctl status firewalld &> /dev/null \ # Additional requirements # ------------------------------------------- # extra packages for enterprise linux + yum install epel-release -y yum upgrade -y -yum install python-setuptools MySQL-python memcached python-urllib3 \ - pwgen curl openssl python-ldap java-1.8.0-openjdk poppler-utils libreoffice python-requests \ - libreoffice-headless libreoffice-pyuno wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts \ - gcc libffi-devel python-devel openssl-devel libmemcached libmemcached-devel python2-pip -y -pip install pylibmc==1.6.0 django-pylibmc==0.6.1 -pip install --timeout=3600 Pillow==4.3.0 -pip install psd-tools==1.4 + +if [[ ${SEAFILE_VERSION} =~ 7\.[0-9]*\.[0-9]* ]]; then + yum install python-setuptools MySQL-python memcached python-urllib3 \ + pwgen curl openssl python-ldap java-1.8.0-openjdk poppler-utils libreoffice \ + libreoffice-headless libreoffice-pyuno wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts \ + libffi-devel openssl-devel libmemcached -y +else + yum install python-setuptools MySQL-python memcached python-urllib3 \ + pwgen curl openssl python-ldap java-1.8.0-openjdk poppler-utils libreoffice python-requests \ + libreoffice-headless libreoffice-pyuno wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts \ + gcc libffi-devel python-devel openssl-devel libmemcached libmemcached-devel python2-pip -y + + pip install pylibmc==1.6.0 django-pylibmc==0.6.1 + pip install --timeout=3600 Pillow==4.3.0 + pip install psd-tools==1.4 +fi # start memcached on system boot systemctl enable --now memcached @@ -190,6 +200,8 @@ systemctl enable nginx rm -rf /etc/nginx/conf.d/* cat > /etc/nginx/conf.d/seafile.conf << EOF +log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time'; + server { listen 80; server_name seafile.example.com; @@ -208,7 +220,7 @@ server { # used for view/edit office file via Office Online Server client_max_body_size 0; - access_log /var/log/nginx/seahub.access.log; + access_log /var/log/nginx/seahub.access.log seafileformat; error_log /var/log/nginx/seahub.error.log; } @@ -220,6 +232,9 @@ server { proxy_connect_timeout 36000s; proxy_read_timeout 36000s; proxy_request_buffering off; + + access_log /var/log/nginx/seafhttp.access.log seafileformat; + error_log /var/log/nginx/seafhttp.error.log; } location /media { root ${SEAFILE_SERVER_HOME}/seafile-server-latest/seahub; @@ -240,7 +255,7 @@ server { client_max_body_size 0; - access_log /var/log/nginx/seafdav.access.log; + access_log /var/log/nginx/seafdav.access.log seafileformat; error_log /var/log/nginx/seafdav.error.log; } } @@ -331,7 +346,7 @@ fi cat > /etc/systemd/system/seafile.service << EOF [Unit] Description=Seafile Server -After=network.target mariadb.service +After=network.target remote-fs.target mariadb.service [Service] ExecStart=${SEAFILE_SERVER_HOME}/seafile-server-latest/seafile.sh start @@ -524,7 +539,6 @@ fi # Fix permissions # ------------------------------------------- chown ${SEAFILE_SERVER_USER}:${SEAFILE_SERVER_USER} -R ${SEAFILE_SERVER_HOME} - if [[ -d /tmp/seafile-office-output/ ]]; then chown ${SEAFILE_SERVER_USER}:${SEAFILE_SERVER_USER} -R /tmp/seafile-office-output/ fi diff --git a/seafile-server-ubuntu-amd64-http b/seafile-server-ubuntu-amd64-http index 25b6b2f..ec5561a 100644 --- a/seafile-server-ubuntu-amd64-http +++ b/seafile-server-ubuntu-amd64-http @@ -142,17 +142,26 @@ fi # Additional requirements # ------------------------------------------- apt-get update -apt-get install -y python2.7 sudo python-pip python-setuptools python-mysqldb python-ldap python-urllib3 \ -openjdk-8-jre memcached libmemcached-dev zlib1g-dev pwgen curl openssl poppler-utils libpython2.7 libreoffice \ -libreoffice-script-provider-python ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy nginx python-requests -pip install pylibmc==1.6.0 django-pylibmc==0.6.1 -pip install --timeout=3600 Pillow==4.3.0 -pip install psd-tools==1.4 +if [[ ${SEAFILE_VERSION} =~ 7\.[0-9]*\.[0-9]* ]]; then + apt-get install -y python2.7 sudo python-setuptools python-mysqldb python-ldap python-urllib3 \ + openjdk-8-jre memcached libmemcached-dev zlib1g-dev pwgen curl openssl poppler-utils libpython2.7 libreoffice \ + libreoffice-script-provider-python ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy nginx +else + apt-get install -y python2.7 sudo python-pip python-setuptools python-mysqldb python-ldap python-urllib3 \ + openjdk-8-jre memcached libmemcached-dev zlib1g-dev pwgen curl openssl poppler-utils libpython2.7 libreoffice \ + libreoffice-script-provider-python ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy nginx python-requests + + pip install pylibmc==1.6.0 django-pylibmc==0.6.1 + pip install --timeout=3600 Pillow==4.3.0 + pip install psd-tools==1.4 +fi rm /etc/nginx/sites-enabled/* cat > /etc/nginx/sites-available/seafile.conf << EOF +log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time'; + server { listen 80; server_name seafile.example.com; @@ -171,7 +180,7 @@ server { # used for view/edit office file via Office Online Server client_max_body_size 0; - access_log /var/log/nginx/seahub.access.log; + access_log /var/log/nginx/seahub.access.log seafileformat; error_log /var/log/nginx/seahub.error.log; } @@ -183,6 +192,9 @@ server { proxy_connect_timeout 36000s; proxy_read_timeout 36000s; proxy_request_buffering off; + + access_log /var/log/nginx/seafhttp.access.log seafileformat; + error_log /var/log/nginx/seafhttp.error.log; } location /media { root ${SEAFILE_SERVER_HOME}/seafile-server-latest/seahub; @@ -203,7 +215,7 @@ server { client_max_body_size 0; - access_log /var/log/nginx/seafdav.access.log; + access_log /var/log/nginx/seafdav.access.log seafileformat; error_log /var/log/nginx/seafdav.error.log; } } From c0b57e54091d113a8dad99a075ecffb52e9e5a4a Mon Sep 17 00:00:00 2001 From: Hulk Date: Thu, 13 Jun 2019 15:50:28 +0800 Subject: [PATCH 2/2] update the install scripts. --- seafile-server-centos-7-amd64-http | 12 ++++++------ seafile-server-ubuntu-amd64-http | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/seafile-server-centos-7-amd64-http b/seafile-server-centos-7-amd64-http index 75f494c..075577f 100644 --- a/seafile-server-centos-7-amd64-http +++ b/seafile-server-centos-7-amd64-http @@ -173,12 +173,7 @@ systemctl status firewalld &> /dev/null \ yum install epel-release -y yum upgrade -y -if [[ ${SEAFILE_VERSION} =~ 7\.[0-9]*\.[0-9]* ]]; then - yum install python-setuptools MySQL-python memcached python-urllib3 \ - pwgen curl openssl python-ldap java-1.8.0-openjdk poppler-utils libreoffice \ - libreoffice-headless libreoffice-pyuno wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts \ - libffi-devel openssl-devel libmemcached -y -else +if [[ ${SEAFILE_VERSION} =~ 6\.[0-9]*\.[0-9]* ]]; then yum install python-setuptools MySQL-python memcached python-urllib3 \ pwgen curl openssl python-ldap java-1.8.0-openjdk poppler-utils libreoffice python-requests \ libreoffice-headless libreoffice-pyuno wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts \ @@ -187,6 +182,11 @@ else pip install pylibmc==1.6.0 django-pylibmc==0.6.1 pip install --timeout=3600 Pillow==4.3.0 pip install psd-tools==1.4 +else + yum install python-setuptools MySQL-python memcached python-urllib3 \ + pwgen curl openssl python-ldap java-1.8.0-openjdk poppler-utils libreoffice \ + libreoffice-headless libreoffice-pyuno wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts \ + libffi-devel openssl-devel libmemcached -y fi # start memcached on system boot diff --git a/seafile-server-ubuntu-amd64-http b/seafile-server-ubuntu-amd64-http index ec5561a..2b99d42 100644 --- a/seafile-server-ubuntu-amd64-http +++ b/seafile-server-ubuntu-amd64-http @@ -143,11 +143,7 @@ fi # ------------------------------------------- apt-get update -if [[ ${SEAFILE_VERSION} =~ 7\.[0-9]*\.[0-9]* ]]; then - apt-get install -y python2.7 sudo python-setuptools python-mysqldb python-ldap python-urllib3 \ - openjdk-8-jre memcached libmemcached-dev zlib1g-dev pwgen curl openssl poppler-utils libpython2.7 libreoffice \ - libreoffice-script-provider-python ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy nginx -else +if [[ ${SEAFILE_VERSION} =~ 6\.[0-9]*\.[0-9]* ]]; then apt-get install -y python2.7 sudo python-pip python-setuptools python-mysqldb python-ldap python-urllib3 \ openjdk-8-jre memcached libmemcached-dev zlib1g-dev pwgen curl openssl poppler-utils libpython2.7 libreoffice \ libreoffice-script-provider-python ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy nginx python-requests @@ -155,6 +151,10 @@ else pip install pylibmc==1.6.0 django-pylibmc==0.6.1 pip install --timeout=3600 Pillow==4.3.0 pip install psd-tools==1.4 +else + apt-get install -y python2.7 sudo python-setuptools python-mysqldb python-ldap python-urllib3 \ + openjdk-8-jre memcached libmemcached-dev zlib1g-dev pwgen curl openssl poppler-utils libpython2.7 libreoffice \ + libreoffice-script-provider-python ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy nginx fi rm /etc/nginx/sites-enabled/*