seafile安装+NFS存储后端+nginx全过程记录

1.系统更新
yum update
2.磁盘扩容,重新创建数据LVM的VG2,与系统LVM分离
示例:

[00:15:53][root@localhost ~]# df -h
[00:15:53]Filesystem Size Used Avail Use% Mounted on
[00:15:53]/dev/mapper/VG1-root 8.0G 2.0G 6.1G 25% /
[00:15:53]devtmpfs 909M 0 909M 0% /dev
[00:15:53]tmpfs 920M 0 920M 0% /dev/shm
[00:15:53]tmpfs 920M 8.6M 912M 1% /run
[00:15:53]tmpfs 920M 0 920M 0% /sys/fs/cgroup
[00:15:53]/dev/sda2 1014M 173M 842M 18% /boot
[00:15:53]/dev/mapper/VG1-home 10G 33M 10G 1% /home
[00:15:53]/dev/mapper/VG1-var 8.0G 210M 7.8G 3% /var
[00:15:53]tmpfs 184M 0 184M 0% /run/user/0
[00:16:01][root@localhost ~]#
[00:16:01][root@localhost ~]#
[00:16:01][root@localhost ~]#
[00:16:02][root@localhost ~]#
[00:17:18][root@localhost ~]#
[00:17:19][root@localhost ~]#
[00:17:23][root@localhost ~]# fdisk -l
[00:17:23]
[00:17:23]Disk /dev/sda: 85.9 GB, 85899345920 bytes, 167772160 sectors
[00:17:23]Units = sectors of 1 * 512 = 512 bytes
[00:17:23]Sector size (logical/physical): 512 bytes / 512 bytes
[00:17:23]I/O size (minimum/optimal): 512 bytes / 512 bytes
[00:17:23]Disk label type: dos
[00:17:23]Disk identifier: 0x0004b84c
[00:17:23]
[00:17:23] Device Boot Start End Blocks Id System
[00:17:23]/dev/sda1 2048 6143 2048 83 Linux
[00:17:23]/dev/sda2 * 6144 2103295 1048576 83 Linux
[00:17:23]/dev/sda3 2103296 73414655 35655680 8e Linux LVM
[00:17:23]
[00:17:23]Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
[00:17:23]Units = sectors of 1 * 512 = 512 bytes
[00:17:23]Sector size (logical/physical): 512 bytes / 512 bytes
[00:17:23]I/O size (minimum/optimal): 512 bytes / 512 bytes
[00:17:23]Disk label type: dos
[00:17:23]Disk identifier: 0x0005803c
[00:17:23]
[00:17:23] Device Boot Start End Blocks Id System
[00:17:23]
[00:17:23]Disk /dev/mapper/VG1-root: 8589 MB, 8589934592 bytes, 16777216 sectors
[00:17:23]Units = sectors of 1 * 512 = 512 bytes
[00:17:23]Sector size (logical/physical): 512 bytes / 512 bytes
[00:17:23]I/O size (minimum/optimal): 512 bytes / 512 bytes
[00:17:23]
[00:17:23]
[00:17:23]Disk /dev/mapper/VG1-swap: 8589 MB, 8589934592 bytes, 16777216 sectors
[00:17:23]Units = sectors of 1 * 512 = 512 bytes
[00:17:23]Sector size (logical/physical): 512 bytes / 512 bytes
[00:17:23]I/O size (minimum/optimal): 512 bytes / 512 bytes
[00:17:23]
[00:17:23]
[00:17:23]Disk /dev/mapper/VG1-home: 10.7 GB, 10737418240 bytes, 20971520 sectors
[00:17:23]Units = sectors of 1 * 512 = 512 bytes
[00:17:23]Sector size (logical/physical): 512 bytes / 512 bytes
[00:17:23]I/O size (minimum/optimal): 512 bytes / 512 bytes
[00:17:23]
[00:17:23]
[00:17:23]Disk /dev/mapper/VG1-var: 8589 MB, 8589934592 bytes, 16777216 sectors
[00:17:23]Units = sectors of 1 * 512 = 512 bytes
[00:17:23]Sector size (logical/physical): 512 bytes / 512 bytes
[00:17:23]I/O size (minimum/optimal): 512 bytes / 512 bytes
[00:17:23]
[00:18:11][root@localhost ~]# df -k
[00:18:11]Filesystem 1K-blocks Used Available Use% Mounted on
[00:18:11]/dev/mapper/VG1-root 8378368 2014096 6364272 25% /
[00:18:11]devtmpfs 930812 0 930812 0% /dev
[00:18:11]tmpfs 941876 0 941876 0% /dev/shm
[00:18:11]tmpfs 941876 8736 933140 1% /run
[00:18:11]tmpfs 941876 0 941876 0% /sys/fs/cgroup
[00:18:11]/dev/sda2 1038336 176716 861620 18% /boot
[00:18:11]/dev/mapper/VG1-home 10475520 32956 10442564 1% /home
[00:18:11]/dev/mapper/VG1-var 8378368 204656 8173712 3% /var
[00:18:11]tmpfs 188376 0 188376 0% /run/user/0
[00:18:12][root@localhost ~]#
[00:18:13][root@localhost ~]#
[00:18:13][root@localhost ~]#
[00:18:13][root@localhost ~]#
[00:18:40][root@localhost ~]# fdisk /dev/sdb
[00:18:40]Welcome to fdisk (util-linux 2.23.2).
[00:18:40]
[00:18:40]Changes will remain in memory only, until you decide to write them.
[00:18:40]Be careful before using the write command.
[00:18:40]
[00:18:40]
[00:18:51]Command (m for help): n
[00:18:51]Partition type:
[00:18:51] p primary (0 primary, 0 extended, 4 free)
[00:18:51] e extended
[00:18:56]Select (default p): p
[00:19:03]Partition number (1-4, default 1): 1
[00:19:12]First sector (2048-104857599, default 2048):
[00:19:12]Using default value 2048
[00:19:19]Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
[00:19:19]Using default value 104857599
[00:19:19]Partition 1 of type Linux and of size 50 GiB is set
[00:19:19]
[00:19:23]Command (m for help): p
[00:19:23]
[00:19:23]Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
[00:19:23]Units = sectors of 1 * 512 = 512 bytes
[00:19:23]Sector size (logical/physical): 512 bytes / 512 bytes
[00:19:23]I/O size (minimum/optimal): 512 bytes / 512 bytes
[00:19:23]Disk label type: dos
[00:19:23]Disk identifier: 0x0005803c
[00:19:23]
[00:19:23] Device Boot Start End Blocks Id System
[00:19:23]/dev/sdb1 2048 104857599 52427776 83 Linux
[00:19:23]
[00:19:39]Command (m for help): t
[00:19:39]Selected partition 1
[00:19:46]Hex code (type L to list all codes): L
[00:19:46]
[00:19:46] 0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
[00:19:46] 1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
[00:19:46] 2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
[00:19:46] 3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
[00:19:46] 4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx [00:19:46] 5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data [00:19:46] 6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / . [00:19:46] 7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility [00:19:46] 8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt [00:19:46] 9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access [00:19:46] a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O [00:19:46] b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor [00:19:46] c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs [00:19:46] e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT [00:19:46] f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/ [00:19:46]10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b [00:19:46]11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor [00:19:46]12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor [00:19:46]14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary [00:19:46]16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS [00:19:46]17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE [00:19:46]18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto [00:19:46]1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep [00:19:46]1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT [00:19:46]1e Hidden W95 FAT1 80 Old Minix [00:19:52]Hex code (type L to list all codes): 8e [00:19:52]Changed type of partition 'Linux' to 'Linux LVM' [00:19:52] [00:20:06]Command (m for help): p [00:20:06] [00:20:06]Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors [00:20:06]Units = sectors of 1 * 512 = 512 bytes [00:20:06]Sector size (logical/physical): 512 bytes / 512 bytes [00:20:06]I/O size (minimum/optimal): 512 bytes / 512 bytes [00:20:06]Disk label type: dos [00:20:06]Disk identifier: 0x0005803c [00:20:06] [00:20:06] Device Boot Start End Blocks Id System [00:20:06]/dev/sdb1 2048 104857599 52427776 8e Linux LVM [00:20:06] [00:20:16]Command (m for help): w [00:20:16]The partition table has been altered! [00:20:16] [00:20:16]Calling ioctl() to re-read partition table. [00:20:16]Syncing disks. [00:20:47][root@localhost ~]# pvcreate /dev/sdb1 [00:20:47] Physical volume "/dev/sdb1" successfully created. [00:20:55][root@localhost ~]# [00:20:55][root@localhost ~]# [00:21:00][root@localhost ~]# pvdisplay [00:21:00] --- Physical volume --- [00:21:00] PV Name /dev/sda3 [00:21:00] VG Name VG1 [00:21:00] PV Size 34.00 GiB / not usable 4.00 MiB [00:21:00] Allocatable yes (but full) [00:21:00] PE Size 4.00 MiB [00:21:00] Total PE 8704 [00:21:00] Free PE 0 [00:21:00] Allocated PE 8704 [00:21:00] PV UUID iMLMAf-jOjr-jTJU-H4BT-XLEs-3PEY-JwSjcF [00:21:00] [00:21:00] "/dev/sdb1" is a new physical volume of "<50.00 GiB" [00:21:00] --- NEW Physical volume --- [00:21:00] PV Name /dev/sdb1 [00:21:00] VG Name [00:21:00] PV Size <50.00 GiB [00:21:00] Allocatable NO [00:21:00] PE Size 0 [00:21:00] Total PE 0 [00:21:00] Free PE 0 [00:21:00] Allocated PE 0 [00:21:00] PV UUID 1fe7mf-mpev-n6EJ-3gmw-QBNR-JrQ3-lsj8dQ [00:21:00] [00:21:13][root@localhost ~]# pvs [00:21:13] PV VG Fmt Attr PSize PFree [00:21:13] /dev/sda3 VG1 lvm2 a-- 34.00g 0 [00:21:13] /dev/sdb1 lvm2 --- <50.00g <50.00g [00:21:14][root@localhost ~]# [00:21:14][root@localhost ~]# [00:21:21][root@localhost ~]# pvsan [00:21:21]-bash: pvsan: command not found [00:21:38][root@localhost ~]# [00:21:42][root@localhost ~]# vgcreate VG2 /dev/sdb1 -s 64m [00:21:42] Volume group "VG2" successfully created [00:21:43][root@localhost ~]# [00:21:50][root@localhost ~]# pvs [00:21:50] PV VG Fmt Attr PSize PFree [00:21:50] /dev/sda3 VG1 lvm2 a-- 34.00g 0 [00:21:50] /dev/sdb1 VG2 lvm2 a-- <49.94g <49.94g [00:21:51][root@localhost ~]# [00:21:58][root@localhost ~]# vgs [00:21:58] VG #PV #LV #SN Attr VSize VFree [00:21:58] VG1 1 4 0 wz--n- 34.00g 0 [00:21:58] VG2 1 0 0 wz--n- <49.94g <49.94g [00:22:15][root@localhost ~]# [00:22:17][root@localhost ~]# vgdisplay VG2 [00:22:17] --- Volume group --- [00:22:17] VG Name VG2 [00:22:17] System ID [00:22:17] Format lvm2 [00:22:17] Metadata Areas 1 [00:22:17] Metadata Sequence No 1 [00:22:17] VG Access read/write [00:22:17] VG Status resizable [00:22:17] MAX LV 0 [00:22:17] Cur LV 0 [00:22:17] Open LV 0 [00:22:17] Max PV 0 [00:22:17] Cur PV 1 [00:22:17] Act PV 1 [00:22:17] VG Size <49.94 GiB [00:22:17] PE Size 64.00 MiB [00:22:17] Total PE 799 [00:22:17] Alloc PE / Size 0 / 0 [00:22:17] Free PE / Size 799 / <49.94 GiB [00:22:17] VG UUID O854uO-26SC-5qoM-rUIq-4su0-baOG-NrWsX8 [00:22:17] [00:22:17][root@localhost ~]# [00:22:26][root@localhost ~]# vgdisplay VG1 [00:22:26] --- Volume group --- [00:22:26] VG Name VG1 [00:22:26] System ID [00:22:26] Format lvm2 [00:22:26] Metadata Areas 1 [00:22:26] Metadata Sequence No 5 [00:22:26] VG Access read/write [00:22:26] VG Status resizable [00:22:26] MAX LV 0 [00:22:26] Cur LV 4 [00:22:26] Open LV 4 [00:22:26] Max PV 0 [00:22:26] Cur PV 1 [00:22:26] Act PV 1 [00:22:26] VG Size 34.00 GiB [00:22:26] PE Size 4.00 MiB [00:22:26] Total PE 8704 [00:22:26] Alloc PE / Size 8704 / 34.00 GiB [00:22:26] Free PE / Size 0 / 0 [00:22:26] VG UUID ZnJJkv-QtES-zzqG-dXYX-5RBk-SHLk-eAdzE7 [00:22:26] [00:22:26][root@localhost ~]# [00:22:27][root@localhost ~]# [00:23:12][root@localhost ~]# lvcreate -L 6G -n data VG2 [00:23:12] Logical volume "data" created. [00:23:29][root@localhost ~]# lvcreate -L 40G -n seafile VG2 [00:23:29] Logical volume "seafile" created. [00:23:30][root@localhost ~]# [00:23:40][root@localhost ~]# lvs [00:23:40] LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert [00:23:40] home VG1 -wi-ao---- 10.00g [00:23:40] root VG1 -wi-ao---- 8.00g [00:23:40] swap VG1 -wi-ao---- 8.00g [00:23:40] var VG1 -wi-ao---- 8.00g [00:23:40] data VG2 -wi-a----- 6.00g [00:23:40] seafile VG2 -wi-a----- 40.00g [00:23:41][root@localhost ~]# [00:23:56][root@localhost ~]# lvdisplay [00:23:56] --- Logical volume --- [00:23:56] LV Path /dev/VG2/data [00:23:56] LV Name data [00:23:56] VG Name VG2 [00:23:56] LV UUID U3CfWC-S7aW-koKQ-Tu1i-u1Jk-Fb1A-ClknBg [00:23:56] LV Write Access read/write [00:23:56] LV Creation host, time localhost.localdomain, 2018-03-02 00:23:14 +0800 [00:23:56] LV Status available [00:23:56] # open 0 [00:23:56] LV Size 6.00 GiB [00:23:56] Current LE 96 [00:23:56] Segments 1 [00:23:56] Allocation inherit [00:23:56] Read ahead sectors auto [00:23:56] - currently set to 8192 [00:23:56] Block device 253:4 [00:23:56] [00:23:56] --- Logical volume --- [00:23:56] LV Path /dev/VG2/seafile [00:23:56] LV Name seafile [00:23:56] VG Name VG2 [00:23:56] LV UUID mgYfAg-RMFP-0dAy-voX6-XqQZ-cVIU-nqcaT2 [00:23:56] LV Write Access read/write [00:23:56] LV Creation host, time localhost.localdomain, 2018-03-02 00:23:31 +0800 [00:23:56] LV Status available [00:23:56] # open 0 [00:23:56] LV Size 40.00 GiB [00:23:56] Current LE 640 [00:23:56] Segments 1 [00:23:56] Allocation inherit [00:23:56] Read ahead sectors auto [00:23:56] - currently set to 8192 [00:23:56] Block device 253:5 [00:23:56] [00:23:56] --- Logical volume --- [00:23:56] LV Path /dev/VG1/swap [00:23:56] LV Name swap [00:23:56] VG Name VG1 [00:23:56] LV UUID 5t1MZG-dPoq-TWt8-nB8J-E029-QLQw-W53UKW [00:23:56] LV Write Access read/write [00:23:56] LV Creation host, time localhost, 2018-03-01 23:48:51 +0800 [00:23:56] LV Status available [00:23:56] # open 2 [00:23:56] LV Size 8.00 GiB [00:23:56] Current LE 2048 [00:23:56] Segments 1 [00:23:56] Allocation inherit [00:23:56] Read ahead sectors auto [00:23:56] - currently set to 8192 [00:23:56] Block device 253:1 [00:23:56] [00:23:56] --- Logical volume --- [00:23:56] LV Path /dev/VG1/root [00:23:56] LV Name root [00:23:56] VG Name VG1 [00:23:56] LV UUID gfN0LH-Ymg0-NMsl-0l0C-bmY9-eWXS-2UQRdC [00:23:56] LV Write Access read/write [00:23:56] LV Creation host, time localhost, 2018-03-01 23:48:51 +0800 [00:23:56] LV Status available [00:23:56] # open 1 [00:23:56] LV Size 8.00 GiB [00:23:56] Current LE 2048 [00:23:56] Segments 1 [00:23:56] Allocation inherit [00:23:56] Read ahead sectors auto [00:23:56] - currently set to 8192 [00:23:56] Block device 253:0 [00:23:56] [00:23:56] --- Logical volume --- [00:23:56] LV Path /dev/VG1/home [00:23:56] LV Name home [00:23:56] VG Name VG1 [00:23:56] LV UUID 0xsU0L-5Dk1-JCOx-Dfpf-2CN0-qu1c-OpOOns [00:23:56] LV Write Access read/write [00:23:56] LV Creation host, time localhost, 2018-03-01 23:48:52 +0800 [00:23:56] LV Status available [00:23:56] # open 1 [00:23:56] LV Size 10.00 GiB [00:23:56] Current LE 2560 [00:23:56] Segments 1 [00:23:56] Allocation inherit [00:23:56] Read ahead sectors auto [00:23:56] - currently set to 8192 [00:23:56] Block device 253:2 [00:23:56] [00:23:56] --- Logical volume --- [00:23:56] LV Path /dev/VG1/var [00:23:56] LV Name var [00:23:56] VG Name VG1 [00:23:56] LV UUID 8duoem-Ts2m-k5nK-ChdS-gUKG-tmXl-FiXXW3 [00:23:56] LV Write Access read/write [00:23:56] LV Creation host, time localhost, 2018-03-01 23:48:53 +0800 [00:23:56] LV Status available [00:23:56] # open 1 [00:23:56] LV Size 8.00 GiB [00:23:56] Current LE 2048 [00:23:56] Segments 1 [00:23:56] Allocation inherit [00:23:56] Read ahead sectors auto [00:23:56] - currently set to 8192 [00:23:56] Block device 253:3 [00:23:56] [00:23:58][root@localhost ~]# [00:24:20][root@localhost ~]# mkfs.xfs /dev/VG2/data [00:24:20]meta-data=/dev/VG2/data isize=512 agcount=4, agsize=393216 blks [00:24:20] = sectsz=512 attr=2, projid32bit=1 [00:24:20] = crc=1 finobt=0, sparse=0 [00:24:20]data = bsize=4096 blocks=1572864, imaxpct=25 [00:24:20] = sunit=0 swidth=0 blks [00:24:20]naming =version 2 bsize=4096 ascii-ci=0 ftype=1 [00:24:20]log =internal log bsize=4096 blocks=2560, version=2 [00:24:20] = sectsz=512 sunit=0 blks, lazy-count=1 [00:24:20]realtime =none extsz=4096 blocks=0, rtextents=0 [00:24:22][root@localhost ~]# [00:24:22][root@localhost ~]# [00:24:27][root@localhost ~]# mkfs.xfs /dev/VG2/seafile [00:24:27]meta-data=/dev/VG2/seafile isize=512 agcount=4, agsize=2621440 blks [00:24:27] = sectsz=512 attr=2, projid32bit=1 [00:24:27] = crc=1 finobt=0, sparse=0 [00:24:27]data = bsize=4096 blocks=10485760, imaxpct=25 [00:24:27] = sunit=0 swidth=0 blks [00:24:27]naming =version 2 bsize=4096 ascii-ci=0 ftype=1 [00:24:27]log =internal log bsize=4096 blocks=5120, version=2 [00:24:27] = sectsz=512 sunit=0 blks, lazy-count=1 [00:24:27]realtime =none extsz=4096 blocks=0, rtextents=0 [00:24:29][root@localhost ~]# [00:24:29][root@localhost ~]# [00:24:29][root@localhost ~]# [00:24:36][root@localhost ~]# lvs [00:24:36] LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert [00:24:36] home VG1 -wi-ao---- 10.00g [00:24:36] root VG1 -wi-ao---- 8.00g [00:24:36] swap VG1 -wi-ao---- 8.00g [00:24:36] var VG1 -wi-ao---- 8.00g [00:24:36] data VG2 -wi-a----- 6.00g [00:24:36] seafile VG2 -wi-a----- 40.00g [00:24:36][root@localhost ~]# [00:24:52][root@localhost ~]# lvdisplay [00:24:52] --- Logical volume --- [00:24:52] LV Path /dev/VG2/data [00:24:52] LV Name data [00:24:52] VG Name VG2 [00:24:52] LV UUID U3CfWC-S7aW-koKQ-Tu1i-u1Jk-Fb1A-ClknBg [00:24:52] LV Write Access read/write [00:24:52] LV Creation host, time localhost.localdomain, 2018-03-02 00:23:14 +0800 [00:24:52] LV Status available [00:24:52] # open 0 [00:24:52] LV Size 6.00 GiB [00:24:52] Current LE 96 [00:24:52] Segments 1 [00:24:52] Allocation inherit [00:24:52] Read ahead sectors auto [00:24:52] - currently set to 8192 [00:24:52] Block device 253:4 [00:24:52] [00:24:52] --- Logical volume --- [00:24:52] LV Path /dev/VG2/seafile [00:24:52] LV Name seafile [00:24:52] VG Name VG2 [00:24:52] LV UUID mgYfAg-RMFP-0dAy-voX6-XqQZ-cVIU-nqcaT2 [00:24:52] LV Write Access read/write [00:24:52] LV Creation host, time localhost.localdomain, 2018-03-02 00:23:31 +0800 [00:24:52] LV Status available [00:24:52] # open 0 [00:24:52] LV Size 40.00 GiB [00:24:52] Current LE 640 [00:24:52] Segments 1 [00:24:52] Allocation inherit [00:24:52] Read ahead sectors auto [00:24:52] - currently set to 8192 [00:24:52] Block device 253:5 [00:24:52] [00:24:52] --- Logical volume --- [00:24:52] LV Path /dev/VG1/swap [00:24:52] LV Name swap [00:24:52] VG Name VG1 [00:24:52] LV UUID 5t1MZG-dPoq-TWt8-nB8J-E029-QLQw-W53UKW [00:24:52] LV Write Access read/write [00:24:52] LV Creation host, time localhost, 2018-03-01 23:48:51 +0800 [00:24:52] LV Status available [00:24:52] # open 2 [00:24:52] LV Size 8.00 GiB [00:24:52] Current LE 2048 [00:24:52] Segments 1 [00:24:52] Allocation inherit [00:24:52] Read ahead sectors auto [00:24:52] - currently set to 8192 [00:24:52] Block device 253:1 [00:24:52] [00:24:52] --- Logical volume --- [00:24:52] LV Path /dev/VG1/root [00:24:52] LV Name root [00:24:52] VG Name VG1 [00:24:52] LV UUID gfN0LH-Ymg0-NMsl-0l0C-bmY9-eWXS-2UQRdC [00:24:52] LV Write Access read/write [00:24:52] LV Creation host, time localhost, 2018-03-01 23:48:51 +0800 [00:24:52] LV Status available [00:24:52] # open 1 [00:24:52] LV Size 8.00 GiB [00:24:52] Current LE 2048 [00:24:52] Segments 1 [00:24:52] Allocation inherit [00:24:52] Read ahead sectors auto [00:24:52] - currently set to 8192 [00:24:52] Block device 253:0 [00:24:52] [00:24:52] --- Logical volume --- [00:24:52] LV Path /dev/VG1/home [00:24:52] LV Name home [00:24:52] VG Name VG1 [00:24:52] LV UUID 0xsU0L-5Dk1-JCOx-Dfpf-2CN0-qu1c-OpOOns [00:24:52] LV Write Access read/write [00:24:52] LV Creation host, time localhost, 2018-03-01 23:48:52 +0800 [00:24:52] LV Status available [00:24:52] # open 1 [00:24:52] LV Size 10.00 GiB [00:24:52] Current LE 2560 [00:24:52] Segments 1 [00:24:52] Allocation inherit [00:24:52] Read ahead sectors auto [00:24:52] - currently set to 8192 [00:24:52] Block device 253:2 [00:24:52] [00:24:52] --- Logical volume --- [00:24:52] LV Path /dev/VG1/var [00:24:52] LV Name var [00:24:52] VG Name VG1 [00:24:52] LV UUID 8duoem-Ts2m-k5nK-ChdS-gUKG-tmXl-FiXXW3 [00:24:52] LV Write Access read/write [00:24:52] LV Creation host, time localhost, 2018-03-01 23:48:53 +0800 [00:24:52] LV Status available [00:24:52] # open 1 [00:24:52] LV Size 8.00 GiB [00:24:52] Current LE 2048 [00:24:52] Segments 1 [00:24:52] Allocation inherit [00:24:52] Read ahead sectors auto [00:24:52] - currently set to 8192 [00:24:52] Block device 253:3 [00:24:52] [00:24:53][root@localhost ~]# [00:24:53][root@localhost ~]# [00:25:11][root@localhost ~]# [00:25:11][root@localhost ~]# [00:25:18][root@localhost ~]# mkdir /data [00:25:21][root@localhost ~]# mkdir /seafile [00:25:22][root@localhost ~]# [00:25:41][root@localhost ~]# vi /etc/fstab [00:25:41]# [00:25:41]# /etc/fstab [00:25:41]# Created by anaconda on Thu Mar 1 23:48:55 2018 [00:25:41]# [00:25:41]# Accessible filesystems, by reference, are maintained under '/dev/disk' [00:25:41]# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info [00:25:41]# [00:25:41]/dev/mapper/VG1-root / xfs defaults 0 0 [00:25:41]UUID=5aaa3f4a-ee7d-4d72-8de9-3a130c1db0d9 /boot xfs defaults 0 0 [00:25:41]/dev/mapper/VG1-home /home xfs defaults 0 0 [00:25:41]/dev/mapper/VG1-var /var xfs defaults 0 0 [00:25:41]/dev/mapper/VG1-swap swap swap defaults 0 0 [00:25:42] [00:25:42]# [00:25:42]# /etc/fstab [00:25:42]# Created by anaconda on Thu Mar 1 23:48:55 2018 [00:25:42]# [00:25:42]# Accessible filesystems, by reference, are maintained under '/dev/disk' [00:25:42]# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info [00:25:42]# [00:25:42]/dev/mapper/VG1-root / xfs defaults 0 0 [00:25:42]UUID=5aaa3f4a-ee7d-4d72-8de9-3a130c1db0d9 /boot xfs defaults 0 0 [00:25:42]/dev/mapper/VG1-home /home xfs defaults 0 0 [00:25:42]/dev/mapper/VG1-var /var xfs defaults 0 0 [00:26:51]"/etc/fstab" 15L, 769C written [00:26:52][root@localhost ~]# [00:26:52][root@localhost ~]# [00:27:00][root@localhost ~]# reboot [00:27:00][20180302_00:27:00]


3.检查ntp
rpm -q ntp
yum install ntp
systemctl start ntpd
systemctl enable ntpd

检查影响ntp开机自动启动的程序
systemctl status chronyd
systemctl disable chronyd.service

4.挂载后端nfs存储,要实现权限一致,需满足客户端与服务端用户、组权限UID、GID一致
id root //查看root的UID和GID
groupmod -g 1003 root //修改组GID以匹配nas
yum install nfs_utils
yum install rpcbind //安装nfs客户端
systemctl start rpcbind.service
systemctl enable rpcbind.service
mount -t nfs 192.168.251.251:/mnt/volume1/nfsdata /data //手动挂载nfs
vi /etc/fstab //进入磁盘挂载配置文件,手动添加为自动挂载
192.168.251.251:/mnt/volume1/nfsdata /data nfs defaults 0 0 //添加以便开机自动挂载
示例:

[00:46:12][root@localhost ~]# mount -t nfs /mnt/volume1/nfsdata /data
[00:46:12]mount.nfs: remote share not in ‘host:dir’ format
[00:46:39][root@localhost ~]# mount -t nfs 192.168.251.251:/mnt/volume1/nfsdata /data
[00:46:42][root@localhost ~]# df -h
[00:46:42]Filesystem Size Used Avail Use% Mounted on
[00:46:42]/dev/mapper/VG1-root 8.0G 1.9G 6.2G 23% /
[00:46:42]devtmpfs 910M 0 910M 0% /dev
[00:46:42]tmpfs 920M 0 920M 0% /dev/shm
[00:46:42]tmpfs 920M 8.6M 912M 1% /run
[00:46:42]tmpfs 920M 0 920M 0% /sys/fs/cgroup
[00:46:42]/dev/sda2 1014M 191M 824M 19% /boot
[00:46:42]/dev/mapper/VG1-home 10G 33M 10G 1% /home
[00:46:42]192.168.251.251:/mnt/volume1/nfsdata 2.6T 128K 2.6T 1% /data
[00:46:42]/dev/mapper/VG2-seafile 40G 33M 40G 1% /seafile
[00:46:42]/dev/mapper/VG1-var 8.0G 201M 7.8G 3% /var
[00:46:42]tmpfs 184M 0 184M 0% /run/user/0
[00:47:33][root@localhost ~]# vi /etc/fstab
[00:47:33]#
[00:47:33]# /etc/fstab
[00:47:33]# Created by anaconda on Thu Mar 1 23:48:55 2018
[00:47:33]#
[00:47:33]# Accessible filesystems, by reference, are maintained under ‘/dev/disk’
[00:47:33]# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
[00:47:33]#
[00:47:33]/dev/mapper/VG1-root / xfs defaults 0 0
[00:47:33]UUID=5aaa3f4a-ee7d-4d72-8de9-3a130c1db0d9 /boot xfs defaults 0 0
[00:47:33]/dev/mapper/VG1-home /home xfs defaults 0 0
[00:47:33]/dev/mapper/VG1-var /var xfs defaults 0 0
[00:47:33]/dev/mapper/VG1-swap swap swap defaults 0 0
[00:47:33]/dev/mapper/VG2-data /data xfs defaults 0 0
[00:47:33]/dev/mapper/VG2-seafile /seafile xfs defaults 0 0
[00:47:34]
[00:47:34]#
[00:47:34]# /etc/fstab
[00:47:34]# Created by anaconda on Thu Mar 1 23:48:55 2018
[00:47:34]#
[00:47:34]# Accessible filesystems, by reference, are maintained under ‘/dev/disk’
[00:47:34]# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
[00:47:34]#
[00:47:34]/dev/mapper/VG1-root / xfs defaults 0 0
[00:47:35]UUID=5aaa3f4a-ee7d-4d72-8de9-3a130c1db0d9 /boot xfs defaults 0 0
[00:47:35]/dev/mapper/VG1-home /home xfs defaults 0 0
[00:47:35]/dev/mapper/VG1-var /var xfs defaults 0 0
[00:47:35]/dev/mapper/VG1-swap swap swap defaults 0 0
[00:47:35]/dev/mapper/VG2-data /data xfs defaults 0 0
[00:48:22]”/etc/fstab” 16L, 845C written
[00:48:48][root@localhost ~]#
[00:48:48][root@localhost ~]#

5.设置本地区域
locale //查看本地区域设置
ls /etc/ //查看设置文件
export LC_ALL=”en_US.UTF-8″ //手动临时添加
vi /etc/profile //进入profile文件添加export LC_ALL=”en_US.UTF-8″ 设置后开机会自动加载
示例:

[00:06:27][root@localhost ~]# locale
[00:06:27]LANG=en_US.UTF-8
[00:06:27]LC_CTYPE=”en_US.UTF-8″
[00:06:27]LC_NUMERIC=”en_US.UTF-8″
[00:06:27]LC_TIME=”en_US.UTF-8″
[00:06:27]LC_COLLATE=”en_US.UTF-8″
[00:06:27]LC_MONETARY=”en_US.UTF-8″
[00:06:27]LC_MESSAGES=”en_US.UTF-8″
[00:06:27]LC_PAPER=”en_US.UTF-8″
[00:06:27]LC_NAME=”en_US.UTF-8″
[00:06:27]LC_ADDRESS=”en_US.UTF-8″
[00:06:27]LC_TELEPHONE=”en_US.UTF-8″
[00:06:27]LC_MEASUREMENT=”en_US.UTF-8″
[00:06:27]LC_IDENTIFICATION=”en_US.UTF-8″
[00:06:27]LC_ALL=
[00:06:43][root@localhost ~]# export LC_ALL=”en_US.UTF-8″
[00:06:45][root@localhost ~]# locale
[00:06:45]LANG=en_US.UTF-8
[00:06:45]LC_CTYPE=”en_US.UTF-8″
[00:06:45]LC_NUMERIC=”en_US.UTF-8″
[00:06:45]LC_TIME=”en_US.UTF-8″
[00:06:45]LC_COLLATE=”en_US.UTF-8″
[00:06:45]LC_MONETARY=”en_US.UTF-8″
[00:06:45]LC_MESSAGES=”en_US.UTF-8″
[00:06:45]LC_PAPER=”en_US.UTF-8″
[00:06:45]LC_NAME=”en_US.UTF-8″
[00:06:45]LC_ADDRESS=”en_US.UTF-8″
[00:06:45]LC_TELEPHONE=”en_US.UTF-8″
[00:06:45]LC_MEASUREMENT=”en_US.UTF-8″
[00:06:45]LC_IDENTIFICATION=”en_US.UTF-8″
[00:06:45]LC_ALL=en_US.UTF-8
[00:06:46][root@localhost ~]#
[00:06:47][root@localhost ~]#
[00:06:59][root@localhost ~]# vi /etc/profile
[00:06:59]# /etc/profile
[00:06:59]
[00:06:59]# System wide environment and startup programs, for login setup
[00:06:59]# Functions and aliases go in /etc/bashrc
[00:06:59]
[00:06:59]# It’s NOT a good idea to change this file unless you know what you
[00:06:59]# are doing. It’s much better to create a custom.sh shell script in
[00:06:59]# /etc/profile.d/ to make custom changes to your environment, as this
[00:06:59]# will prevent the need for merging in future updates.
[00:06:59]
[00:06:59]pathmunge () {
[00:06:59] fi
[00:06:59] esac
[00:06:59]}
[00:06:59]
[00:06:59]
[00:06:59]if [ -x /usr/bin/id ]; then
[00:06:59] UID=/usr/bin/id -ru
[00:06:59] fi
[00:06:59] USER=”/usr/bin/id -un”
[00:06:59] LOGNAME=$USER
[00:06:59] MAIL=”/var/spool/mail/$USER”
[00:06:59]fi
[00:06:59]
[00:06:59]# Path manipulation
[00:06:59]if [ “$EUID” = “0” ]; then
[00:06:59] pathmunge /usr/sbin
[00:07:00]# /etc/profile
[00:07:00]
[00:07:00]# System wide environment and startup programs, for login setup
[00:07:00]# Functions and aliases go in /etc/bashrc
[00:07:00]
[00:07:00]# It’s NOT a good idea to change this file unless you know what you
[00:07:00]# are doing. It’s much better to create a custom.sh shell script in
[00:07:00]# /etc/profile.d/ to make custom changes to your environment, as this
[00:07:00]# will prevent the need for merging in future updates.
[00:07:00]
[00:07:00]pathmunge () {
[00:07:00] case “:${PATH}:” in
[00:07:00] :”$1″:)
[00:07:00] ;;
[00:07:00] ) [00:07:00] if [ “$2” = “after” ] ; then [00:07:01] PATH=$PATH:$1 [00:07:01] else [00:07:01] PATH=$1:$PATH [00:07:01] fi [00:07:01] esac [00:07:01]} [00:07:01] [00:07:01] [00:07:01]if [ -x /usr/bin/id ]; then [00:07:01] if [ -z “$EUID” ]; then [00:07:01] # ksh workaround [00:07:01] EUID=/usr/bin/id -u [00:07:01] UID=/usr/bin/id -ru [00:07:01] fi [00:07:01] USER=”/usr/bin/id -un” [00:07:01] LOGNAME=$USER [00:07:01] MAIL=”/var/spool/mail/$USER” [00:07:01]fi [00:07:01] [00:07:01]# Path manipulation [00:07:01]if [ “$EUID” = “0” ]; then [00:07:01] pathmunge /usr/sbin [00:07:01] pathmunge /usr/local/sbin [00:07:01]else [00:07:01] pathmunge /usr/local/sbin after [00:07:01] pathmunge /usr/sbin after [00:07:01]fi [00:07:01] [00:07:01]HOSTNAME=/usr/bin/hostname 2>/dev/null [00:07:01]HISTSIZE=1000 [00:07:02]if [ “$HISTCONTROL” = “ignorespace” ] ; then [00:07:02] export HISTCONTROL=ignoreboth [00:07:02]else [00:07:02] export HISTCONTROL=ignoredups [00:07:02]fi [00:07:02] [00:07:02]export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL [00:07:02] [00:07:02]# By default, we want umask to get set. This sets it for login shell [00:07:02]# Current threshold for system reserved uid/gids is 200 [00:07:02]# You could check uidgid reservation validity in [00:07:02]# /usr/share/doc/setup-/uidgid file
[00:07:02]if [ $UID -gt 199 ] && [ “/usr/bin/id -gn” = “/usr/bin/id -un” ]; then
[00:07:02] umask 002
[00:07:02]else
[00:07:02] umask 022
[00:07:02]fi
[00:07:02]
[00:07:02]for i in /etc/profile.d/.sh ; do [00:07:02] if [ -r “$i” ]; then [00:07:02] if [ “${-#i}” != “$-” ]; then
[00:07:02] . “$i”
[00:07:02] else
[00:07:02] . “$i” >/dev/null
[00:07:02] fi
[00:07:02] fi
[00:07:02]done
[00:07:02]
[00:07:02]unset i
[00:07:06]unset -f pathmunge
[00:07:08]unset -f pathmunge
[00:07:08]
[00:07:09]
[00:07:09]
[00:07:09]
[00:07:09]
[00:07:15]export LC_ALL=”en_US.UTF-8″
[00:07:18]”/etc/profile” 82L, 1828C written
[00:07:18][root@localhost ~]#


6.创建seafile安装所需的目录
mkdir /seafile/installed

7.安装涉及seafile所需的组件
yum install python-setuptools python-imaging python-ldap MySQL-python python-memcached //安装pyhon以及mysql依赖组件
yum install -y mariadb mariadb-server mysql //安装mysql数据库
yum install java //安装java
java -version
yum install poppler-utils
yum install libreoffice libreoffice-headless libreoffice-pyuno //安装办公文件在线预览
systemctl start mariadb.service
systemctl enable mariadb.service

8.mysql安全设置
mysql_secure_installation
myslq -u root -p //登录mysql查看数据库情况
示例:

[01:10:33][root@localhost seafile-pro-server-6.2.9]# mysql_secure_installation
[01:10:33]
[01:10:33]NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
[01:10:33] SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
[01:10:33]
[01:10:33]In order to log into MariaDB to secure it, we’ll need the current
[01:10:33]password for the root user. If you’ve just installed MariaDB, and
[01:10:33]you haven’t set the root password yet, the password will be blank,
[01:10:33]so you should just press enter here.
[01:10:33]
[01:10:36]Enter current password for root (enter for none):
[01:10:36]OK, successfully used password, moving on…
[01:10:36]
[01:10:36]Setting the root password ensures that nobody can log into the MariaDB
[01:10:36]root user without the proper authorisation.
[01:10:36]
[01:10:39]Set root password? [Y/n] y
[01:10:44]New password:
[01:10:49]Re-enter new password:
[01:10:49]Password updated successfully!
[01:10:49]Reloading privilege tables..
[01:10:49] … Success!
[01:10:49]
[01:10:50]
[01:10:50]By default, a MariaDB installation has an anonymous user, allowing anyone
[01:10:50]to log into MariaDB without having to have a user account created for
[01:10:50]them. This is intended only for testing, and to make the installation
[01:10:50]go a bit smoother. You should remove them before moving into a
[01:10:50]production environment.
[01:10:50]
[01:10:52]Remove anonymous users? [Y/n] y
[01:10:52] … Success!
[01:10:52]
[01:10:52]Normally, root should only be allowed to connect from ‘localhost’. This
[01:10:52]ensures that someone cannot guess at the root password from the network.
[01:10:52]
[01:10:53]Disallow root login remotely? [Y/n] y
[01:10:53] … Success!
[01:10:53]
[01:10:53]By default, MariaDB comes with a database named ‘test’ that anyone can
[01:10:53]access. This is also intended only for testing, and should be removed
[01:10:53]before moving into a production environment.
[01:10:53]
[01:10:56]Remove test database and access to it? [Y/n] y
[01:10:56] – Dropping test database…
[01:10:56] … Success!
[01:10:56] – Removing privileges on test database…
[01:10:56] … Success!
[01:10:56]
[01:10:56]Reloading the privilege tables will ensure that all changes made so far
[01:10:56]will take effect immediately.
[01:10:56]
[01:10:59]Reload privilege tables now? [Y/n] y
[01:10:59] … Success!
[01:10:59]
[01:10:59]Cleaning up…
[01:10:59]
[01:10:59]All done! If you’ve completed all of the above steps, your MariaDB
[01:10:59]installation should now be secure.
[01:10:59]
[01:10:59]Thanks for using MariaDB!
[01:11:01][root@localhost seafile-pro-server-6.2.9]#
[01:11:01][root@localhost seafile-pro-server-6.2.9]#
[01:11:01][root@localhost seafile-pro-server-6.2.9]#
[01:11:01][root@localhost seafile-pro-server-6.2.9]#
[01:11:22][root@localhost seafile-pro-server-6.2.9]#
[01:11:29][root@localhost seafile-pro-server-6.2.9]# mysql -u root -p
[01:11:34]Enter password:
[01:11:34]Welcome to the MariaDB monitor. Commands end with ; or \g.
[01:11:34]Your MariaDB connection id is 10
[01:11:34]Server version: 5.5.56-MariaDB MariaDB Server
[01:11:34]
[01:11:34]Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
[01:11:34]
[01:11:34]Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
[01:11:34]
[01:11:47]MariaDB [(none)]> show databases;
[01:11:47]+——————–+
[01:11:47]| Database |
[01:11:47]+——————–+
[01:11:47]| information_schema |
[01:11:47]| mysql |
[01:11:47]| performance_schema |
[01:11:47]+——————–+
[01:11:47]3 rows in set (0.00 sec)
[01:11:47]
[01:11:48]MariaDB [(none)]>
[01:11:48]MariaDB [(none)]>
[01:11:48]MariaDB [(none)]>
[01:11:53]MariaDB [(none)]> quit;
[01:11:53]Bye
[01:11:53][root@localhost seafile-pro-server-6.2.9]#

9.下载及安装seafile专业版
cd /seafile/installed/
wget https://download.seafile.com/seafhttp/files/a985fe9d-f282-402b-8024-63bea2d381a3/seafile-pro-server_6.2.9_x86-64.tar.gz
tar -xvf seafile-pro-server_6.2.9_x86-64.tar.gz //解压缩
cp -a /seafile/installed/seafile-pro-server-6.2.9 /seafile //复制解压文件至seafile文件夹
cd /seafile/seafile-pro-server-6.2.9
./setup-seafile-mysql.sh //运行安装程序
示例:

[01:12:04][root@localhost seafile-pro-server-6.2.9]# ./setup-seafile-mysql.sh
[01:12:04]Checking python on this machine …
[01:12:04] Checking python module: setuptools … Done.
[01:12:04] Checking python module: python-imaging … Done.
[01:12:05] Checking python module: python-mysqldb … Done.
[01:12:05]
[01:12:05]Checking for java …Done.
[01:12:05]
[01:12:05]—————————————————————–
[01:12:05]This script will guide you to setup your seafile server using MySQL.
[01:12:05]Make sure you have read seafile server manual at
[01:12:05]
[01:12:05] https://github.com/haiwen/seafile/wiki
[01:12:05]
[01:12:05]Press ENTER to continue
[01:12:05]—————————————————————–
[01:12:06]
[01:12:06]
[01:12:06]What is the name of the server? It will be displayed on the client.
[01:12:06]3 – 15 letters or digits
[01:12:09][ server name ] seafile
[01:12:09]
[01:12:09]What is the ip or domain of the server?
[01:12:09]For example: www.mycompany.com, 192.168.1.101
[01:12:19][ This server’s ip or domain ] 192.168.251.210
[01:12:19]
[01:12:19]Where do you want to put your seafile data?
[01:12:19]Please use a volume with enough free space
[01:12:20][ default “/seafile/seafile-data” ]
[01:12:20]
[01:12:20]Which port do you want to use for the seafile fileserver?
[01:12:21][ default “8082” ]
[01:12:21]
[01:12:21]——————————————————-
[01:12:21]Please choose a way to initialize seafile databases:
[01:12:21]——————————————————-
[01:12:21]
[01:12:21][1] Create new ccnet/seafile/seahub databases
[01:12:21][2] Use existing ccnet/seafile/seahub databases
[01:12:21]
[01:12:22][ 1 or 2 ] 1
[01:12:22]
[01:12:22]What is the host of mysql server?
[01:12:24][ default “localhost” ]
[01:12:24]
[01:12:24]What is the port of mysql server?
[01:12:26][ default “3306” ]
[01:12:26]
[01:12:26]What is the password of the mysql root user?
[01:12:30][ root password ]
[01:12:30]
[01:12:31]verifying password of user root … done
[01:12:31]
[01:12:31]Enter the name for mysql user of seafile. It would be created if not exists.
[01:12:33][ default “seafile” ]
[01:12:33]
[01:12:33]Enter the password for mysql user “seafile”:
[01:12:38][ password for seafile ]
[01:12:38]
[01:12:38]Enter the database name for ccnet-server:
[01:12:39][ default “ccnet-db” ]
[01:12:39]
[01:12:39]Enter the database name for seafile-server:
[01:12:40][ default “seafile-db” ]
[01:12:40]
[01:12:40]Enter the database name for seahub:
[01:12:40][ default “seahub-db” ]
[01:12:40]
[01:12:40]———————————
[01:12:40]This is your configuration
[01:12:40]———————————
[01:12:40]
[01:12:40] server name: seafile
[01:12:40] server ip/domain: 192.168.251.210
[01:12:40]
[01:12:40] seafile data dir: /seafile/seafile-data
[01:12:40] fileserver port: 8082
[01:12:40]
[01:12:40] database: create new
[01:12:40] ccnet database: ccnet-db
[01:12:40] seafile database: seafile-db
[01:12:40] seahub database: seahub-db
[01:12:40] database user: seafile
[01:12:40]
[01:12:40]
[01:12:40]
[01:12:40]———————————
[01:12:40]Press ENTER to continue, or Ctrl-C to abort
[01:12:40]———————————
[01:12:42]
[01:12:42]Generating ccnet configuration …
[01:12:42]
[01:12:42]done
[01:12:42]Successly create configuration dir /seafile/ccnet.
[01:12:43]Generating seafile configuration …
[01:12:43]
[01:12:43]Done.
[01:12:44]done
[01:12:44]Generating seahub configuration …
[01:12:44]
[01:12:45]—————————————-
[01:12:45]Now creating seahub database tables …
[01:12:45]
[01:12:45]—————————————-
[01:12:46]
[01:12:46]creating seafile-server-latest symbolic link … done
[01:12:46]
[01:12:46]
[01:12:46]
[01:12:46]
[01:12:46]—————————————————————–
[01:12:46]Your seafile server configuration has been finished successfully.
[01:12:46]—————————————————————–
[01:12:46]
[01:12:46]run seafile server: ./seafile.sh { start | stop | restart }
[01:12:46]run seahub server: ./seahub.sh { start | stop | restart }
[01:12:46]
[01:12:46]—————————————————————–
[01:12:46]If you are behind a firewall, remember to allow input/output of these tcp ports:
[01:12:46]—————————————————————–
[01:12:46]
[01:12:46]port of seafile fileserver: 8082
[01:12:46]port of seahub: 8000
[01:12:46]
[01:12:46]When problems occur, Refer to
[01:12:46]
[01:12:46] https://github.com/haiwen/seafile/wiki
[01:12:46]
[01:12:46]for information.
[01:12:46]
[01:12:46]
[01:12:47][root@localhost seafile-pro-server-6.2.9]#
[01:12:47][root@localhost seafile-pro-server-6.2.9]#
[01:12:48][root@localhost seafile-pro-server-6.2.9]#
[01:12:48][root@localhost seafile-pro-server-6.2.9]#
[01:12:48][root@localhost seafile-pro-server-6.2.9]#
[01:12:48][root@localhost seafile-pro-server-6.2.9]#


10.将seafile的数据存储移动至nfs存储后端
mv /seafile/seafile-data /data
ls /data
ln -s /data/seafile-data /seafile/seafile-data
ls /seafile
示例:

[01:13:14][root@localhost seafile]# mv /seafile/seafile-data /data
[01:13:17][root@localhost seafile]# ls /data
[01:13:17]seafile-data test
[01:13:19][root@localhost seafile]#
[01:13:19][root@localhost seafile]#
[01:13:37][root@localhost seafile]# ln -s /data/seafile-data /seafile/seafile-data
[01:13:41][root@localhost seafile]# ls /seafile
[01:13:41]ccnet conf installed pro-data seafile-data seafile-pro-server-6.2.9 seafile-server-latest seahub-data
[01:13:42][root@localhost seafile]#
[01:13:43][root@localhost seafile]#
[01:13:43][root@localhost seafile]#


11.在防火墙上打开相关端口,包括后续需要开启https的端口
firewall-cmd –permanent –add-port=8000/tcp
firewall-cmd –permanent –add-port=8082/tcp
firewall-cmd –permanent –add-port=80/tcp
firewall-cmd –permanent –add-port=443/tcp
systemctl restart firewalld.service

12.开启seafile服务以测试是否可用
cd /seafile/seafile-pro-server-6.2.9
./seafile.sh start
./seahub.sh start
示例:

[01:14:48][root@localhost seafile]# cd /seafile/seafile-pro-server-6.2.9
[01:14:53][root@localhost seafile-pro-server-6.2.9]# ./seafile.sh start
[01:14:54]
[01:14:54]** Message: seafile-controller.c(1124): loading seafdav config from /seafile/conf/seafdav.conf
[01:14:54]
[01:14:54][03/02/18 01:14:55] ../common/session.c(139): using config file /seafile/conf/ccnet.conf
[01:14:54][03/02/18 01:14:55] ../common/license.c(440): Loading license file /seafile/seafile-license.txt ..
[01:14:54][03/02/18 01:14:55] ../common/license.c(443): License file /seafile/seafile-license.txt does not exist, allow at most 3 trial users
[01:14:54]License file /seafile/seafile-license.txt does not exist, allow at most 3 trial users
[01:14:54]Starting seafile server, please wait …
[01:14:54]** Message: seafile-controller.c(1124): loading seafdav config from /seafile/conf/seafdav.conf
[01:14:54]
[01:14:57]Seafile server started
[01:14:57]
[01:14:57]Done.
[01:15:07][root@localhost seafile-pro-server-6.2.9]# ./seahub.sh start
[01:15:07]
[01:15:07]Starting seahub at port 8000 …
[01:15:07]
[01:15:07]—————————————-
[01:15:07]It’s the first time you start the seafile server. Now let’s create the admin account
[01:15:07]—————————————-
[01:15:07]
[01:15:07]What is the email for the admin account?
[01:15:23][ admin email ] 1032266781@qq.com
[01:15:23]
[01:15:23]What is the password for the admin account?
[01:15:28][ admin password ]
[01:15:28]
[01:15:28]Enter the password again:
[01:15:32][ admin password again ]
[01:15:32]
[01:15:32]
[01:15:32]
[01:15:32]—————————————-
[01:15:32]Successfully created seafile admin
[01:15:32]—————————————-
[01:15:32]
[01:15:32]
[01:15:32]
[01:15:37]
[01:15:37]Seahub is started
[01:15:37]
[01:15:37]Done.
[01:15:37]
[01:16:14][root@localhost seafile-pro-server-6.2.9]#

13.安装nginx,实现nginx反向代理
yum install epel-release
yum install nginx
systemctl start nginx.service
systemctl enable nginx.service
nginx -t //测试nginx配置是否合规

14.根据seafile修改nginx的配置
示例:

[root@localhost ~]# vi /etc/nginx/nginx.conf
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
#error_log /var/log/nginx/error.log; //注释掉
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
worker_connections 1024;
}

http {
log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;

# access_log /var/log/nginx/access.log main; //注释掉

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

include /etc/nginx/mime.types;
default_type application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

# Settings for a TLS enabled server.
#
# server {
# listen 443 ssl http2 default_server;
# listen [::]:443 ssl http2 default_server;
# server_name _;
# root /usr/share/nginx/html;
#
# ssl_certificate “/etc/pki/nginx/server.crt”;
# ssl_certificate_key “/etc/pki/nginx/private/server.key”;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 10m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
#
# # Load configuration files for the default server block.
# include /etc/nginx/default.d/*.conf;
#
# location / {
# }
#
# error_page 404 /404.html;
# location = /40x.html {
# }
#
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }
# }

}

15.申请ssl证书
openssl genrsa -out privkey.pem 2048
openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095
ls //查看证书在根目录下
cp -a cacert.pem /etc/ssl //复制证书到ssl目录
cp -a privkey.pem /etc/ssl
示例:

[01:34:58][root@localhost ~]# openssl genrsa -out privkey.pem 2048
[01:34:58]Generating RSA private key, 2048 bit long modulus
[01:34:58]………………..+++
[01:34:58]……………..+++
[01:34:58]e is 65537 (0x10001)
[01:35:15][root@localhost ~]#
[01:35:15][root@localhost ~]#
[01:35:17][root@localhost ~]# openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095
[01:35:17]You are about to be asked to enter information that will be incorporated
[01:35:17]into your certificate request.
[01:35:17]What you are about to enter is what is called a Distinguished Name or a DN.
[01:35:17]There are quite a few fields but you can leave some blank
[01:35:17]For some fields there will be a default value,
[01:35:17]If you enter ‘.’, the field will be left blank.
[01:36:20]—–
[01:37:07][root@localhost ~]#
[01:37:07][root@localhost ~]#
[01:37:08][root@localhost ~]#
[01:37:08][root@localhost ~]# ls
[01:37:08]anaconda-ks.cfg cacert.pem privkey.pem
[01:37:09][root@localhost ~]#
[01:37:10][root@localhost ~]#
[01:37:19][root@localhost ~]# ls /etc/ssl
[01:37:19]certs
[01:37:38][root@localhost ~]# cp -a cacert.pem /etc/ssl
[01:37:47][root@localhost ~]# cp -a privkey.pem /etc/ssl


16.关闭centos的selinux
sestatus //查看状态
setenforce 0 //强制临时关闭
vi /etc/selinux/config //将SELINUX=enforcing改为SELINUX=disabled

[01:39:21][root@localhost ~]# sestatus
[01:39:21]SELinux status: enabled
[01:39:21]SELinuxfs mount: /sys/fs/selinux
[01:39:21]SELinux root directory: /etc/selinux
[01:39:21]Loaded policy name: targeted
[01:39:21]Current mode: enforcing
[01:39:21]Mode from config file: enforcing
[01:39:21]Policy MLS status: enabled
[01:39:21]Policy deny_unknown status: allowed
[01:39:21]Max kernel policy version: 28
[01:40:22][root@localhost ~]# setenforce 0
[01:40:32][root@localhost ~]#


17.在/etc/nginx/conf.d/下新增了seafile.conf配置文件
vi /etc/nginx/conf.d/seafile.conf

server {
listen 80;
server_name mc.seacloud.com;
rewrite ^ https://$http_host$request_uri? permanent;
server_tokens off;
}

server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/cacert.pem;
ssl_certificate_key /etc/ssl/privkey.pem;
server_name mc.seacloud.com;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:5m;
server_tokens off;

proxy_set_header X-Forwarded-For $remote_addr;

location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s;

# used for view/edit office file via Office Online Server
client_max_body_size 0;

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;
proxy_send_timeout 36000s;

send_timeout 36000s;
}

location /media {
root /seafile/seafile-server-latest/seahub;
}

}


18.在seafile管理页面将url的链接进行更改
https://mc.seacloud.com
https://mc.seacloud.com/seafhttp
19.在后端配置上也进行更改
vi /seafile/conf/ccnet.conf
将原有链接http://192.168.251.210:8000改为https://mc.seacloud.com
vi /seafile/conf/seahub_setting.py
在原有配置文件最后新增:FILE_SERVER_ROOT = ‘https://mc.seacloud.com/seafhttp’
20.重启seafile服务
21.网页登录后将证书导出,并将证书导入到Windows信任区域即可

关于作者

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

你可能还喜欢这些