I have been messing around with ispcp omega (i have vhcs2 server) on a VM and have come up with a script to config the server
This script requires a few downloads and edited files
I have included fixes for the trunk.
- Fedora dosent support start-stop-daemon so the ispcp_daemon and ispcp_network from the RC2 needs to be used
- The /etc/ispcp/bind/parts/cfg_entry.tpl for fedora is wrong
- The named.conf gets renames and recreated
- There are also a few mis-configured vars in the ispcp.conf which i have listed
- Missing Packages in proftpd-mysql and Term-ReadPassword
- Courier dosent install from yum
Code:
#!/bin/bash
echo \************************************
echo \* Fedora Core 7 ISP Control Config \*
echo \* ISPCP OMEGA 1.0.0 Trunk \*
echo \* Version: 1.0 RC 9 \*
echo \************************************
echo
echo Creating Folders and copying files
######################################
mkdir /tmp/core
cp -R ./* /tmp/core
cd /tmp/core
######################################
echo Installing Courier
######################################
./courier-install
######################################
echo Extracting and configuring ISPCP
######################################
cd /tmp/core
tar -xf ispcp-omega-1.0.0-trunk.tar
cd ispcp-omega-1.0.0-trunk
yum -y install `cat ./docs/Fedora/fedora-packages`
yum -y install chkrootkit proftpd-mysql cpan2rpm system-config-bind
cpan2rpm -i http://search.cpan.org/CPAN/authors/id/P/PH/PHOENIX/Term-ReadPassword-0.07.tar.gz
rpm -i /tmp/core/perl-Net-LibIDN-0.09-3.fc7.i386.rpm
make -f Makefile.fedora install
cp -RLf /tmp/ispcp-1.0.0/* /
######################################
clear
echo DO General Fixes.....
######################################
## Bind setup
mv /var/named/data /var/named/data2
ln -s /var/named/chroot/var/named/data /var/named/data
mkdir /var/www/scoreboards
touch /etc/sasldb2
echo 'include vhosts/*.conf' >> /etc/httpd/conf/httpd.conf
mkdir -p /var/spool/postfix/etc
cp /etc/sasldb2 /var/spool/postfix/etc/sasldb2
chown apache:apache /var/www/ispcp/gui/tools/webmail/data
echo DO Trunk fixes ........
######################################
# NAMED conf
mv /etc/ispcp/bind/named.conf /etc/ispcp/bind/named.conf.old
# create named.conf
echo '' >> /etc/ispcp/bind/named.conf
echo '// bind Data BEGIN.' >> /etc/ispcp/bind/named.conf
echo '' >> /etc/ispcp/bind/named.conf
echo '// dmn [{DMN_NAME}] cfg entry BEGIN.' >> /etc/ispcp/bind/named.conf
echo '// dmn [{DMN_NAME}] cfg entry END.' >> /etc/ispcp/bind/named.conf
echo '' >> /etc/ispcp/bind/named.conf
echo '// bind Data END.' >> /etc/ispcp/bind/named.conf
echo '' >> /etc/ispcp/bind/named.conf
chmod 655 /etc/ispcp/bind/named.conf
cp -f /etc/ispcp/bind/named.conf /var/named/chroot/etc/named-ispcp.conf
echo 'include "/etc/named-ispcp.conf";' >> /var/named/chroot/etc/named.conf
cp -f /tmp/core/ispcp_daemon /etc/init.d/ispcp_daemon
cp -f /tmp/core/ispcp_network /etc/init.d/ispcp_network
cp -f /etc/init.d/courier-authlib /etc/init.d/courier-authdaemon
cp -f /tmp/core/cfg_entry.tpl /etc/ispcp/bind/parts/cfg_entry.tpl
######################################
echo Starting mysql daemon
######################################
service mysqld restart
######################################
clear
######################################
echo \*********************
echo Edit the Config file
echo
echo Please look at
echo
echo
echo AWSTATS_DIR = no
echo SECONDARY_DNS =
echo TOUCH = /bin/touch
echo APACHE_CMD = /usr/sbin/apachectl
echo
echo
read -n 1 -p 'Press any key to continue ......'
vi /etc/ispcp/ispcp.conf
######################################
clear
######################################
echo \********************
echo Prep work done!
echo now run:
echo perl /var/www/ispcp/engine/setup/ispcp-setup
######################################
courier-install
Code:
echo Courier Installer
echo Version: BETA1
yum -y install expect libtool-ltdl
cp -f ./courier*.rpm /usr/local/
cd /usr/local/
rpm -i courier-authlib-0.59.3-1.fc7.mf.i386.rpm
rpm -i courier-authlib-userdb-0.59.3-1.fc7.mf.i386.rpm
rpm -i courier-imap-4.1.3-1.fc7.mf.i386.rpm
# Create group and user with 3000 UID so VHCS2 doesnt cause conflicts User
groupadd courier -g 3000
useradd -u 3000 -c 'Courier Mail Server' -d /dev/null -g courier -s /bin/false courier
cfg_entry.tpl
Code:
zone "{DMN_NAME}" {
type master;
file "/var/named/data/{DMN_NAME}.db";
notify YES;
};
these are my first attempts at scripting in linux so if i have missed something or total botched let me know
Anyways do with it what you will