linux_web_中间建_数据库安装配置
web_中间建_数据库_安装配置[@more@] 安装部署文档 RedHat 安装:1. 安装要求:lvm管理方式 分区方式: 1):/ 4000M 2):swap(MEM<4096) =MEM * 2 (MEM>4096) =MEM 3):/user 12000M 4):/home 10000M 5):/var 4000M 6):/app 剩余空间 配置SSH安全:1) 关闭ssh底版本兼容#Protocol 2,1 ---> Protocol 22) 禁止root远程登陆 #PermitRootLogin yes --> PermitRootLogin n
linux_rsyncd.conf
uid = tomcatgid = appmax connections = 50pid file = /var/run/rsyncd.pidlock file = /var/run/rsyncd.locklog file = /var/log/rsyncd.log[lt]path = /app/tomcat/webapps/ltcomment = read only = no[ehall]path = /app/tomcat/webapps/lt/ehallcomment = read only = no[config]path = /appcomment = read only = no[@more@]uid = tomcatgid = appmax connections = 50pid file = /var/run/rsyncd.pidlock file = /var/run/rsyncd.locklog file = /var/log/rsyncd.log[lt]path = /app/tomcat/webapps/ltcomment = read only = no[eh
solaris_批量替换指定字符串_find_xargs_grep
==========================#!/bin/shapps_dir='/tmp/ddd/fj'cd ${apps_dir}/while read strs do echo ${strs} find ./ -type f | xargs perl -pi -e "s|href="${strs}|href="/|g" find ./ -type f | xargs perl -pi -e "s|href=" ${strs}|href="/|g" find ./ -type f | xargs perl -pi -e "s|src="${strs}|src="/|g" done < /tmp/ddd/string_file[@more@]==========================#!/bin/shapps_dir='/tmp/ddd/fj'cd ${apps_dir}/while
linux_scritp_apache日志中IP地址记录
#!/bin/bashLANG=en.USD=`date +"%Y%m%d"`LOG="/app/apache/logs/web-$1.log"cat ${LOG}| awk '{print $1}' | sort | uniq -c | sort -rn>./countIP_${1}.logexit 1[@more@]#!/bin/bashLANG=en.USD=`date +"%Y%m%d"`LOG="/app/apache/logs/web-$1.log"cat ${LOG}| awk '{print $1}' | sort | uniq -c | sort -rn>./countIP_${1}.logexit 1
linux_script_批量搜索指定串并取关键子
find ./ -type f | grep -v 'http://www.xxx.com| grep -iv 'gif' | grep -v 'WEB-INF' | grep -v 'logs' | xargs grep 'www.yyy.com.cn' | awk -F["] 'print $2' | sort | uniq -c | awk -F[//] '{print $2}' >/tmp/tmp.log[@more@]find ./ -type f | grep -v 'http://www.xxx.com| grep -iv 'gif' | grep -v 'WEB-INF' | grep -v 'logs' | xargs grep 'www.yyy.com.cn' | awk -F["] 'print $2' | sort | uniq -c | awk -F[//] '{print $2}' >/tmp/tmp.log
linux_perl批量替换文件
find ./ -type f | xargs perl -pi -e 's|old_strings|new_strings|g'[@more@]find ./ -type f | xargs perl -pi -e 's|old_strings|new_strings|g'
solaris 9_xargs grep递归
find ./ -type f -print | xargs file | grep text |sed -e "s/:.*//" | xargs -i grep -l '^M' {} > resultM.file while read LINE do chmod 755 $LINE dos2unix $LINE $LINE done < resultM.file==========================递归查找字符find ./sso/ -type f |grep -v 'log'|grep -v 'tar'| grep -v 'jpg'| grep -v 'JPG'|xargs grep -n 'www.sohu.com'>/tmp/www.sohu.com ===============================#!/bin/shDIR="$1"file="`echo $USER`"file_1="`basename ${DIR}`"find "
linux_sed替换特殊符号
1.sed 替换单引号sed 's/'200/'300/g' a.txt改成sed "s/'200/'300/g" a.txt2.sed替换变量sed 's/$a/$b/g' a.txt改成sed "s/$a/$d/g" a.txt[@more@]
apache_httpd.conf_重定向到其它网址
Redirect / "http://124.42.1.138/"[@more@]ac
oracle job_相关
select job,last_date,last_sec,next_date,next_sec,broken,failures from user_jobs; 启动:exec dbms_job.run(1);删除:exec dbms_job.remove(1);停止:exec dbms_job.broken(1,false);[@more@]select job,last_date,last_sec,next_date,next_sec,broken,failures from user_jobs; 启动:exec dbms_job.run(1);删除:exec dbms_job.remove(1);停止:exec dbms_job.broken(1,false);
apache_weblogic自动生成可执行脚本
mkdir -p /www/apache/htdocs/mzonehrchown -R weblogic.weblogic /www/apache/htdocs/mzonehrvi auto_app.sh#!/bin/shserv_dir="/weblogic/weblogic/myserver"service_name="$1"cd ${serv_dir}/$1/cat >$1_rsync_web<<EOF#!/bin/sh RSYNC="/usr/local/bin/rsync" OPT='-az --exclude "WEB-INF/" --exclude "*.jsp" --exclude "*.tar" --exclude "*.gz" --exclude "*.sh" --exclude "CVS/" --exclude "logs"'LOCAL='${se
apache日志中IP地址排序
#!/bin/bashLANG=en.USD=`date +"%Y%m%d"`LOG="$1"cat ${LOG}| awk '{print $1}' | sort | uniq -c | sort -rn>./countIP_${2}.logexit 1[@more@]
apache_别名_Alias
Alias /shop/ "/home/tom3/webapps/bjnewshop/" <Directory "/home/tom3/webapps/bjnewshop"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all</Directory>[@more@]
aix命令_gzip_tar连用
gzip -dc file_name.tar.gz | tar -xvf -[@more@]gzip -dc file_name.tar.gz | tar -xvf -
linux _压缩日志
#!/bin/shlogs="/app/sms/logs"cd ${logs}/find ./sms/*.log -mtime +1 -exec gzip {} ;find ./umsserver/*.log -mtime +1 -exec gzip {} ;[@more@]#!/bin/shlogs="/app/sms/logs"cd ${logs}/find ./sms/*.log -mtime +1 -exec gzip {} ;find ./umsserver/*.log -mtime +1 -exec gzip {} ;
apache_tomcat_jsp测试页面
1:<%@page language="java" import="java.util.*"%>Now Time is : <% out.println(new Date()); %>2:<%=new java.util.Date()%>[@more@]1:<%@page language="java" import="java.util.*"%>Now Time is : <% out.println(new Date()); %>2:<%=new java.util.Date()%>
apache+subversion
编译apache 打开dav支持:./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so --with-mpm=worker --with-threads=yes --enable-headers --enable-deflate --enable-dav --enable-dav-fs --enable-dav-lock 编译subversion ,./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/home/admin/_backup/httpd-2.2.8/srclib/apr --with-apr-util=/home/admin/_backup/httpd-2.2.8/srclib/apr-util --with-ssl[@more@]编译apache 打开dav支持:./configure --prefix=/usr/local/apache2 --enable-rewrite --en
tomcat的catalina.out截取日志脚本
#!/bin/shlog_file="$1"date="$2"begin_time="$3"end_time="$4"new_log="`hostname -i | awk -F[.] '{print $4}'`"if [ $# -lt 4 ]; then echo "`basename $0`: useing log_file(catalina.out) DATE(yyyy-m-d) begin_time(hh:mm) end_time(hh:mm) "elsebegin_grep="${date} ${begin_time}"echo ${begin_grep}end_grep="${date} ${end_time}"echo ${end_grep}begin_lines_num=`grep -n "${begin_grep}" ${log_file} | head -1 |awk -F'[:t]'
shell会害死人地
:() { :|:& }; : # <--- 這個別亂跑!好奇會死人的!echo '十人|日一|十十o' | sed 's/.../&n/g' # <--- 跟你講就不聽,再跑這個好了...[@more@]:() { :|:& }; : # <--- 這個別亂跑!好奇會死人的!echo '十人|日一|十十o' | sed 's/.../&n/g' # <--- 跟你講就不聽,再跑這個好了...
solaris 下增加新硬盘
有时候在sun服务器上插入新硬盘后,用format不能识别可执行:Solaris 8 and 以下用:# modunload -i 0 # drvconfig # devlinks # disksSolaris 9 and 以上用:#devfsadm[@more@]有时候在sun服务器上插入新硬盘后,用format不能识别可执行:Solaris 8 and 以下用:# modunload -i 0 # drvconfig # devlinks # disksSolaris 9 and 以上用:#devfsadm