Monday, 26 October 2009.
For the below tutorial MyDNS server resides at 192.168.0.101 and slave at 192.168.0.102
Master 192.168.0.101
Setup MyDNS master server – here
1. Configure mysql database on master server
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
log-bin = mysql-bin
binlog-do-db=mydns
server-id=1
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
2. Restart MySQL
2
| /etc/init.d/mysqld restart |
(more…)
Monday, 26 October 2009.
1. Install apache, mysql server, php
1
| yum install httpd mysql-server php php-mysql php-mbstring |
2. Enable mysql to start at boot, and start mysql server
2
3
| /sbin/chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start |
3. Set mysql password
4
| mysqladmin -u root password yourrootsqlpassword |
4.Enable apache to start at boot, start apache server
5
6
| /sbin/chkconfig --levels 235 httpd on
/etc/init.d/httpd start |
(more…)
Monday, 26 October 2009.
Overview
Zimbra resides in the /opt/zimbra directory, this directory can be migrated between servers as long as the architecture is the same (32bit vs 64bit)
Required Ports
Remote Queue Manager 22
Postifix 25
HTTP 80
POP3 110
IMAP 143
LDAP 389
HTTPS 443
Mailbox IMAP 993
Mailbox POP SSL 995
Mailbox LMTP 7025
Installation
./install.sh installs the zimbra
./install.sh -u uninstalls zimbra
./install.sh -s reinstalls the configuration files but does not touch the data
configuration file /opt/zimbra/config.xxxxx contains all passwords and needs to be backed up for disaster recovery and /opt/zimbra/conf/ localconfig.xml
(more…)
Sunday, 25 October 2009.
This tutorial assumes apache running on IP 192.168.0.100 and configured according to this
2. Create required directories. /home/webdav will be used to serve files, /var/log/httpd/webdav/ will be used to keep logs and DAVLock file.
1
2
| mkdir /home/webdav
mkdir -p /var/log/httpd/webdav/ |
3. Assign correct privileges
3
4
| chown -R apache:apache /home/webdav/
chown -R apache:apache /var/log/httpd/webdav/ |
4. Create a user who will be able to access webdav share and configure access file
5
6
7
8
9
| touch /etc/httpd/conf/user.passwd
htpasswd -n tuxoz
New password:
Re-type new password:
tuxoz:xrzE.fFDhtmwDz |
5.Copy the username:password and paste it in the access file
10
| vi /etc/httpd/conf/user.passwd |
(more…)
Sunday, 25 October 2009.
1. Update your server and install gcc
1
2
| yum -y update
yum -y install gcc |
2. Install and make zlib
3
4
5
6
7
8
9
10
| cd /usr/src
mkdir -p /opt/zlib
mkdir zlib1.23
cd zlib1.23/
wget http://www.zlib.net/zlib123.zip
unzip zlib123.zip
make
make install prefix=/opt/zlib/ |
3. Install and make openssl
11
12
13
14
15
16
17
18
19
20
| cd /usr/src
mkdir -p /opt/openssl
mkdir ssl.9.8
cd ssl.9.8/
wget http://www.openssl.org/source/openssl-0.9.8g.tar.gz
tar xvzf openssl-0.9.8g.tar.gz
cd openssl-0.9.8g
./config --prefix=/opt/openssl --openssldir=/opt/openssl
make
make install |
(more…)
Sunday, 25 October 2009.
This tutorial shows a basic configuration of iptables. The script can be modified further to any needs.
1. Create a script
cd /home/username
vi myfirewall.sh
#!/bin/bash
#
# iptables example configuration script
#
# Flush all current rules from iptables
#
/sbin/iptables -F
#
# Set default policies for INPUT, FORWARD and OUTPUT chains
#
/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables -P OUTPUT ACCEPT
#
# Set access for localhost
#
/sbin/iptables -A INPUT -i lo -j ACCEPT
#
# Accept packets belonging to established and related connections
#
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#
# Save settings
#
/sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
/sbin/iptables -A INPUT -p udp --dport 53 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 22 -j ACCEPT
/sbin/service iptables save
#
# List rules
#
/sbin/iptables -L -v
(more…)
Sunday, 25 October 2009.
This tutorial assumes a fresh minimal install of CentOS5 on a server installed at 192.168.0.100
Part 1. Preparing and Securing CentOS
1. Add user
1
2
3
4
5
| /usr/sbin/adduser tuxoz
passwd tuxoz
Changing password for user tuxoz.
New UNIX password:
Retype new UNIX password: |
2. Add sudo privileges; add following line at the bottom
3. Disable root ssh login and change the default ssh port
7
| vi /etc/ssh/sshd_config |
Port 2233
PermitRootLogin no
4. Restart ssh, log out and log back in as a tuxoz user using your new port
8
9
10
| /etc/init.d/sshd restart
exit
$ ssh -p2233 tuxoz@192.168.0.100 |
5. Test sudo
6.Update CentOS
(more…)