Linux Apache Subversion,svn与web目录同步

httpd.conf

<Location /svn>
    DAV svn
    SVNListParentPath on
    SVNParentPath /var/svn_root
    AuthType Basic
    AuthName “Dev Subversion”
    AuthUserFile /var/svn_root/passwd
    Require valid-user
</Location>

————————————分割线————————————

svn checkout –username $username –password $password svn://127.0.0.1/freers /var/www/svn_webroot/

————————————分割线————————————

/var/svn_root/freers/hooks/post-commit

svn update /var/www/svn_webroot –username yangxianchao –password password

搭建 LNAMP 服务器,linux-nginx-apache-mysql-php

本安装过程适用 64位 CentOS 操作系统

gcc,libtool,iconv
——————————————————————————————-
zlib
./configure –prefix=/srv/lib/zlib && make && make install
——————————————————————————————-
nginx
./configure –prefix=/srv/nginx –with-http_stub_status_module –with-zlib=../zlib-1.2.5 –with-http_ssl_module –with-openssl=../openssl-1.0.0c –with-pcre=../pcre-8.11 && make && make install
——————————————————————————————-
apache
./configure –prefix=/srv/apache –enable-mods-shared=all –enable-so –with-port=81 && make && make install
——————————————————————————————-
mysql
groupadd mysql
useradd -r -g mysql mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db –user=mysql
chown -R root .
chown -R mysql data
bin/mysqld_safe –user=mysql &
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
——————————————————————————————-
libxml
./configure –prefix=/srv/lib/libxml2 –with-zlib=/srv/lib/zlib && make && make install
——————————————————————————————-
libpng
./configure –prefix=/srv/lib/libpng && make && make install
——————————————————————————————-
freetype
./configure –prefix=/srv/lib/freetype && make && make install
——————————————————————————————-
jpeg
mkdir /srv/lib/jpeg
mkdir /srv/lib/jpeg/include
mkdir /srv/lib/jpeg/lib
mkdir /srv/lib/jpeg/bin
mkdir /srv/lib/jpeg/bin/cjpeg
mkdir /srv/lib/jpeg/man
mkdir /srv/lib/jpeg/man/man1
./configure –prefix=/srv/lib/jpeg –enable-shared && make && make install
——————————————————————————————-
gd
gd_png.h /srv/lib/libpng/include/
./configure –prefix=/srv/lib/gd –with-png=/srv/lib/libpng –with-freetype=/srv/lib/freetype –with-jpeg=/srv/lib/jpeg && make && make install
——————————————————————————————-
mhash
./configure && make && make install
——————————————————————————————-
libmcrypt
./configure && make && make install
——————————————————————————————-
mcrypt
./configure –prefix=/srv/lib/mcrypt && make && make install
——————————————————————————————-
curl
./configure –prefix=/srv/lib/curl && make && make install
——————————————————————————————-
gettext
./configure –prefix=/srv/lib/gettext && make && make install
——————————————————————————————-
php
./configure –prefix=/srv/lib/php-5.2 –with-apxs2=/srv/apache/bin/apxs –with-libxml-dir=/srv/lib/libxml2 –with-zlib-dir=/srv/lib/zlib –with-curl=/srv/lib/curl –with-jpeg-dir=/srv/lib/jpeg –with-png-dir=/srv/lib/libpng –with-freetype-dir=/srv/lib/freetype –with-gettext=/srv/lib/gettext –with-gd=/srv/lib/gd –enable-gd-native-ttf –with-mcrypt=/srv/lib/mcrypt –with-mysql=/usr/local/mysql –enable-mbstring –enable-magic-quotes –enable-soap –enable-sockets && make && make install
——————————————————————————————-
ZendOptimizer
jdk
tomcat

定时备份数据库

crontab -e

30 2 * * * sh /srv/backdb.sh

————————————-分割线————————————-

#!/bin/sh
#backdb.sh

o_dbname=”/mysqldata/dbname-“`date -d “2 days ago” +%Y-%m-%d`”.sql”
n_dbname=”/mysqldata/dbname-“`date +%F`”.sql”
/usr/local/mysql/bin/mysqldump -u root –databases dbname > $n_dbname

if [ -f $o_dbname ]
then
 rm -rf $o_dbname
fi

————————————-分割线————————————-