LoadModule ssl_module modules/mod_ssl.so
LoadModule rewrite_module modules/mod_rewrite.so
--
start httpd
via CPAN insaql the following per file
perl-MCPN -e shell
install Compress::Zlib
install Archive::Zip
File::RsyncP
Install the following packages
yum install perl-suidperl
Now we add a user for the backupPC with its group being apache useradd -g apache backuppc
Now we download the backupPC source file
cd /usr/local/src wget http://nchc.dl.sourceforge.net/sourceforge/backuppc/BackupPC-3.1.0.tar.gz
now we will copy the init scritp to the right location
(A) Now backing up frm Linux clinet to linux BackupPC
Passwordless login frm linux clinet and from Linux BackupPC server
now on the Linux BackupPC server ( su - backuppc ) try to login in ( ssh root@linuxclinet ) , it should log you in without a password You can append as many public keys
htpasswd -c /etc/BackupPC/htpasswd client1 ( unix system user ) ---------> enter the password as prompted
now we will add our clinet to the host file located in /etc/BackupPC/hosts
# host dhcp user moreUsers # <--- do not edit this line #farside 0 craig jill,jeff # <--- example static IP host entry #larson 1 bill # <--- example DHCP host entry 192.168.0.244 0 linuxclient1 # <--- where only linuxclinet1 user can acces this system back up frm webinterfce 192.168.0.209 0 backuppc # <--- where only backuppc user can acces this system back up frm webinterfce
we will create/edit a congif file in /etc/BackupPC/pc/linuxclientPCIP.pl
$Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+'; $Conf{RsyncClientCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+'; $Conf{XferMethod} = 'rsync'; $Conf{RsyncShareName} = ['/home','/var/log']; now we will edit he httpd.conf so that only the prticulat user assigned to the particular clinet gets access to the cgi script
<Directory "/var/www/cgi-bin"> # AllowOverride None # Options None # Order allow,deny # Allow from all Options ExecCGI FollowSymlinks AddHandler cgi-script .cgi DirectoryIndex index.cgi AuthGroupFile /etc/backuppc/htgroup AuthUserFile /etc/backuppc/htpasswd AuthType basic AuthName "backuppc" require valid-user
</Directory>
now we restart httpd and backuppc
/etc/init.d/httd restart /etc/init.d/backuppc restart
add the user name and password .... this should gvive u access to the particular clinet
(B) Now backing up frm Windows clinet to linux BackupPC
#this is frm where all your data will be backed up.
[cDrive0] path = c:/rsyncd comment = agnello's documents auth users = agnello secrets file = c:/rsyncd/rsyncd.secrets # hosts allow = 172.16.0.17 strict modes = false read only = false list = false
[cDrive1] path = c:/var comment = agnello's documents auth users = agnello secrets file = c:/rsyncd/rsyncd.secrets # hosts allow = 172.16.0.17 strict modes = false read only = false list = false
[cDrive2] path = c:/Documents and Settings/All Users/Documents/My Music comment = agnello's documents auth users = agnello secrets file = c:/rsyncd/rsyncd.secrets # hosts allow = 172.16.0.17 strict modes = false read only = false list = false
Now save the file and run the service.bat file make sure that your windows PC has not blocked 873
Now edit the rsync.secret add the following lines
agnello:agnello123
now on the Linux BackuPC server we create a config file for the windows client
eg : vi /etc/BackupPC/pc/windowsclentip.pl $Conf{XferMethod} = 'rsyncd'; $Conf{RsyncdUserName} = 'agnello'; $Conf{RsyncdPasswd} = 'agnello123'; $Conf{RsyncShareName} = ['cDrive0','cDrive1','cDrive2']; $Conf{ClientCharset} = 'cp1252'
maker sure that the user and password is tha same as rsync.secret file
now we will add our windows clinet to the host file located in /etc/BackupPC/hosts on the lINUX bACKUPpc SERVER
# host dhcp user moreUsers # <--- do not edit this line #farside 0 craig jill,jeff # <--- example static IP host entry #larson 1 bill # <--- example DHCP host entry 192.168.0.244 0 linuxclient1 # <--- where only linuxclinet1 user can acces this system back up frm webinterfce 192.168.0.209 0 winclient1 # <--- where only backuppc user can acces this system back up frm webinterfce
now we restart backuppc
/etc/init.d/backuppc restart
now try browser in the the http://linuxBackupPCserverIP/cgi-bin/backupc
add the user name and password .... this should gvive u access to the particular clinet ( ref /etc/BackupPC/hosts file )
mysql virtual users with unix users
Now in case we need to store the password of the user in the mysql database then we need to add the following steps
step 1: we copy the pureftpd-mysql.conf from /usr/local/src/pureftpd-msql.conf ====> to /usr/local/pureftpd/etc/.
the pureftpd-mysql.conf has the following details:
#MYSQLServer localhost
#MYSQLPort 3306
MYSQLSocket /tmp/mysql.sock
MYSQLUser root
MYSQLPassword agnello
MYSQLDatabase pureftpd
MYSQLCrypt MD5
MYSQLGetPW SELECT Password FROM ftpd WHERE User="\L"
MYSQLGetUID SELECT Uid FROM ftpd WHERE User="\L"
MYSQLGetGID SELECT Gid FROM ftpd WHERE User="\L"
MYSQLGetDir SELECT Dir FROM ftpd WHERE User="\L"
step 2 : we create a data base in mysql ( pureftpd )
mysql -u root -password
create database pureftpd;
use pureftpd;
CREATE TABLE ftpd (
User VARCHAR(16) BINARY NOT NULL,
Password VARCHAR(64) BINARY NOT NULL,
Uid VARCHAR(11) NOT NULL default '-1',
Gid VARCHAR(11) NOT NULL default '-1',
Dir VARCHAR(128) BINARY NOT NULL,
PRIMARY KEY (User)
);
quit;
step 3: we create a directory where all our domains will be stored say /etc/website
the permission i wll be as follows ( these are just the basic )
[root@linux-test pure-ftpd-1.0.21]# ll /home/
drwxr-xr-x 5 root root 4096 May 20 17:30 website
step 4 : now suppose we have to creat a user for a domain called silly .com
1. lets create a unix user
useradd -d /home/website/silly.com -s /sbin/nologin silly
2. then we add the virtual user ( with password ) in the the mysql database ( usning phpmyadmin )
user: silly
password ( MD5 ): silly123
uid : silly
gid : sil ly
dir: /home/website/silly.com
step 5: now we start the ftpd daemon
/usr/local/pureftpd/sbin/pure-ftpd -lmysql:/usr/local/pureftpd/etc/pureftpd-mysql.conf -l unix -j /home/websites &
can view the log with tail -f /var/log/messages
now try to log in ftp://192.168.0.244 with username and password
--
cd /var/spool/postfix/
sudo mkdir etc
now, take a look at /etc/localtime:
ls -la /etc/localtime
lrwxr-xr-x 1 root wheel 36 6 Aug 20:05 /etc/localtime ->
/usr/share/zoneinfo/America/New_York
copy /usr/share/zoneinfo/country/state to /var/spool/postfix/etc/
sudo cp -p /usr/share/zoneinfo/America/New_York \
/var/spool/postfix/etc/localtime
postfix check
postfix reload
Now take a look at your mail.log and see if all the times line up.
--
you should have webmin already installed
Virtualmin can be downloaded in Webmin module format from:
http://download.webmin.com/download/virtualmin/virtual-server-3.55.gpl.wbm.gz
(764 kB)
The new Virtualmin framed theme in Webmin module format can be downloaded from:
http://download.webmin.com/download/virtualmin/virtual-server-theme-5.5.wbt.gz
(2.2 MB)
You can install it by going to the Webmin Configuration module,
clicking on Webmin Modules and use the first form on the page to
install the downloaded .wbm.gz file. Or install it directly from the
above URL. After installation the module will show up in the Servers
category.
To install the theme,
go to the Webmin Configuration module,
click on Webmin Themes and install the downloaded .wbt.gz file.
Once this is done, you should use the Webmin Themes page to make the
new theme the default, if your system is to be primarily used for
virtual hosting.
The same theme file can be used with Usermin too, to provide a similar
user interface style and a better framed interface for reading email.
To install it, go the Usermin Configuration module, click on Usermin
Themes and install from the .wbt.gz file.
yum install postfix ( make sure you have sasl enabled )
postfix configureation details !!
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = eshanews.com
mydomain = eshanews.com
myhostname = mail.eshanews.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
recipient_delimiter = +
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks
permit_sasl_authenticated reject_unauth_destination
reject_unauth_pipelining reject_invalid_hostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual
canonical_maps = hash:/etc/postfix/canonical
sender_canonical_maps = hash:/etc/postfix/canonical
recipient_canonical_maps = hash:/etc/postfix/canonical
make sure that the u creat db file for
virtual_alias_maps = hash:/etc/postfix/virtual
canonical_maps = hash:/etc/postfix/canonical
sender_canonical_maps = hash:/etc/postfix/canonical
recipient_canonical_maps = hash:/etc/postfix/canonical
then is install squirrel mail !!
making psot fix scan incoming mails for spam
yum install spamassassin
groupadd -g 5001 spamd
#useradd -u 5001 -g spamd -s /sbin/nologin -d /var/lib/spamassassin spamd
#mkdir /var/lib/spamassassin
#chown spamd:spamd /var/lib/spamassassin
local.cf sample
rewrite_header Subject [***** SPAM _SCORE_ *****]
required_score 2.0
#to be able to use _SCORE_ we need report_safe set to 0
#If this option is set to 0, incoming spam is only modified by adding
some "X-Spam-" headers and no changes will be made to the body.
report_safe 0
# Enable the Bayes system
use_bayes 1
use_bayes_rules 1
# Enable Bayes auto-learning
bayes_auto_learn 1
# Enable or disable network checks
skip_rbl_checks 0
use_razor2 0
use_dcc 0
use_pyzor 0
restart spamassassin
Now, we need to tell postfix to use spamassassin. In our case,
spamassassin will be invoked only once postfix has finished with the
email.
To tell postfix to use spamassassin, we are going to edit
/etc/postfix/master.cf and change the line:
smtp inet n - - - - smtpd
-o content_filter=spamassassin
and then, at the end of master.cf, let's add:
pamassassin unix - n n - - pipe
user=spamd argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
we restart postfix
/etc/init.d/postfix reload
thats it !!!!!!
--
make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL
-I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL
-I/usr/include/sasl -DUSE_TLS -I/usr/include/openssl'
'AUXLIBS=-L/usr/local/mysql/lib/mysql -lssl -lmysqlclient -lz -lm
-lsasl2 -lcrypto'
make
make install
netstat -tap
to start postfix
postfix start
OR
vi /etc/rc.d/init/postfix
#!/bin/bash
#
# postfix This script controls the postfix daemon.
#
# description: Postfix MTA
# processname: postfix
case "$1" in
start)
/usr/sbin/postfix start
;;
stop)
/usr/sbin/postfix stop
;;
reload)
/usr/sbin/postfix reload
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|reload|restart}"
exit 1
esac
exit 0
--
# rpm -e yum-rhn-plugin
2. Remove the "redhat-release" related packages, this is used to check
the repositories compatibility. usually we can't remove these packages
because they are used by other packages of the system for proper
fuctioning. so we'll use the "--nodeps" parameter to forcely remove
them from the system.
# rpm -e redhat-release-notes-5Server redhat-release-5Server --nodeps
3. Download & install the "centos-release" relates packages, to fill
in the gap that we made by removing the "redhat-release" related
packages.
i386 (32 bit)
http://mirror.centos.org/centos-5/5/os/i386/CentOS/centos-release-5-1.0.el5.centos.1.i386.rpm
http://mirror.centos.org/centos-5/5/os/i386/CentOS/centos-release-notes-5.1.0-2.i386.rpm
x86_64 (64 bit)
http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/centos-release-5-1.0.el5.centos.1.x86_64.rpm
http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/centos-release-notes-5.1.0-2.x86_64.rpm
4. To automatically inform about the updates in GUI, Do the following.
# nano /etc/yum/yum-updatesd.conf
In the file, type as follows under the section "# how to send notifications"
dbus_listener = yes
5. To change the OS name in the CLI login, Do the following.
# nano /etc/issue
Since we have installed the "centos-release" relates packages, the OS
name will come as "CentOS release 5 (Final)", so delete it and type
Red Hat Enterprise Linux Server release 5 (Tikanga)
Or any name you like.
6. Now your system is ready.
7. Read my guide on "CentOS Repositories"
--