#!/bin/sh
Soft_path=/soft/tool
Tar_path=/usr/local/src
apr_dir=/usr/local/src/apr-1.5.2
apr_util_dir= $tar _path/apr-util-1.5.4
httpd_dir= $tar _path/httpd-2.4.16
svn_dir= $tar _path/subversion-1.9.1
pcre_dir= $tar _path/pcre-8.36
sqlite_dir= $tar _path/sqlite-autoconf-3081101
scons_dir= $tar _path/scons-2.4.0
serf_dir= $tar _path/serf-1.3.8
Soft_dir=/application
Log=/tmp/install
ip= ' ifconfig eth0 |awk-f "[:]+" ' nr==2 {print $4} '
Retval=0
function Check () {
If [$RETVAL-eq 0];then
echo "is OK"
Else
echo "is Error"
Exit 1
Fi
}
#################################### Yum Install ###################################
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ yum install gcc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
/etc/init.d/iptables stop
Check
Sed-i ' S#selinux=enforcing#selinux=disabled#g '/etc/selinux/config
Yum install gcc* openssl-devel zlib zlib-devel qlite httpd-tools-y
test-d/application && echo "/application directory exists" | | Mkdir/application-p
Mkdir/tmp/install-p
Mkdir/soft/tool-p
#################################### svn+httpd ####################################
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ Install SVN+HTTPD ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Sleep 3
CD $soft _path
Tar XF apr-1.5.2.tar.gz-c $tar _path
Tar XF apr-util-1.5.4.tar.gz-c $tar _path
Tar XF httpd-2.4.16.tar.gz-c $tar _path
Tar XF subversion-1.9.1.tar.gz-c $tar _path
Tar XF pcre-8.36.tar.gz-c $tar _path
Tar XF scons-2.4.0.tar.gz-c $tar _path
Tar jxf serf-1.3.8.tar.bz2-c $tar _path
Unzip sqlite-amalgamation-3071501.zip-d/usr/local/src/subversion-1.9.1
Mv/usr/local/src/subversion-1.9.1/sqlite-amalgamation-3071501/usr/local/src/subversion-1.9.1/ Sqlite-amalgamation
################################### Install Pcre ###################################
Sleep 3
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ pcre in Install ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
CD $pcre _dir
./configure--prefix= $soft _dir/pcre && make && make install
################################### Install Apr ###################################
Sleep 3
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ Apr install ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
CD $APR _dir
./configure--prefix= $soft _dir/apr && make && make install
################################### instal arp-util ################################
Sleep 3
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ arp-util install ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
CD $APR _util_dir
./configure--prefix= $soft _dir/apr-util--with-apr= $soft _dir/apr && make && make install
################################### Install httpd ################################
Sleep 3
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ Install in httpd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
CD $HTTPD _dir
./configure--prefix= $soft _dir/apache2--with-apr= $soft _dir/apr--with-apr-util= $soft _dir/apr-util \
--with-apr= $soft _dir/apr--with-pcre= $soft _dir/pcre--with-apr-util= $soft _dir/apr-util--enable-rewrite \
--enable-dav-enable-maintainer-mode--enable-dav-fs--enable-ssl--enable-so && make && make install
Sed-i ' s\ #ServerName www.example.com:80\servername $IP \g ' $soft _dir/apache2/conf/httpd.conf
$soft _dir/apache2/bin/apachectl-t
################################### instal scons ################################
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ Install in SCons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
CD $scons _dir
Python setup.py Install
Sleep 3
################################### instal serf ################################
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ Install in serf ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
CD $serf _dir
SCons prefix= $soft _dir/serf apr= $soft _dir/apr apu= $soft _dir/apr-util openssl=/usr/bin
SCons Install
################################### Install SVN ################################
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ Install in SVN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
CD $SVN _dir
./configure--prefix= $soft _dir/svn--with-apr= $soft _dir/apr--with-apr-util= $soft _dir/apr-util \
--with-apxs= $soft _dir/apache2/bin/apxs--with-serf= $soft _dir/serf && make && make install
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ httpd config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
cp-rp/application/svn/libexec/mod_authz_svn.so/application/apache2/modules/
cp-rp/application/svn/libexec/mod_dav_svn.so/application/apache2/modules/
ECHO-E "#set svnpath\n export path=/application/svn/bin: $PATH" >>/etc/profile
. /etc/profile
Sed-i '/loadmodule dav_module modules/a \loadmodule dav_svn_module modules/mod_dav_svn.so '/application/apache2/conf/ httpd.conf
Sed-i '/loadmodule dav_svn_module modules/a \loadmodule authz_svn_module modules/mod_authz_svn.so '/application/ Apache2/conf/httpd.conf
Sed-i '/httpd-vhosts.conf/a #SVN '/application/apache2/conf/httpd.conf
Sed-i '/#SVN/a Include conf/extra/httpd-svn.conf '/application/apache2/conf/httpd.conf
echo "<Location/svn>
DAV SVN
Svnparentpath/svn/svndata
# Our Access control Policy
Authzsvnaccessfile/application/svn/conf/authz
# Authenticated Users may access the repository
Require Valid-user
# How to authenticate a user
AuthType Basic
AuthName Subversion Repository
authuserfile/application/svn/conf/passwd
</Location>
">/application/apache2/conf/extra/httpd-svn.conf
Sed-i ' s#subversion repository# "Subversion repository" #g '/application/apache2/conf/extra/httpd-svn.conf
echo "################################### svn create ################################"
Mkdir/svn/svndata-p
Mkdir/application/svn/conf
Svnadmin Create/svn/svndata/sadoc
cp/svn/svndata/sadoc/conf/authz/application/svn/conf/
echo "Please vim Authen # htpaswd/application/svn/conf/passwd"
Useradd-s/sbin/nologin apache-m
Chown-r Apache.apache/svn/svndata
Sed-i ' s#user daemon#user apache#g '/application/apache2/conf/httpd.conf
Sed-i ' s#group daemon#group apache#g '/application/apache2/conf/httpd.conf
Sed-i '/,&joe/a admin = Xing '/application/svn/conf/authz
HTPASSWD-CBM/APPLICATION/SVN/CONF/PASSWD Xing passwd
/application/apache2/bin/apachectl-k restart
echo "[sadoc:/]
@admin = RW
">>/application/svn/conf/authz
echo "Please open/HTTP $IP/svn/sadoc user=xing password=passwd"
SVN CO/HTTP $IP/svn/sadoc--username=xing--password=passwd
This article is from the "Little Rookie" blog, please be sure to keep this source http://xiaocainiaox.blog.51cto.com/4484443/1697855
SVN Learning II (SVN+HTTPD deployment script)