Error: “Can’t create or write into directory” on ownCloud

Error: “Can't create or write into directory” on ownCloud

If you want save data client to external hard drive:

# mounting drive to
mount /dev/sdc1 /cloud-data
chown www-data:www-data /cloud-data
chmod 0770 /cloud-data

# change data directory on owncloud
nano /var/www/owncloud/config/config.php
[…]
‘datadirectory’ => ‘/cloud-data’, => change it, example: /cloud-data
[…]

# change data directory owncloud on apache
nano /etc/apache2/conf.d/owncloud.conf
[…]
<Directory /cloud-data/>
AllowOverride All
</Directory>
[…]

# move data directory from old
rsync -avh /var/www/owncloud/data/ /cloud-data

How to Install ownCloud Server On Debian 7

How to Install ownCloud Server On Debian 7# install package rsync
apt-get install rsync

# download owncloud “ownCloud Server v7.0.5 (stable-fix) Release_March 11th 2015”
cd /var/www/
wget https://download.owncloud.org/community/owncloud-7.0.5.tar.bz2
tar -zxvpf owncloud-7.0.5.tar.bz2

# owncloud directory
chown “owncloud” directory and subdirectories change to “root:root”
chmod “owncloud” directory and subdirectories change to “0755”
chmod “all-files” change to “0644”

# apps directory
chmown “apps” directory only to “www-data:www-data”

# config directory
chown “config” directory and files change to “www-data:www-data”
chmod “config” directory change to “0755”
chmod “all-files” change  to “0644”

# data directory
mkdir /var/www/owncloud/data
chown “data” directory only to “www-data:www-data”
chmod “data” directory only to “0770”

# change owncloud on Apache
touch /etc/apache2/conf.d/owncloud.conf
nano /etc/apache2/conf.d/owncloud.conf
[…]
Alias /owncloud /var/www/owncloud

<Directory /var/www/owncloud/>
Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>

<Directory /var/www/owncloud/data/>
AllowOverride All
</Directory>
[…]

# next you must install owncloud by wizard on browser

How to Setup Local APT Repository With Debian

How to Setup Local APT Repository With Debian

# Update the System
apt-get install build-essential
apt-get update
apt-get upgrade

# Install Web Server
apt-get install apache2

# Create Repository Directory
mkdir /var/www/packages

*Now you can create a architecture (32-bit or 64-bit) directory under /var/www/packages/.
You can define your own names.
mkdir /var/www/packages/i386

# Copy DEB files from DVD
mount /dev/scd0 /media/cdrom
find /media/cdrom/pool/ -name “*.deb” -exec cp {} /var/www/packages/i386 \;

# After copying all deb files, unmount the first DVD
umount /media/cdrom

# Create Catalog file
cd /var/www/packages/
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

# Configure Server
After creating the catalog file, go to your server(local) system
nano /etc/apt/sources.list

# Add the APT repository location as shown below.
deb file:/var/www/packages/i386/ /
or
deb http://<ip-hosts/package/i386/ /

# Now update source list with following command:
apt-get update

Review Logs Regularly on Linux Machine

Move logs in dedicated log server, this may prevents intruders to easily modify local logs.
Below are the Common Linux default log files name and their usage:

/var/log/message – Where whole system logs or current activity logs are available.
/var/log/auth.log – Authentication logs.
/var/log/kern.log – Kernel logs.
/var/log/cron.log – Crond logs (cron job).
/var/log/maillog – Mail server logs.
/var/log/boot.log – System boot log.
/var/log/mysqld.log – MySQL database server log file.
/var/log/secure – Authentication log.
/var/log/utmp or /var/log/wtmp : Login records file.
/var/log/yum.log: Yum log files.

How to rename interface eth1 to eth0

please edit 70-persistent-net.rules on “/etc/udev/rules.d/70-persistent-net.rules”

nano /etc/udev/rules.d/70-persistent-net.rules

[. . . ]

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x1503 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx.xx.xx.xx.xx.x1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:0x1503 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx.xx.xx.xx.xx.x2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x1186:0x4300 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx.xx.xx.xx.xx.x", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
[...]

*change from "NAME="eth1" to NAME="eth0"
[...]
# PCI device 0x8086:0x1503 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx.xx.xx.xx.xx.x1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x1503 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx.xx.xx.xx.xx.x2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x1186:0x4300 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx.xx.xx.xx.xx.x", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
[...]
now press "ctrl+x" and press "y" to save
reboot youre machine

How to Enable STARTTLS-Auth Method Roundcube on Postfix

# Configure on Postfix
# TLS parameters: nano /etc/postfix/main.cf
[ . . . ]
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination
smtpd_tls_security_level = may
smtp_tls_security_level = may
smtp_tls_loglevel = 1
smtpd_tls_loglevel = 1
[ . . . ] Continue reading