Seafile: Install and Set

 

 

  • Seafile
    • wget https://bitbucket.org/haiwen/seafile/downloads/seafile-server_2.2.1_x86-64.tar.gz
    • tar zxf seafile-server_2.2.1_x86-64.tar.gz
    • apt-get -y install libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmysqlclient-dev libarchive-dev libtool libjansson-dev valac libfuse-dev sqlite3 python-mysqldb
    • Install libzdb
    • Install libevhtp
  • Seahub (Web Env)
    • apt-get -y install python-djblets sqlite3 python-simplejson python-image chardet gunicorn
  • Prepare Directories
    • cd seafile dir
    • ./seafile-setup.sh

 

 

OpenLDAP on Centos 6

yum install openldap-servers system-config-firewall-tui

sed -i “s/example/owncloudbook/g” olcDatabasse={2}bdb.ldif

openssl req -new -x509 -nodes -out /etc/pki/tls/certs/owncloud-cert.pem -keyout /etc/pki/tls/certs/owncloudbook.key.pem -days 3650

chown root:ldap /etc/pki/tls/certs/owncloudbook*

chmod 750 /etc/pki/tls/certs/owncloudbook*
echo << {olcDatabase={2}bdb.ldif EOF

olcTLSCertificateFile: /etc/pki/tls/certs/owncloudbook-cert.pem

olcTLSCertificateKeyFile: /etc/pki/tls/certs/owncloudbook-cert-key.pemsed -i /example/owncloudbook/g” olc

EOF

sed -i “s/example/owncloudbook/g” olcDatabase={1}monitor.ldif

cp /usr/share/openldap-servers/DB_CONF.example /var/lib/ldap/DB_CONFIG

chown -Rf  ldap:ldap /var/lib/ldap

vi /etc/sysconfig/ldap

SLAPD_LDAPS=yes

–> save and close

slaptest -u

services lapd start

TLS_CACERRT /etc/pki/tls/certs/owncloudbook-cert.pem

URI ldap://127.0.01

BASE dc=owncloud,dc=com

–> save and close

ldapsearch -x -b “dc=owncloudbook,dc=com”

 

groups.ldif and users.ldif

vi /etc/openldap/schema/base.ldif

dn: dc=owncloudbook,dc=com

dc: owncloudbook

objectClass: top

ocjbectClass: domain

dn: ou=Users,dc=owncloud,dc=com

ou: Users

objectClass: top

objectClass: organizationalUnit

dn: ou=Group, dc

Checking for Rootkits and Malware on Linux

  1. wget http://sourceforge.net/projects/rkhunter/files/rkhunter/1.4.2/rkhunter-1.4.2.tar.gz/download
  2. tar -zxpvf  rkhunter-1.4.2.tar
  3. cd rkhunter-1.4.2
  4. ./installer.sh –layout default –install
  5. /usr/local/bin/rkhunter –update
  6. /usr/local/bin/rkhunter –propupd
  7. rkhunter –check

Pulled from:  http://sourceforge.net/projects/rkhunter/files/rkhunter/1.4.2/

Needed a bit of updating.

 

http://www.nextstep4it.com/categories/how-to/rkhunter/

zfs tutorial

This explains how to setup openzfs on an ubuntu system.  My system has an iqstor 15 drive array on it, and that is what I will be using in this example.

  1. apt-get install python-software-properties
  2. add-apt-repository ppa:zfs-native/stable
  3. apt-get update
  4. apt-get install ubuntu-zfs
  5. zpool create -f -o ashift=12 tank raidz \
    ata-ST4000DM000-1111 ata-ST40000DM000-2222 ata-ST40000DM000-3333

NAS Build:
zpool create -f -o ashift=12 tank raidz2 \

 

SLC SLOG drive
unit MiB
mkpart zfs 1 16385
mkpart zfs 16285 122104
quit
zpool add tank log mirror <part1> <part2> <part3> (SLOG)
zpool add tank cache (L2ARC)

Filesystems are called datasets:
They all share the storage pool equally

zfs get compressionratio tank
zfs create tank/databases

zfs set compression=lz4 tank/databases
zfs create tank/databases -o compression=lz4

Snapshots:
zfs snapshot tank/databases@friday (start a snapshot)

apt-get install zfs-auto-snapshot (create snapshots on time intervals)
zfs set com.zun:auto-snapshot=true tank/databases
zfs set snapdir=visible tank/databases
Why create multiple file systems/datasets?
zpool scrub tank (check for errors)
zpool scrub cancel (kill scrubbing)
zpool iostat -v 1

zpool replace -f tank <disk1> <disk2> (old drive – new drive)
zpool status (will show the status of resilving)
Z 3,5,9,17,33
Z2 4,6,10,18,34
Z3 5,7,11,19,35

 

zpool status
zpool list
zpool iostat -v 1
zfs get compressionratio tank/databases
zdb (lists what zfs internal cache looks like)
zfs get all tank/databases (show all the paramters for a filesystem)
zfs list -t snapshot (show snapshots)

zfsonlinux.org
open-zfs.org/wiki/Main_Page

zfs set quota=10G tank/home/jeff
zfs get quota takn/home/jeff
zfs list -r tank/home

zpool create -f -o ashift=12 tank1 raidz2 \
pci-0000:0c:00.0-fc-0x520092b44d01bd04-lun-0 \
pci-0000:0c:00.0-fc-0x520092b4563e6e07-lun-0 \
pci-0000:0c:00.0-fc-0x520092b43a90080d-lun-0 \
pci-0000:0c:00.0-fc-0x520092b43a8c0a07-lun-0 \
pci-0000:0c:00.0-fc-0x520092b44d01bd10-lun-0 \
pci-0000:0c:00.0-fc-0x520092b43bd7ef01-lun-0 \
pci-0000:0c:00.0-fc-0x520092b49d716800-lun-0 \
pci-0000:0c:00.0-fc-0x520092b43a8c0a05-lun-0 \
pci-0000:0c:00.0-fc-0x520092b4353f2600-lun-0 \
pci-0000:0c:00.0-fc-0x520092b43a8c0a09-lun-0 \
pci-0000:0c:00.0-fc-0x520092b44d01bd06-lun-0 \
pci-0000:0c:00.0-fc-0x520092b44d01bd07-lun-0 \
pci-0000:0c:00.0-fc-0x520092b44d01bd0a-lun-0 \
pci-0000:0c:00.0-fc-0x520092b43a8c0a03-lun-0 \
pci-0000:0c:00.0-fc-0x520092b44d01bd1b-lun-0

zfs create tank/databases -o compression=lz4

–> replace disk with larger disk
zpool set autoexpand=on tank1
** pull a disk
** check logs for the drive that was removed
zpool detach tank old_1tb_drive
** insert new disk
zpoool replace -f old_1tb_drive new_2tb_drive

 

Mount on Boot:

You need to edit the file /etc/default/zfs with your favourite editor, eg: nano, vim or something else, and change the lines

ZFS_MOUNT='no'
ZFS_UNMOUNT='no'

to

ZFS_MOUNT='yes'
ZFS_UNMOUNT='yes'

Automation tasks:

Reference here

iQstor J2880 FC Switched JBOD (SBOD) System (decom)

Tech Spec:
http://www.iqstor.com/products/j2880/technical-specification

User Manual

Creating a raid6 via lvm2:

pvcreate /dev/sd[abscdefghijklmno]
vgcreate iqstor01 /dev/sd[abscdefghijklmno]
lvcreate –type raid6 -l 80%VG -i 13 -n lvm_iqstor01 iqstor01

this created a 10tb lvm, not a 13 tb as I expected.

 

Install Webmin:

apt-get -y install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl apt-show-versions libapt-pkg-perl

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.680_all.deb

apt-get -y install ./webmin_1.680_all.deb