本篇內(nèi)容介紹了“Ubuntu18如何搭建Seafile7.0版本”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
按需開發(fā)可以根據(jù)自己的需求進(jìn)行定制,成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作構(gòu)思過程中功能建設(shè)理應(yīng)排到主要部位公司成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作的運(yùn)用實(shí)際效果公司網(wǎng)站制作網(wǎng)站建立與制做的實(shí)際意義
環(huán)境:Ubuntu18.04、Samba、Apache2.4、MySQL5.7
參考資料:https://cloud.seafile.com/published/seafile-manual-cn/deploy/using_mysql.md
# 更新源 sudo apt update && upgrade # 安裝必備軟件包 sudo apt install -y python-dev libpython2.7 python-pip python-setuptools python-pil python-mysqldb python-ldap python-urllib3 python-memcache ffmpeg # 如果提示安裝失敗,可嘗試重新執(zhí)行 # 新建文件夾名字自定義,案例中使用‘haiwen'這個名稱,用來放置Seafile # 假如放在當(dāng)前用戶下 '/home/demo/haiwen' # 通過samba共享文件夾share,上傳安裝包到share # 由于pipy下載不穩(wěn)定,我預(yù)先下載了部分組件:pillow、numpy、moviepy-1.0.1 # 手動安裝離線包 sudo -H pip install Pillow-6.2.0-cp27-cp27mu-manylinux1_x86_64.whl sudo -H pip install numpy-1.16.5-cp27-cp27mu-manylinux1_x86_64.whl demo@ubuntu:~/share/moviepy-1.0.1$ sudo python setup.py install # 啟用Apache反向代理模塊 sudo a2enmod rewrite proxy_http # 將Seafile安裝包復(fù)制到/home/demo/haiwen下 # 新建'installed'文件夾,解壓seafile安裝包,解壓完畢后將壓縮包移動到’installed‘文件夾里。 # 進(jìn)入seafile文件夾 # cd ./seafile-server-lastest # 配置過程不需要用root權(quán)限 # 配置數(shù)據(jù)庫,根據(jù)提示填寫 ./setup-seafile-mysql.sh # 啟動seafile # ./seafile.sh { start | stop | restart } # 啟動seahub,首次啟動需要設(shè)置管理員 # run seahub server: ./seahub.sh { start| stop | restart }
啟用Apache反向代理
# 啟用代理功能 sudo a2enmod rewrite proxy_http # 增加防火墻規(guī)則 sudo ufw allow 8000 sudo ufw allow 8082 # 修改代理配置 cd /etc/apache2/sites-enabled sudo cp 000-default.conf 000-default.conf.bak sudo vim 000-default.conf # 修改如下:# ServerName www.myseafile.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html Alias /media /home/demo/haiwen/seafile-server-latest/seahub/media RewriteEngine On # 修改完畢后重啟apache服務(wù) sudo /etc/init.d/apache2 restart # 至此,已經(jīng)可以用web登陸Seafile。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
添加自啟動功能
# 新建seafile服務(wù) sudo vim /etc/systemd/system/seafile.service # 內(nèi)容 [Unit] Description=Seafile # add mysql.service or postgresql.service depending on your database to the line below After=network.target [Service] Type=oneshot ExecStart=/home/demo/haiwen/seafile-server-latest/seafile.sh start ExecStop=/home/demo/haiwen/seafile-server-latest/seafile.sh stop RemainAfterExit=yes User=demo Group=demo [Install] WantedBy=multi-user.target # 新建seahub服務(wù) sudo vim /etc/systemd/system/seahub.service [Unit] Description=Seafile hub After=network.target seafile.service [Service] # change start to start-fastcgi if you want to run fastcgi ExecStart=/home/demo/haiwen/seafile-server-latest/seahub.sh start ExecStop=/home/demo/haiwen/seafile-server-latest/seahub.sh stop User=demo Group=demo Type=oneshot RemainAfterExit=yes [Install] WantedBy=multi-user.target # 啟用服務(wù) sudo systemctl enable seafile.service sudo systemctl enable seahub.service sudo systemctl daemon-reload
“Ubuntu18如何搭建Seafile7.0版本”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!