Go back to the HOWTO: CentOS 5 setup for LAMP and ISPconfig
Here you find the code of the three files you need to install your vps:
Cut and paste the code into the three files as stated and then upload them to your /root directory in your vps.
Contents |
This is the code of the bash script. You have to cut and paste it inside a file named centos5_vps4_install_v1.2.sh
Disclaimer: This script is probably not the best way to do this, only a *possible* way to do this. Please feel free to improve it.
#!/bin/bash
# These documents are provided "as is" in the hope that they will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# Installation script for VPSlink's vps4 CentOS 5 LAMP setup (IPSConfig aware)
#
# MODIFY ONLY VALUES BELOW THIS LINE +++++++++++++++++++++++++++++++++++++
# PLEASE, FOR SECURITY REASONS DO MODIFY THESE VALUES WITH YOUR OWN ONE
ZONEINFO=UTC # don't use leading slash, path is case sensitive
#ZONEINFO=Europe/Rome # other example
CHROOTED_BIND_INSTALL=y
MYSQL_PWD='my_mysql_password' # fill in with your root MySQL password
ISP_CONFIG=y
I_LIKE_BELL=y # to play bell when manual input needed
# PARAMS for Certificates
SMTPD_COUNTRY_ISO='IT'
SMTPD_COUNTRY='ITALY'
SMTPD_CITY='Rome'
SMTPD_COMPANY='ACME'
SMTPD_DEPARTMENT='Roadrunner Services'
SMTPD_HOSTNAME='server1.mydomain.com'
SMTPD_EMAIL='admin@mydomain.com'
SMTPD_PASSWD='put_your_password_here'
CACERT_COUNTRY_ISO='IT'
CACERT_COUNTRY='ITALY'
CACERT_CITY='Rome'
CACERT_COMPANY='ACME'
CACERT_DEPARTMENT='Certification Authority'
CACERT_HOSTNAME='server1.mydomain.com'
CACERT_EMAIL='admin@mydomain.com'
CACERT_PASSWD='put_your_password_here'
# MODIFY ONLY VALUES ABOVE THIS LINE -------------------------------------
#
###############################################################
# other script variables
SCRIPT_VERSION='1.2'
SCRIPT_DATE='17/06/2007'
SCRIPT_AUTHOR='borgo'
COPYRIGHT="Borgo :SC: fecit, die XVII iunio MMDCCLIV ab Urbe condita"
DISCLAIMER='# This software is provided "as is" in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.'
BEL_PARAM='-e \a '
NO_NEWLINE_PARAM='-n '
KEYPRESS_PARAM='-s -n1 -p' # Read a keypress without hitting ENTER.
# -s means do not echo input.
# -n means accept only N characters of input.
# -p means echo the following prompt before reading input
BELLCMD="echo $NO_NEWLINE_PARAM $BEL_PARAM"
ASKCMD="read $KEYPRESS_PARAM "
###############################################################
# FUNCTIONS
ASK () {
keystroke=''
while [[ "$keystroke" != [yYnN] ]]
do
# echo " "
if [[ "$I_LIKE_BELL" = [yY] ]];
then
$BELLCMD; $ASKCMD "$1" keystroke
else
$ASKCMD "$1" keystroke
fi
echo "$keystroke";
done
key=$(echo $keystroke)
}
# from Advanced Bash Script Guide
black='\E[30;40m'
red='\E[31;40m'
green='\E[32;40m'
yellow='\E[33;40m'
blue='\E[34;40m'
magenta='\E[35;40m'
cyan='\E[36;40m'
white='\E[37;40m'
boldblack='\E[1;30;40m'
boldred='\E[1;31;40m'
boldgreen='\E[1;32;40m'
boldyellow='\E[1;33;40m'
boldblue='\E[1;34;40m'
boldmagenta='\E[1;35;40m'
boldcyan='\E[1;36;40m'
boldwhite='\E[1;37;40m'
Reset="tput sgr0" # Reset text attributes to normal
#+ without clearing screen.
cecho () # Color-echo.
# Argument $1 = message
# Argument $2 = color
{
message=$1
color=$2
echo -e "$color$message" ; $Reset
return
}
# END FUNCTIONS
################################################################
# SCRIPT START
#
clear
cecho "**********************************************************************" $boldyellow
cecho "* Installation script for VPSlink vps preloaded with CentOS 5 " $boldgreen
cecho "* version: $SCRIPT_VERSION - Date: $SCRIPT_DATE - Author: $SCRIPT_AUTHOR" $green
cecho "**********************************************************************" $boldyellow
echo " "
eval "cat > smtpd_csr_data.txt << \"EOF\"
$SMTPD_COUNTRY_ISO
$SMTPD_COUNTRY
$SMTPD_CITY
$SMTPD_COMPANY
$SMTPD_DEPARTMENT
$SMTPD_HOSTNAME
$SMTPD_EMAIL
.
.
EOF
"
eval "cat > cacert_csr_data.txt << \"EOF\"
$CACERT_COUNTRY_ISO
$CACERT_COUNTRY
$CACERT_CITY
$CACERT_COMPANY
$CACERT_DEPARTMENT
$CACERT_HOSTNAME
$CACERT_EMAIL
.
.
EOF
"
if [[ ! -e "centos5_vps_install.stage1" ]] ;
then
ASK "Did you already set VARIABLES located at the beginning of this script? [y/n]"
if [[ "$key" = [nN] ]];
then
echo "Then, edit this script and set variables to suit your needs"; exit 1
fi
echo "***************************************"
echo "* remind to check MySQL root password "
echo "***************************************"
ASK "Have you set your MySQL root password in the variable MYSQL_PWD at the top of this script? [y/n] "
if [[ "$key" = [nN] ]];
then
echo "[ERROR] Exiting installation: set your MySQL password NOW and restart this script"
exit 1
fi
echo "***************************************"
echo "* setting preferred localtime for VPS ..."
echo "***************************************"
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/$ZONEINFO /etc/localtime
echo "Current date & time for the zone you selected is:"
date
ASK "Is it correct? [y/n]"
if [[ "$key" = [nN] ]];
then
echo "Then, edit this script and set ZONEINFO variable"; exit 1
fi
cecho "Now the script will reboot the vps to let all process see new localtime" $boldyellow
ASK "Do you want to REBOOT your vps now? [y/n] "
if [[ "$key" = [yY] ]];
then
touch centos_vps4_install.stage1
echo " Vps is rebooting now. It will take 5 minutes ..."
reboot
exit 0
else
ASK "Do you want to continue the script without rebooting? [y/n] "
if [[ "$key" = [nN] ]];
then
exit 1
fi
fi
else
echo " ... continuing installation "
rm -f centos5_vps_install.stage1
fi
echo "*********************************"
echo " >>> SETTING YUM ENVIRONMENT <<<"
echo "*********************************"
echo "* Import packages keys ..."
rpm --import http://centos.mirror.vpslink.com/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
echo "* Backup yum config and repos ..."
mv /etc/yum.conf /etc/yum.conf.backup
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
echo "* Update yum config ..."
mv /root/yum.conf /etc/yum.conf
echo "*********************************"
echo " >>> YUM SETUP DONE <<<"
echo "*********************************"
echo "***************************************"
cecho " Removing sendmail" $boldgreen
chkconfig --levels 235 sendmail off
/etc/init.d/sendmail stop
yum -y remove sendmail
cecho " Sendamil removed" $boldgreen
echo "***************************************"
echo "***************************************"
cecho "* updating CentOS ..." $boldgreen
echo "***************************************"
yum -y update
yum -y install zip nmap fileutils ncftp gcc-c++
echo "***************************************"
cecho " Centos updated " $boldgreen
echo "***************************************"
if [[ "$CHROOTED_BIND_INSTALL" = [yY] ]];
then
echo "***************************************"
cecho "* installing chrooted Bind ..." $boldgreen
echo "***************************************"
yum -y install bind-chroot
chmod 755 /var/named/
chmod 775 /var/named/chroot/
chmod 775 /var/named/chroot/var/
chmod 775 /var/named/chroot/var/named/
chmod 775 /var/named/chroot/var/run/
chmod 777 /var/named/chroot/var/run/named/
cd /var/named/chroot/var/named/
ln -s ../../ chroot
cp /usr/share/doc/bind-9.3.3/sample/var/named/named.local /var/named/chroot/var/named/named.local
cp /usr/share/doc/bind-9.3.3/sample/var/named/named.root /var/named/chroot/var/named/named.root
touch /var/named/chroot/etc/named.conf
chkconfig --levels 235 named on
/etc/init.d/named restart
echo "***************************************"
cecho "* chrooted Bind installed" $boldgreen
echo "***************************************"
fi
cd
echo "***************************************"
cecho "* installing MySQL ..." $boldgreen
echo "***************************************"
yum -y install mysql mysql-devel mysql-server
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
echo " "
cecho "**********************************************************************" $boldyellow
netstat -tap | grep mysql
cecho "**********************************************************************" $boldyellow
ASK "Do you see a line stating something like 'tcp 0 0 *:mysql *:* LISTEN xxxx/mysqld' before this one: [y/n] ?"
if [[ "$key" = [nN] ]];
then
echo "[ERROR] Exiting installation: check MySQL installation"
exit 1
fi
echo "***************************************"
echo "* setting MySQL root password"
echo "***************************************"
mysqladmin -u root password $MYSQL_PWD
echo "***************************************"
cecho "* MySQL installed" $boldgreen
echo "***************************************"
echo "***************************************"
cecho "* installing mail stuff ..." $boldgreen
echo "***************************************"
yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5 cyrus-sasl-plain postfix dovecot
postconf -e 'smtpd_sasl_local_domain ='
postconf -e 'smtpd_sasl_auth_enable = yes'
postconf -e 'smtpd_sasl_security_options = noanonymous'
postconf -e 'broken_sasl_auth_clients = yes'
postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
postconf -e 'inet_interfaces = all'
postconf -e 'mynetworks = 127.0.0.0/8'
echo " "
echo " "
cecho "*************************************************" $boldyellow
cecho " MAIL SETUP -step 1" $boldyellow
cecho "Now you'll have to edit your smtpd.conf file and" $boldyellow
cecho "check that it looks like this, otherwise insert" $boldyellow
cecho "the line pointed by the arrow: " $boldyellow
echo " "
echo "pwcheck_method: saslauthd"
cecho "mech_list: plain login <<<------<<" $boldcyan
cecho "*************************************************" $boldyellow
cecho "press <Enter> when ready" $boldyellow
read
vi /usr/lib/sasl2/smtpd.conf
echo "***************************************"
echo "* generating mail server certificates ..."
echo "***************************************"
mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
openssl genrsa -passout pass:$SMTPD_PASSWD -des3 -rand /etc/hosts -out smtpd.key 1024
chmod 600 smtpd.key
openssl req -new -key smtpd.key -passin pass:$SMTPD_PASSWD -out smtpd.csr < /root/smtpd_csr_data.txt
openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -passin pass:$SMTPD_PASSWD -out smtpd.crt
openssl rsa -in smtpd.key -passin pass:$SMTPD_PASSWD -out smtpd.key.unencrypted
mv -f smtpd.key.unencrypted smtpd.key
openssl req -new -x509 -extensions v3_ca -passout pass:$CACERT_PASSWD -keyout cakey.pem -out cacert.pem -days 3650 < /root/cacert_csr_data.txt
chmod 600 smtpd.crt
postconf -e 'smtpd_tls_auth_only = no'
postconf -e 'smtp_use_tls = yes'
postconf -e 'smtpd_use_tls = yes'
postconf -e 'smtp_tls_note_starttls_offer = yes'
postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'
postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'
postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'
postconf -e 'smtpd_tls_loglevel = 1'
postconf -e 'smtpd_tls_received_header = yes'
postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
postconf -e 'tls_random_source = dev:/dev/urandom'
echo " "
echo "******************************************************"
ASK "Do you want to verify the Postfix config file? [y/n] "
if [[ "$key" = [yY] ]];
then
echo "Please, check what you will have to find in the step-by-step guide."
echo "Press <Enter> when ready"
read
vi /etc/postfix/main.cf
fi
cecho "*************************************************" $boldyellow
cecho " MAIL SETUP -step 2" $boldyellow
cecho "Now you'll have to edit your dovecot.conf file and" $boldyellow
cecho "modify the 'protocols' line to look like this one: " $boldyellow
echo " "
cecho "protocols = imap imaps pop3 pop3s " $boldcyan
echo " "
cecho "*************************************************" $boldyellow
cecho "press <Enter> when ready" $boldyellow
read
vi /etc/dovecot.conf
echo " "
echo "*************************************************"
echo "Now start Postfix, saslauthd, and dovecot: "
echo "*************************************************"
#chkconfig --levels 235 sendmail off
chkconfig --levels 235 postfix on
chkconfig --levels 235 saslauthd on
chkconfig --levels 235 dovecot on
#/etc/init.d/sendmail stop
/etc/init.d/postfix start
/etc/init.d/saslauthd start
/etc/init.d/dovecot start
echo " "
cecho "*************************************************" $boldyellow
cecho "* MAIL SETUP - check" $boldyellow
cecho "* Check if SMTP-AUTH and TLS work properly" $boldyellow
cecho "*************************************************" $boldyellow
echo " After you have established the connection to your Postfix mail server type"
echo " "
cecho "ehlo localhost " $boldcyan
echo " "
echo "If you see these lines"
echo " "
cecho " 250-STARTTLS" $boldcyan
cecho " 250-AUTH LOGIN PLAIN" $boldcyan
echo " "
echo " it means that everything is working fine,"
echo " so type 'quit' to continue installation."
echo " "
cecho "Press <Enter> when you are ready to start MAIL SETUP check" $boldyellow
read
echo " "
telnet localhost 25
if [[ "$ISP_CONFIG" = [nN] ]];
then
echo "**********************************************************"
echo " Configuring Postfix to deliver emails to a user's Maildir"
echo "**********************************************************"
postconf -e 'home_mailbox = Maildir/'
postconf -e 'mailbox_command ='
/etc/init.d/postfix restart
fi
echo " "
cecho " MAIL SETUP DONE" $boldgreen
echo "*************************************************"
echo "*************************************************"
cecho "* Installing Apache with PHP" $boldgreen
echo "*************************************************"
yum -y install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel
echo " "
echo "*********************************************************************"
cecho "Change the DirectoryIndex directive in the httpd.conf file with this" $boldyellow
cecho "one:" $boldyellow
echo " "
echo "DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl"
echo " "
cecho "press <Enter> when ready" $boldyellow
read
vi /etc/httpd/conf/httpd.conf
chkconfig --levels 235 httpd on
/etc/init.d/httpd start
if [[ "$ISP_CONFIG" = [yY] ]];
then
cecho "*********************************************************" $boldyellow
cecho " To disable PHP globally, edit /etc/httpd/conf.d/php.conf" $boldyellow
cecho " and comment out the AddType line:" $boldyellow
cecho "#AddHandler php5-script .php" $boldcyan
cecho "#AddType application/x-httpd-php .php" $boldcyan
cecho "# AddType application/x-httpd-php-source .phps" $boldcyan
cecho "*********************************************************" $boldyellow
cecho "press <Enter> when ready" $boldyellow
read
/sbin/MAKEDEV /dev/urandom
vi /etc/httpd/conf.d/php.conf
/etc/init.d/httpd restart
fi
echo "***************************************"
cecho "* Apache and PHP installed" $boldgreen
echo "***************************************"
echo " "
echo " "
echo "*************************************************"
cecho "* Removing vsftpd and installing ProFTPd" $boldgreen
echo "*************************************************"
yum -y remove vsftpd
cd /tmp/
wget --passive-ftp ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.0a.tar.gz
tar xvfz proftpd-1.3.0a.tar.gz
cd proftpd-1.3.0a/
yum -y install make
./configure --sysconfdir=/etc
make
make install
cd ..
rm -fr proftpd-1.3.0a*
ln -s /usr/local/sbin/proftpd /usr/sbin/proftpd
mv /root/proftpd /etc/init.d/proftpd
chmod 755 /etc/init.d/proftpd
echo "*************************************************"
echo " "
cecho " Modify the /etc/proftpd.conf so it contains these lines:" $boldyellow
cecho "Group nobody" $boldcyan
cecho "DefaultRoot ~" $boldcyan
cecho "IdentLookups off" $boldcyan
cecho 'ServerIdent on "FTP Server ready."' $boldvyan
echo " "
cecho "press <Enter> when ready" $boldyellow
read
vi /etc/proftpd.conf
chkconfig --levels 235 proftpd on
/etc/init.d/proftpd start
echo "*************************************************"
cecho "* Installing Webalizer" $boldgreen
echo "*************************************************"
yum -y install webalizer
echo "*************************************************"
cecho "* Installing Perl modules for SpamAssassin" $boldgreen
echo "*************************************************"
yum -y install perl-HTML-Parser perl-DBI perl-Net-DNS perl-Digest-SHA1
if [[ "$ISP_CONFIG" = [yY] ]];
then
echo "*************************************************"
cecho "* Installing flex and which for ISPconfig" $boldgreen
echo "*************************************************"
yum -y install flex
yum -y install which
echo " "
cecho "*********************************************************" $boldyellow
cecho " Remember to configure ISPconfig to manage e-mail in the " $boldyellow
cecho " maildir format. Do this from ISPconfig enabling Maildir" $boldyellow
cecho " under 'Management -> Server -> Settings -> Email'." $boldyellow
cecho "*********************************************************" $boldyellow
fi
echo " "
echo "*************************************************"
cecho " Re-enable ssh login..." $boldgreen
echo "*************************************************"
rm -f /dev/null
mknod /dev/null c 1 3
/sbin/MAKEDEV tty
/sbin/MAKEDEV pty
cecho "*************************************************" $boldyellow
cecho "Modify /etc/yum.conf to exclude udev updates or you can't login via ssh " $boldyellow
cecho "anymore" $boldyellow
echo " "
cecho "*********************************************************************" $boldgreen
cecho "* All is done!" $boldgreen
cecho "* " $boldgreen
cecho "* For security reasons this script will delete itself now" $boldgreen
cecho "* so you can't run it again for mistake!" $boldgreen
cecho "* " $boldgreen
cecho "* But first it will copy in a file named 'my_install_environment.txt' " $boldgreen
cecho "* all the VARIABLES, except those containing your passwords, " $boldgreen
cecho "* for future reference! " $boldgreen
cecho "* " $boldgreen
cecho "* Remember that when you don't need it anymore it would be more" $boldgreen
cecho "* secure if you uninstall the 'gcc', 'gcc-c++' and 'make' packages" $boldgreen
cecho "* " $boldgreen
cecho "* Enjoy your just installed vps - Borgo" $boldgreen
cecho "*********************************************************************" $boldgreen
cd
{
echo SCRIPT_VERSION=$SCRIPT_VERSION
echo SCRIPT_DATE=$SCRIPT_DATE
echo ZONEINFO=$ZONEINFO
echo CHROOTED_BIND_INSTALL=$CHROOTED_BIND_INSTALL
echo ISP_CONFIG=$ISP_CONFIG
echo SMTPD_COUNTRY_ISO=$SMTPD_COUNTRY_ISO
echo SMTPD_COUNTRY=$SMTPD_COUNTRY
echo SMTPD_CITY=$SMTPD_CITY
echo SMTPD_COMPANY=$SMTPD_COMPANY
echo SMTPD_DEPARTMENT=$SMTPD_DEPARTMENT
echo SMTPD_HOSTNAME=$SMTPD_HOSTNAME
echo SMTPD_EMAIL=$SMTPD_EMAIL
echo CACERT_COUNTRY_ISO=$CACERT_COUNTRY_ISO
echo CACERT_COUNTRY=$CACERT_COUNTRY
echo CACERT_CITY=$CACERT_CITY
echo CACERT_COMPANY=$CACERT_COMPANY
echo CACERT_DEPARTMENT=$CACERT_DEPARTMENT
echo CACERT_HOSTNAME=$CACERT_HOSTNAME
echo CACERT_EMAIL=$CACERT_EMAIL
} > my_install_environment.txt
rm -f smtpd_csr_data.txt
rm -f cacert_csr_data.txt
rm -f $0
exit 0
This is the code of the yum config file. You have to cut and paste it inside a file named yum.conf
[main] cachedir=/var/cache/yum keepcache=1 debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 metadata_expire=1800 exclude=kernel* udev* glibc* MAKEDEV* mkinitrd module-init-tools #exclude also udev and gcc* ?? # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d [base] name=VPSLink CentOS-$releasever - Base baseurl=http://centos.mirror.vpslink.com/centos/$releasever/os/$basearch/ enabled=1 gpgcheck=1 [update] name=VPSLink CentOS-$releasever - Updates baseurl=http://centos.mirror.vpslink.com/centos/$releasever/updates/$basearch/ gpgcheck=1 enabled=1 [addons] name=VPSLink CentOS-$releasever - Addons baseurl=http://centos.mirror.vpslink.com/centos/$releasever/addons/$basearch/ gpgcheck=1 enabled=1 [extras] name=VPSLink CentOS-$releasever - Extras baseurl=http://centos.mirror.vpslink.com/centos/$releasever/extras/$basearch/ gpgcheck=1 enabled=1 [centosplus] name=VPSLink CentOS-$releasever - Plus baseurl=http://centos.mirror.vpslink.com/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 [contrib] name=VPSLink CentOS-$releasever - Contrib baseurl=http://centos.mirror.vpslink.com/centos/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0
This is the code of the proftpd inist script file. You have to cut and paste it inside a file named proftpd
#!/bin/sh
# $Id: proftpd.init,v 1.1 2004/02/26 17:54:30 thias Exp $
#
# proftpd This shell script takes care of starting and stopping
# proftpd.
#
# chkconfig: - 80 30
# description: ProFTPD is an enhanced FTP server with a focus towards \
# simplicity, security, and ease of configuration. \
# It features a very Apache-like configuration syntax, \
# and a highly customizable server infrastructure, \
# including support for multiple 'virtual' FTP servers, \
# anonymous FTP, and permission-based directory visibility.
# processname: proftpd
# config: /etc/proftp.conf
# pidfile: /var/run/proftpd.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x /usr/sbin/proftpd ] || exit 0
RETVAL=0
prog="proftpd"
start() {
echo -n $"Starting $prog: "
daemon proftpd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
}
stop() {
echo -n $"Shutting down $prog: "
killproc proftpd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status proftpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/proftpd ]; then
stop
start
fi
;;
reload)
echo -n $"Re-reading $prog configuration: "
killproc proftpd -HUP
RETVAL=$?
echo
;;
*)
echo "Usage: $prog {start|stop|restart|reload|condrestart|status}"
exit 1
esac
exit $RETVAL
Go back to the HOWTO: CentOS 5 setup for LAMP and ISPconfig