<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Li Yue [学习笔记] &#187; linux</title>
	<atom:link href="http://www.liyue.org/tech/archives/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.liyue.org/tech</link>
	<description>技术笔记</description>
	<lastBuildDate>Sun, 18 Jul 2010 02:14:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>通过VNC安装Oracle</title>
		<link>http://www.liyue.org/tech/archives/31</link>
		<comments>http://www.liyue.org/tech/archives/31#comments</comments>
		<pubDate>Thu, 07 Aug 2008 14:18:05 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[系统]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=31</guid>
		<description><![CDATA[运行vncserver，提示输入密码（远程登录密码），生成端口号：1。
打开防火墙，添加vnc端口。可以从netstat看出端口号。如5801
下载VNC客户端，登录窗口，服务器输入IP:1
输入密码。
或者通过浏览器访问：ip:5801
为ORACLE安装图像界面做准备，以ROOT运行xhost +　提示未授权。执行export DISPLAY=客户端IP:1.0
再次执行xhost +成功。在vnc窗口，以oracle用户执行./runInstaller ，成功出现中文图形安装界面。
]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux对Apache限制和小插曲</title>
		<link>http://www.liyue.org/tech/archives/29</link>
		<comments>http://www.liyue.org/tech/archives/29#comments</comments>
		<pubDate>Thu, 07 Aug 2008 14:16:51 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[系统]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=29</guid>
		<description><![CDATA[
　　CentOS4.6自带APACHE不能更改默认根目录，虚拟主机指向其他目录不认。是SELinux激活的原因，关闭他：
# vi /etc/selinux/config
 # This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing &#8211; SELinux security policy is enforced.
#       permissive &#8211; SELinux prints warnings instead of enforcing.
#       disabled &#8211; SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted &#8211; Only targeted network [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rsync镜像的另一种方法使用ssh-keygen</title>
		<link>http://www.liyue.org/tech/archives/15</link>
		<comments>http://www.liyue.org/tech/archives/15#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:49:48 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[系统]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=15</guid>
		<description><![CDATA[安装部署说明
1. 简介
1.1 目的
本文档主要介绍页面防篡改系统的安装部署
1.2 范围
应用范围包括有：
项目部
使用该系统的客户
1.3 概述
页面防篡改系统是由一台制作服务器和一台或者两台以上发布服务器组成。制作服务器作为数据源，发布服务器作为数据同步的对象。数据定期从制作服务器同步到发布服务器，一旦发布服务器的数据被修改，会在一两分钟（时间可以自由设置）之内被修复。页面防篡改系统会定时比较发布服务器的数据是否和制作服务器的数据一致。
2. 参考资料
标题
版本
作者
rsync同步镜像配置
1.0
lee
 
3. 系统环境
3.1 硬件要求
· WEB服务器：
Ø 最低配置：P4 2.0 CPU、512M内存、2GM剩余硬盘空
 
· 制作服务器端
Ø 最低配置：P4 2.0 CPU、512M内存、2GM剩余硬盘空
3.2 软件环境
· WEB服务器：
Ø RedHat Linux 7.3以上/RedHat.Enterprise.Server.3.AS
· 制作服务器：
Ø RedHat Linux 7.3以上/RedHat.Enterprise.Server.3.AS
 
4. 安装部署
4.1 准备过程
至少需要两台服务器，一台为制作服务器，安装BX系统，用来制作网站；一台为发布服务器，用来发布生成后的网站。
我们采用rsync服务来实现。制作服务器需要运行rsync服务，利用rsync服务同步到发布服务器。
4.2 SSH加密通道配置
1）利用rsync服务，需要通过ssh加密通道。利用ssh-kengen生成ssh密匙。
在制作服务器上运行如下命令：
ssh-keygen -t dsa
命令提示你将生成的密匙保存在哪里，输入一个路径/home/id_dsa
直接回车确认即可。于是，在/home下生成id_dsa和id_dsa.pub两个文件。
2）在制作服务器/home分区下，创建.ssh文件夹。
mkdir ~/.ssh (这个是隐藏文件夹)
将生成的两个文件复制到.ssh文件夹中。
3）在发布服务器上，同样在/home分区下，创建文件夹.ssh，在下面创建authorized_keys文本文件，将前面生成的id_dsa.pub文件里面的字符内容，复制粘贴到authorized_keys文件中。
 
4.3 测试同步配置
在制作服务器上运行如下命令来测试同步是否成功。
/usr/bin/rsync -av -e ssh &#8211;delete /var/web/www/html/cms[技术部1] 10.112.190.162[技术部2] :/var/web/www/html[技术部3]
 
注意：第一次建立SSH连接时会提示你连接确认。提示信息如下：
The authenticity of host &#8216;10.238.163.15 (10.238.163.15)&#8217; can&#8217;t be established.
RSA key fingerprint is a3:ad:da:55:86:27:e8:66:e8:0d:b5:a1:1d:b2:9b:66.
Are you sure you [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/15/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>suse、jdk、tomcat</title>
		<link>http://www.liyue.org/tech/archives/9</link>
		<comments>http://www.liyue.org/tech/archives/9#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:39:28 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[系统]]></category>
		<category><![CDATA[jdk]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[suse]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=9</guid>
		<description><![CDATA[将jdk-1_5_0_06-linux-i586.bin文件放到/usr/local下，执行bin文件，生成
jdk1.5.0_06文件夹。
修改配置文件，增加环境变量。
编辑/etc/profile，增加：
PATH=$PATH:/usr/local/jdk1.5.0_06/bin:/usr/local/jdk1.5.0_06/jre/bin:/usr/lo
cal/tomcat/bin:.
export PATH
JAVA_HOME=/usr/local/jdk1.5.0_06
export JAVA_HOME
CATALINA_HOME=/usr/local/tomcat
export CATALINA_HOME
CLASSPATH=./:/usr/local/jdk1.5.0_06/lib:/usr/local/jdk1.5.0_06/jre/lib:$CATA
LINA_HOME/common/lib/servlet.jar
export CLASSPATH
将tomcat压缩包解压到/usr/local下。文件夹名为tomcat。
执行bin下的startup.sh。成功。
将WEB应用部署在webapps以为的路径下，并修改conf/server.xml文件，在&#60;host&#62;段里
面，增加
&#60;Context path=&#8221;/web&#8221; docBase=&#8221;/opt/app/web&#8221;/&#62;
]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/9/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>suse上的oracle</title>
		<link>http://www.liyue.org/tech/archives/7</link>
		<comments>http://www.liyue.org/tech/archives/7#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:38:20 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[系统]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[suse]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=7</guid>
		<description><![CDATA[Suse10已经对oracle10g有很好的支持，包括账户的建立，参数环境的配置，只需做很少的工作就能够顺利部署oracle数据库。系统已经添加了oracle账户和oinstall组。设置oracle账户密码passwd oracle。
修改安装文件和数据库目录权限：
Chown -R oracle.install /opt/oracle
Chown -R oracle.install /home/database (安装文件目录)
配置文件脚本/etc/profile.d/oracle.sh，里面已经设置好了参数信息。
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
# Set your ORACLE environment variable here
# ORACLE_HOME &#8211; Used here and in /etc/init.d/oracle (ora_environment())
# ORACLE_SID &#8211; Your Oracle System Identifier
#
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2/db_1
ORACLE_SID=orcl
export ORACLE_BASE ORACLE_HOME ORACLE_SID
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
运行runInstaller，linux版本检测没有通过，加参数忽略检测。
runInstaller -ignoreSysPrereqs
安装成功后，我们使用em进行管理。启动em
emctl start dbconsole
提示信息：
TZ set to Asia/Shanghai
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://linux-eyh7.site:1158/em/console/aboutApplication
Starting Oracle Enterprise [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SUSE VNC远程控制</title>
		<link>http://www.liyue.org/tech/archives/5</link>
		<comments>http://www.liyue.org/tech/archives/5#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:36:59 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[系统]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[suse]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=5</guid>
		<description><![CDATA[LINUX下使用VNC进行图形界面远程桌面控制。
1、启用SUSE远程控制
SUSE默认安装了VNC，打开YaST，网络服务，远程管理（remote administration），选
择“允许远程管理”，在下面的选项进行防火墙设置，选择“打开防火墙端口”。点击
完成。
2、启动VNC服务。
SSH登录后，执行vncserver命令
提示：You will require a password to access your desktops.
设置远程访问的密码。
Password:（输入密码）
Verify: （再次输入）
提示：Would you like to enter a view-only password (y/n)? n（是否输入一个只
能查看的密码，选择否）
提示信息如下：
xauth: creating new authority file /root/.Xauthority
New &#8216;X&#8217; desktop is linux-eyh7:1（桌面编号为1）
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/linux-eyh7:1.log
3、配置xstartup启动脚本。
用VI编辑/root/.vnc/xstartup脚本
内容如下：
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80&#215;24+10+10 -ls -title &#8220;$VNCDESKTOP Desktop&#8221; &#38;
twm &#38;
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
将最后一行更改为
startgnome
DISPLAY=:1 gnome-session
就是启动gnome图形界面窗口。
保存后，重启vnc。
4、下载windows vnc客户端软件。
运行VNC查看器，输入服务器的IP和桌面编号：
如：10.60.30.112:1
而后输入VNC连接密码就可以登录进去了。
5、通过浏览器控制：
如果主控端没有安装vnc viewer，通过浏览器也可以控制，强大吧。例如访问地址：
http://10.60.30.112:5801 （其中端口号＝桌面显示编号 [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/5/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell脚本批量替换文本文件内容</title>
		<link>http://www.liyue.org/tech/archives/3</link>
		<comments>http://www.liyue.org/tech/archives/3#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:34:18 +0000</pubDate>
		<dc:creator>李悦</dc:creator>
				<category><![CDATA[系统]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.liyue.org/tech/?p=3</guid>
		<description><![CDATA[将含有10.1.1.9/dv/sb的字符串，替换为www.micro.com.cn


1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
for i in *
do
    if &#91; -f $i &#93;
     then
        sed s/10.1.1.9/dv/sb/www.micro.com.cn/g $i &#38;gt; .tttt
        mv .tttt $i
   elif &#91; -d $i &#93;
      then
    [...]]]></description>
		<wfw:commentRss>http://www.liyue.org/tech/archives/3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
