How to build Seafile7.0 version of Ubuntu18
This article introduces the relevant knowledge of "how to build the Seafile7.0 version of Ubuntu18". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Environment: Ubuntu18.04, Samba, Apache2.4, MySQL5.7
Reference: https://cloud.seafile.com/published/seafile-manual-cn/deploy/using_mysql.md
# update source sudo apt update & & upgrade# installation prerequisite package sudo apt install-y python-dev libpython2.7 python-pip python-setuptools python-pil python-mysqldb python-ldap python-urllib3 python-memcache ffmpeg# if prompted that the installation failed, try to re-implement the # new folder name customization. The name 'haiwen'' is used in the case. Used to place Seafile# if placed under the current user'/ home/demo/haiwen'# through the samba shared folder share, upload the installation package to share# due to unstable pipy download I downloaded some components in advance: pillow, numpy, Moviepy-1.0.1# manually install offline package sudo-H pip install Pillow-6.2.0-cp27-cp27mu-manylinux1_x86_64.whlsudo-H pip install numpy-1.16.5-cp27-cp27mu-manylinux1_x86_64.whldemo@ubuntu:~/share/moviepy-1.0.1$ sudo python setup.py install# enable Apache reverse proxy module sudo a2enmod rewrite proxy_http# copy Seafile installation package to / home/demo/haiwen # New 'installed' folder Extract the seafile installation package, and move the package to the 'installed' folder after unzipping. # enter the seafile folder # cd. / seafile-server-lastest# configuration process does not need to use root permissions # configure the database, fill in. / setup-seafile-mysql.sh# start seafile#. / seafile.sh {start | stop | restart} # start seahub, for the first time you need to set up administrator # run seahub server:. / seahub.sh {start | stop | restart}
Enable Apache reverse proxy
# enable proxy function sudo a2enmod rewrite proxy_http# add firewall rule sudo ufw allow 8000sudo ufw allow 808 modify proxy configuration cd / etc/apache2/sites-enabledsudo cp 000-default.conf 000-default.conf.baksudo vim 000-default.conf# modify as follows: # ServerName www.myseafile.com ServerAdmin webmaster@localhost DocumentRoot / var/www/html Alias / media / home/demo/haiwen/seafile-server-latest/seahub/media RewriteEngine On Require all granted # # seafile fileserver # ProxyPass / seafhttp http://127.0.0.1:8082 ProxyPassReverse / seafhttp http://127.0.0.1:8082 RewriteRule ^ / seafhttp-[QSA L] # # seahub # SetEnvIf Authorization "(. *)" HTTP_AUTHORIZATION=$1 ProxyPass / http://127.0.0.1:8000/ ProxyPassReverse / http://127.0.0.1:8000/ ErrorLog ${APACHE_LOG_DIR } / error.log CustomLog ${APACHE_LOG_DIR} / access.log combined # restart the apache service sudo / etc/init.d/apache2 restart# after modification. You can already log in to Seafile using web.
Add self-startup function
# New seafile service sudo vim / etc/systemd/system/seafile.service# content [Unit] Description=Seafile# add mysql.service or postgresql.service depending on your database to the line belowAfter=network.target [Service] Type=oneshotExecStart=/home/demo/haiwen/seafile-server-latest/seafile.sh startExecStop=/home/demo/haiwen/seafile-server-latest/seafile.sh stopRemainAfterExit=yesUser=demoGroup= demotion [install] WantedBy=multi-user.target# New seahub service sudo vim / etc/systemd/system/ service hub.service [Unit] Description=Seafile hubAfter=network.target seafile. Service [Service] # change start to start-fastcgi if you want to run fastcgiExecStart=/home/demo/haiwen/seafile-server-latest/seahub.sh startExecStop=/home/demo/haiwen/seafile-server-latest/seahub.sh stopUser=demoGroup=demoType=oneshotRemainAfterExit= ys [install] WantedBy=multi-user.target# enable Service sudo systemctl enable seafile.servicesudo systemctl enable seahub.servicesudo systemctl daemon-reload "how to build a Seafile7.0 version of Ubuntu18" ends here Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!