<?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>LiangXu Wang &#187; debian</title>
	<atom:link href="http://wlx.westgis.ac.cn/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://wlx.westgis.ac.cn</link>
	<description>research of gis, rs, opensource.</description>
	<lastBuildDate>Wed, 28 Jul 2010 17:08:40 +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>WebDAV on Apache2</title>
		<link>http://wlx.westgis.ac.cn/594/</link>
		<comments>http://wlx.westgis.ac.cn/594/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 08:26:43 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[webdav]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/?p=594</guid>
		<description><![CDATA[本来应该很简单，参考debian administration的操作，结果作下来后，发现没有些权限写。最后才发现是当前目录的父目录有一个word press生成的.htaccess文件，正是这个文件导致了问题的产生。
解决办法：拷贝父目录下的.htaccess文件，然后注释掉里面有影响的句子。
]]></description>
			<content:encoded><![CDATA[<p>本来应该很简单，参考<a href="http://www.debian-administration.org/articles/285">debian administration</a>的操作，结果作下来后，发现没有些权限写。最后才发现是当前目录的父目录有一个word press生成的.htaccess文件，正是这个文件导致了问题的产生。</p>
<p>解决办法：拷贝父目录下的.htaccess文件，然后注释掉里面有影响的句子。</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/594/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>转移邮件服务器：postfix</title>
		<link>http://wlx.westgis.ac.cn/396/</link>
		<comments>http://wlx.westgis.ac.cn/396/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 11:24:43 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[amavis]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[courier]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[feisty]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[saslauth]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/396/</guid>
		<description><![CDATA[原邮件服务器硬盘损害，已经无法工作，需要转移到新服务器上。
原来的服务器是debian etch，新服务器是ubuntu feisty。
首先安装：
sudo aptitude install postfix postfix-mysql courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl postfix-tls libsasl2 libsasl2-modules libsasl2-modules-sql sasl2-bin openssl libpam-mysql  amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 unzoo libnet-ph-perl libnet-snpp-perl libnet-telnet-perl nomarch lzop pax razor pyzor dcc-client
首先创建mysql数据库，因为原来已经创建，直接导入就可以了。
把原来的mysql-virtual*文件拷贝到/etc/postfix/目录下，注意若mysql用户密码发生变化，要进行相应的修改。
然后修改文件权限：
chmod o= /etc/postfix/mysql-virtual_*.cf
chgrp postfix /etc/postfix/mysql-virtual_*.cf
创建vmail用户：
groupadd -g 5000 vmail
useradd -g vmail -u 5000 vmail -d /home/vmail -m
对/etc/postfix/main.cf进行修改定制：
postconf -e 'myhostname [...]]]></description>
			<content:encoded><![CDATA[<p>原邮件服务器硬盘损害，已经无法工作，需要转移到新服务器上。<br />
原来的服务器是debian etch，新服务器是ubuntu feisty。</p>
<p>首先安装：<br />
sudo aptitude install postfix postfix-mysql courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl postfix-tls libsasl2 libsasl2-modules libsasl2-modules-sql sasl2-bin openssl libpam-mysql  amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 unzoo libnet-ph-perl libnet-snpp-perl libnet-telnet-perl nomarch lzop pax razor pyzor dcc-client</p>
<p>首先创建mysql数据库，因为原来已经创建，直接导入就可以了。<br />
把原来的mysql-virtual*文件拷贝到/etc/postfix/目录下，注意若mysql用户密码发生变化，要进行相应的修改。<br />
然后修改文件权限：</p>
<blockquote><p>chmod o= /etc/postfix/mysql-virtual_*.cf<br />
chgrp postfix /etc/postfix/mysql-virtual_*.cf</p></blockquote>
<p>创建vmail用户：</p>
<blockquote><p>groupadd -g 5000 vmail<br />
useradd -g vmail -u 5000 vmail -d /home/vmail -m</p></blockquote>
<p>对/etc/postfix/main.cf进行修改定制：</p>
<blockquote><p>postconf -e 'myhostname = server1.example.com'<br />
postconf -e 'mydestination = server1.example.com, localhost, localhost.localdomain'<br />
postconf -e 'mynetworks = 127.0.0.0/8'<br />
postconf -e 'virtual_alias_domains ='<br />
postconf -e ' virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf'<br />
postconf -e 'virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf'<br />
postconf -e 'virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf'<br />
postconf -e 'virtual_mailbox_base = /home/vmail'<br />
postconf -e 'virtual_uid_maps = static:5000'<br />
postconf -e 'virtual_gid_maps = static:5000'<br />
postconf -e 'smtpd_sasl_auth_enable = yes'<br />
postconf -e 'broken_sasl_auth_clients = yes'<br />
postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination'<br />
postconf -e 'transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf'<br />
postconf -e 'content_filter = amavis:[127.0.0.1]:10024'<br />
postconf -e 'receive_override_options = no_address_mappings'
</p></blockquote>
<p>这部分需要具体检查，我把myorigin这个给注释掉了，对于多域名的邮件列表有影响。</p>
<p>saslauthd相关设置，和DEBIAN不大一样，和UBUNTU EDGY也不尽相同：</p>
<blockquote><p>sudo rm -fdr /var/spool/postfix/var/run/saslauthd<br />
sudo mv /var/run/saslauthd /var/spool/postfix/var/run/saslauthd<br />
sudo ln -s /var/spool/postfix/var/run/saslauthd /var/run/saslauthd<br />
sudo adduser postfix sasl</p></blockquote>
<p>修改/etc/default/saslauthd文件，把START修改为yes。<br />
修改/etc/pam.d/smtp文件：</p>
<blockquote><p>auth    required   pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1</p>
<p>account sufficient pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1</p></blockquote>
<p>对应的用户名密码数据库要进行替换。</p>
<p>修改/etc/courier/authdaemonrc文件，把authmodulelist的值变为"authmysql"。</p>
<p>修改/etc/init.d/postfix文件，在FILES部分：</p>
<blockquote><p>     FILES=”etc/localtime etc/services etc/resolv.conf etc/hosts \<br />
    etc/nsswitch.conf etc/nss_mdns.config etc/postfix/sasl/smtpd.conf etc/sasldb2″ </p></blockquote>
<p>这个原来是有sasldb2文件的，但是在ubuntu feisty下没有这个文件，但执行起来没有问题，比较奇怪。</p>
<p>修改/etc/courier/authmysqlrc文件：</p>
<blockquote><p>MYSQL_SERVER localhost</p>
<p>MYSQL_USERNAME mail_admin</p>
<p>MYSQL_PASSWORD mail_admin_password</p>
<p>MYSQL_PORT 0</p>
<p>MYSQL_DATABASE mail</p>
<p>MYSQL_USER_TABLE users</p>
<p>MYSQL_CRYPT_PWFIELD password</p>
<p>#MYSQL_CLEAR_PWFIELD password</p>
<p>MYSQL_UID_FIELD 5000</p>
<p>MYSQL_GID_FIELD 5000</p>
<p>MYSQL_LOGIN_FIELD email</p>
<p>MYSQL_HOME_FIELD "/home/vmail"</p>
<p>MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
</p></blockquote>
<p>重新启动服务：</p>
<blockquote><p>/etc/init.d/courier-authdaemon restart<br />
/etc/init.d/courier-imap restart<br />
/etc/init.d/courier-imap-ssl restart<br />
/etc/init.d/courier-pop restart<br />
/etc/init.d/courier-pop-ssl restart<br />
/etc/init.d/postfix restart<br />
/etc/init.d/saslauthd restart</p></blockquote>
<p>修改/etc/aliases文件，可以根据自己的需要进行修改。</p>
<p>修改vi /etc/amavis/conf.d/15-content_filter_mode文件，去掉几个注释：</p>
<blockquote><p>use strict;</p>
<p># You can modify this file to re-enable SPAM checking through spamassassin</p>
<p># and to re-enable antivirus checking.</p>
<p>#</p>
<p># Default antivirus checking mode</p>
<p># Uncomment the two lines below to enable it back</p>
<p>#</p>
<p>@bypass_virus_checks_maps = (</p>
<p>   \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);</p>
<p>#</p>
<p># Default SPAM checking mode</p>
<p># Uncomment the two lines below to enable it back</p>
<p>#</p>
<p>@bypass_spam_checks_maps = (</p>
<p>   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);</p>
<p>1;  # insure a defined return</p></blockquote>
<p>修改 /etc/amavis/conf.d/50-user文件，添加：</p>
<blockquote><p>$pax='pax';</p></blockquote>
<p>修改/etc/postfix/master.cf文件，添加：</p>
<blockquote><p>[...]</p>
<p>amavis unix - - - - 2 smtp</p>
<p>        -o smtp_data_done_timeout=1200</p>
<p>        -o smtp_send_xforward_command=yes</p>
<p>127.0.0.1:10025 inet n - - - - smtpd</p>
<p>        -o content_filter=</p>
<p>        -o local_recipient_maps=</p>
<p>        -o relay_recipient_maps=</p>
<p>        -o smtpd_restriction_classes=</p>
<p>        -o smtpd_client_restrictions=</p>
<p>        -o smtpd_helo_restrictions=</p>
<p>        -o smtpd_sender_restrictions=</p>
<p>        -o smtpd_recipient_restrictions=permit_mynetworks,reject</p>
<p>        -o mynetworks=127.0.0.0/8</p>
<p>        -o strict_rfc821_envelopes=yes</p>
<p>        -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks</p>
<p>        -o smtpd_bind_address=127.0.0.1</p></blockquote>
<p>修改/etc/spamassassin/local.cf，添加：</p>
<blockquote><p>[...]</p>
<p># dcc</p>
<p>use_dcc 1</p>
<p>dcc_path /usr/bin/dccproc</p>
<p>dcc_add_header 1</p>
<p>dcc_dccifd_path /usr/sbin/dccifd</p>
<p>#pyzor</p>
<p>use_pyzor 1</p>
<p>pyzor_path /usr/bin/pyzor</p>
<p>pyzor_add_header 1</p>
<p>#razor</p>
<p>use_razor2 1</p>
<p>razor_config /etc/razor/razor-agent.conf</p>
<p>#bayes</p>
<p>use_bayes 1</p>
<p>use_bayes_rules 1</p>
<p>bayes_auto_learn 1</p></blockquote>
<p>启动服务：</p>
<blockquote><p>adduser clamav amavis<br />
/etc/init.d/amavis restart<br />
/etc/init.d/clamav-daemon restart<br />
/etc/init.d/clamav-freshclam restart<br />
/etc/init.d/postfix restart
</p></blockquote>
<p>参考：</p>
<p>http://www.howtoforge.com/virtual_postfix_mysql_quota_courier_ubuntu_edgy</p>
<p>http://wlx.westgis.ac.cn/322/</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/396/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>spamassassin的antidrug.cf</title>
		<link>http://wlx.westgis.ac.cn/372/</link>
		<comments>http://wlx.westgis.ac.cn/372/#comments</comments>
		<pubDate>Tue, 22 May 2007 01:33:31 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[antidrup.cf]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/372/</guid>
		<description><![CDATA[收到我的debian服务器发出的邮件：

/etc/cron.daily/amavisd-new:
String found where operator expected at (eval 909) line 1, near ""you" "are""
        (Missing operator before  "are"?)
String found where operator expected at (eval 909) line 1, near ""are" "running""
        (Missing operator before  "running"?)
String found where operator expected at (eval [...]]]></description>
			<content:encoded><![CDATA[<p>收到我的debian服务器发出的邮件：</p>
<blockquote>
<p>/etc/cron.daily/amavisd-new:<br />
String found where operator expected at (eval 909) line 1, near ""you" "are""<br />
        (Missing operator before  "are"?)<br />
String found where operator expected at (eval 909) line 1, near ""are" "running""<br />
        (Missing operator before  "running"?)<br />
String found where operator expected at (eval 909) line 1, near ""running" "SA""<br />
        (Missing operator before  "SA"?)<br />
Number found where operator expected at (eval 909) line 1, near ""SA" 3.0.0"<br />
        (Missing operator before  3.0.0?)<br />
String found where operator expected at (eval 909) line 1, near "3.0.0 "or""<br />
        (Missing operator before  "or"?)<br />
String found where operator expected at (eval 909) line 1, near ""or" "higher""<br />
        (Missing operator before  "higher"?)<br />
String found where operator expected at (eval 909) line 1, near ""higher" "you""<br />
        (Missing operator before  "you"?)<br />
String found where operator expected at (eval 909) line 1, near ""you" "already""<br />
        (Missing operator before  "already"?)<br />
String found where operator expected at (eval 909) line 1, near ""already" "have""<br />
        (Missing operator before  "have"?)<br />
String found where operator expected at (eval 909) line 1, near ""have" "antidrug""<br />
        (Missing operator before  "antidrug"?)<br />
String found where operator expected at (eval 909) line 1, near ""antidrug" "and""<br />
        (Missing operator before  "and"?)<br />
String found where operator expected at (eval 909) line 1, near ""and" "this""<br />
        (Missing operator before  "this"?)<br />
String found where operator expected at (eval 909) line 1, near ""this" "file""<br />
        (Missing operator before  "file"?)<br />
config: unclosed 'if' in /etc/spamassassin/antidrug.cf: if you are running SA 3.0.0 or higher, you already have antidrug and this file</p></blockquote>
<p>然后再去浏览/etc/spamassassin/antidrug.cf，发现已经在SA3.0以上版本中已经不需要这个文件了。<br />
于是删除之，并把crontab中对应的项进行处理。</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/372/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mailman中使用postfix建立多域</title>
		<link>http://wlx.westgis.ac.cn/371/</link>
		<comments>http://wlx.westgis.ac.cn/371/#comments</comments>
		<pubDate>Mon, 21 May 2007 12:22:43 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[mailman]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[westdc]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/371/</guid>
		<description><![CDATA[mailman： 2.1.9
debian etch
服务器上很早就搭建了postfix和mailman服务，但后来又产生新要求，要求mailman中再添加一个域名。原来做过多次尝试，一直未果。
今天把服务器升级为etch，顺便把x和gnome都干掉了。然后想看看这个问题能不能解决，就又试验起来了。
http://www.python.org/cgi-bin/faqw-mm.py?query=virtual+domain&#038;querytype=simple&#038;casefold=yes&#038;req=search
开始都是以为要查询virtual domain，进入了误区，结果一直无解。
官方文档：http://www.gnu.org/software/mailman/mailman-install/node13.html
看了上面的文档后，又实验了多种配置，还是有问题，发到新邮件列表的信一直自动转发到老邮件列表上，导致查无此人。
Reporting-MTA: dns; debian.westgis.ac.cn
 Received-From-MTA: smtp; debian.westgis.ac.cn ([127.0.0.1])
 Arrival-Date: Sat, 30 Dec 2006 12:09:02 +0800 (CST)
 Original-Recipient: rfc822;westdc@lists.westgis.ac.cn
 Final-Recipient: rfc822;westdc@list.cngis.org
 Action: failed
 Status: 5.1.1
 Remote-MTA: dns; 127.0.0.1
 Diagnostic-Code: smtp; 550 5.1.1 &#60;westdc@list.cngis.org&#62;: Recipient address rejected: User unknown in virtual mailbox table
 Last-Attempt-Date: Sat, 30 Dec 2006 12:09:12 +0800 (CST)
修改mm_cfg.py里的相关参数，都试验了一遍，错误信息依旧。然后查看到syslog里的出错信息，也是邮件地址的后缀自动变换了，非常奇怪。
于是检查postfix的main.cf设置，看到：
myorigin = list.cngis.org

想到了是否和这个配置有关系，于是首先修改为另外一个地址，然后再次试验，错误依旧，但错误信息发生了变化！
于是把这个配置注释掉，万事大吉！
想想好像这个地方原来是专门为配置mailman而加上的，没想到错误会出现在这里。当时好像是参照网上的教程直接搬下来的，还是官方的文档可靠阿。
这个问题已经都快半年没有解决了，今天终于解决了，爽阿。
此办法的缺点：各域名之间不能创建同名的邮件列表，即不能同时创建a@dom1.org和a@dom2.org。这个问题在mailman 2.2的版本中得到了解决。
]]></description>
			<content:encoded><![CDATA[<p>mailman： 2.1.9<br />
debian etch<br />
服务器上很早就<a href="http://wlx.westgis.ac.cn/44/">搭建了postfix和mailman服务</a>，但后来又产生新要求，要求mailman中再添加一个域名。原来做过多次尝试，一直未果。</p>
<p>今天把服务器升级为etch，顺便把x和gnome都干掉了。然后想看看这个问题能不能解决，就又试验起来了。</p>
<p>http://www.python.org/cgi-bin/faqw-mm.py?query=virtual+domain&#038;querytype=simple&#038;casefold=yes&#038;req=search</p>
<p>开始都是以为要查询virtual domain，进入了误区，结果一直无解。</p>
<p>官方文档：http://www.gnu.org/software/mailman/mailman-install/node13.html<br />
看了上面的文档后，又实验了多种配置，还是有问题，发到新邮件列表的信一直自动转发到老邮件列表上，导致查无此人。</p>
<blockquote><p><code>Reporting-MTA: dns; debian.westgis.ac.cn<br />
 Received-From-MTA: smtp; debian.westgis.ac.cn ([127.0.0.1])<br />
 Arrival-Date: Sat, 30 Dec 2006 12:09:02 +0800 (CST)<br />
 Original-Recipient: rfc822;westdc@lists.westgis.ac.cn<br />
 Final-Recipient: rfc822;westdc@list.cngis.org<br />
 Action: failed<br />
 Status: 5.1.1<br />
 Remote-MTA: dns; 127.0.0.1<br />
 Diagnostic-Code: smtp; 550 5.1.1 &lt;westdc@list.cngis.org&gt;: Recipient address rejected: User unknown in virtual mailbox table<br />
 Last-Attempt-Date: Sat, 30 Dec 2006 12:09:12 +0800 (CST)</code></p></blockquote>
<p>修改mm_cfg.py里的相关参数，都试验了一遍，错误信息依旧。然后查看到syslog里的出错信息，也是邮件地址的后缀自动变换了，非常奇怪。<br />
于是检查postfix的main.cf设置，看到：</p>
<blockquote><p>myorigin = list.cngis.org
</p></blockquote>
<p>想到了是否和这个配置有关系，于是首先修改为另外一个地址，然后再次试验，错误依旧，但错误信息发生了变化！<br />
于是把这个配置注释掉，万事大吉！<br />
想想好像这个地方原来是专门为配置mailman而加上的，没想到错误会出现在这里。当时好像是参照网上的教程直接搬下来的，还是官方的文档可靠阿。</p>
<p>这个问题已经都快半年没有解决了，今天终于解决了，爽阿。<br />
此办法的缺点：各域名之间不能创建同名的邮件列表，即不能同时创建a@dom1.org和a@dom2.org。这个问题在mailman 2.2的版本中得到了解决。</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/371/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>构建DEBIAN软件包</title>
		<link>http://wlx.westgis.ac.cn/340/</link>
		<comments>http://wlx.westgis.ac.cn/340/#comments</comments>
		<pubDate>Fri, 30 Mar 2007 12:54:30 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[打包]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/340/</guid>
		<description><![CDATA[一直没有系统地看过，这个讲的很详细：
http://debian.linuxsir.org/doc/inthedebianway/debian_build_package.html
1. 声明
    * 版本信息:
      本文档的最新版本将张贴于: LinuxSir.Org论坛 Debian 发行版讨论区 ;
      也可以从 http://debian.linuxsir.org/ 获取.
    * 反馈:
      所有评论, 错误报告, 其他信息以及批评, 请邮寄到 etony@tom.com ;
      或在LinuxSir.Org论坛 Debian发行版讨论区 张贴.
    * 版权信息:
  [...]]]></description>
			<content:encoded><![CDATA[<p>一直没有系统地看过，这个讲的很详细：</p>
<p>http://debian.linuxsir.org/doc/inthedebianway/debian_build_package.html</p>
<blockquote><p><code>1. 声明</p>
<p>    * 版本信息:</p>
<p>      本文档的最新版本将张贴于: LinuxSir.Org论坛 Debian 发行版讨论区 ;</p>
<p>      也可以从 http://debian.linuxsir.org/ 获取.<br />
    * 反馈:</p>
<p>      所有评论, 错误报告, 其他信息以及批评, 请邮寄到 etony@tom.com ;</p>
<p>      或在LinuxSir.Org论坛 Debian发行版讨论区 张贴.<br />
    * 版权信息:</p>
<p>      本文档的版权(c)2006-2007 归 etony C.F.AN 所有.</p>
<p>      转载请注明源自 http://debian.linuxsir.org/ .<span id="more-340"></span></p>
<p>2. Debian软件包介绍</p>
<p>在Debian中存在两种类型的软件包：</p>
<p>    * 源代码包</p>
<p>      源代码包, 包括一个描述源代码包的 .dsc 文件, 一个包含 gzip-tar 归档压缩格式的未经修改源码的 .orig.tar.gz 文件, 一个包含对源代码作 Debian 特有修改的 .diff.gz 文件. 可以使用 dpkg-source 打包和解压 debian 源码文档. 详见联机手册.<br />
    * 二进制包</p>
<p>      二进制包以 .deb 扩展名来表示,这些文件通常称为DEB文件，其中包含可执行文件,文档,配置文件和版权信息及其它一些东西.可以使用 Debian 的 dpkg 工具解包(安装).但除去版权信息(和 changelog.Debian 文件)不讲,二进制包也可以是空的,这种软件包作为过渡包或关联包(也称虚拟包),它们的唯一的作用是用于满足依赖性.</p>
<p>在本文中我们将主要讲述 .deb 包的构建,源代码包的只会有少量舍己</p>
<p>软件包命名约定</p>
<p>Debian软件包命名遵循下列约定: &lt;软件包名称&gt;_&lt;版本&gt;-&lt;Debian修订号&gt;_&lt;平台&gt;.deb</p>
<p>例如</p>
<p>    nano_1.3.10-2_i386.deb</p>
<p>            软件包名称: nano<br />
            版本: 1.3.10<br />
            修订号: 2<br />
            平台: i386</p>
<p>3. .deb 文件的结构</p>
<p>参阅 Debian 的软件包管理系统介绍<br />
4. 修改现有 .deb 文件</p>
<p>比如 nano(1.3.10) 需要满足以下依赖关系:</p>
<p>    $ dpkg-deb -f nano_1.3.10-2_i386.deb depends            //depends 为对应查询段</p>
<p>    libc6 (&gt;= 2.3.5-1), libncursesw5 (&gt;= 5.4-5)</p>
<p>当系统不能满足依赖关系, 比如不能满足里来版本, 可以通过下边的方法处理, 当然这种情况下安装的nano并不一定运行正常, 这种方法可以应用于某些软件的变通安装.</p>
<p>    $ mkdir nano //创建nano目录</p>
<p>    $ dpkg-deb -e ./nano_1.3.10-2_i386.deb ./nano/DEBIAN    //解压控制文件</p>
<p>    $ dpkg-deb -x ./nano_1.3.10-2_i386.deb ./nano           //解压程序文件</p>
<p>    $ vi ./nano/DEBIAN/control                                //修改控制信息</p>
<p>    $ dpkg-deb -b nano nano_1.3.10-2_ill.deb                //重新打包</p>
<p>注:</p>
<p>下载 .deb 包的方法</p>
<p>    * 方法一</p>
<p>      运行命令</p>
<p>          $apt-get install -d packagename</p>
<p>      或</p>
<p>          $aptitude install -d packagename</p>
<p>      将下载 .deb 文件到 //var/cache/apt/archives/ 目录</p>
<p>      如果管理系统数据库中的对应版本不低于源上的版本将不会下载<br />
    * 方法二</p>
<p>      运行命令:</p>
<p>          $aptitude download packagename</p>
<p>      将直接执行下载操作, 将 .deb 文件下载到当前目录.</p>
<p>5. 从当前系统构建 .deb 包</p>
<p>Debian软件包: dpkg-repack 可以用来重新构建已经安装到系统中的软件包为 .deb 文件. 并包含已经修改了的配置文件. 详细新息参阅:</p>
<p>dpkg-repack manpages</p>
<p>或</p>
<p>Debian GNU/Linux Anwenderhandbuch</p>
<p>对于某些需要修改配置后进行大面积安装的软件包, 可以是用 dpkg-repack 重新打包, 然后分发.</p>
<p>运行 dpkg-repack 需要 root 权限，也可以是用 fakeroot 取代 root 权限。例如:</p>
<p>    # aptitude install dpkg-repack</p>
<p>    $ fakeroot -u dpkg-repack nano<br />
    dpkg-deb: building package `nano' in `./nano_1.3.11-2_i386.deb'.</p>
<p>    user@debian:~$ fakeroot -u dpkg-repack apt<br />
    dpkg-deb: building package `apt' in `./apt_0.5.22_i386.deb'.</p>
<p>可以使用 dpkg-deb 进行验证</p>
<p>    $ dpkg-deb  -I ./nano_1.3.11-2_i386.deb<br />
     new debian package, version 2.0.<br />
     size 256488 bytes: control archive= 2749 bytes.<br />
          12 bytes,     1 lines      conffiles<br />
         857 bytes,    22 lines      control<br />
        3529 bytes,    51 lines      md5sums<br />
         613 bytes,    21 lines   *  postinst             #!/bin/sh<br />
         160 bytes,     5 lines   *  postrm               #!/bin/sh<br />
         379 bytes,    20 lines   *  preinst              #!/bin/sh<br />
         288 bytes,    14 lines   *  prerm                #!/bin/sh<br />
     Package: nano<br />
     Priority: important<br />
     Section: editors<br />
     Installed-Size: 1452<br />
     Maintainer: Jordi Mallach &lt;jordi@debian.org&gt;<br />
     Architecture: i386<br />
     Version: 1.3.11-2<br />
     Replaces: pico<br />
     Provides: editor<br />
     Depends: libc6 (&gt;= 2.3.5-1), libncursesw5 (&gt;= 5.4-5)<br />
     Suggests: spell<br />
     Conflicts: nano-tiny (&lt;= 1.0.0-1), pico<br />
     Conffiles:<br />
      /etc/nanorc 0f0e96f9c7e5ffe2338e79c9aacb9b9f<br />
     Description: free Pico clone with some new features<br />
      GNU nano is a free replacement for Pico, the default Pine editor. Pine is<br />
      copyrighted under a restrictive licence, that makes it unsuitable for<br />
      Debian's main section. GNU nano is an effort to provide a Pico-like<br />
      editor, but also includes some features that were missing in the original,<br />
      such as 'search and replace', 'goto line' or internationalization support. .<br />
      (Repackaged on Fri, 26 May 2006 22:17:52 +0800 by dpkg-repack.)<br />
     Architecture: i386</p>
<p>    tony@tony:~/doc/build_package$ </p>
<p>    $dpkg-deb -c ./nano_1.3.11-2_i386.deb<br />
    drwxr-xr-x root/root         0 2006-05-26 22:17:52 ./<br />
    drwxr-xr-x root/root         0 2006-05-26 22:17:52 ./etc/<br />
    -rw-r--r-- root/root     13611 2006-04-06 06:22:03 ./etc/nanorc<br />
    drwxr-xr-x root/root         0 2006-05-26 22:17:52 ./usr/<br />
    drwxr-xr-x root/root         0 2006-05-26 22:17:52 ./usr/share/<br />
    drwxr-xr-x root/root         0 2006-05-26 22:17:52 ./usr/share/doc/<br />
    drwxr-xr-x root/root         0 2006-05-26 22:17:52 ./usr/share/doc/nano/<br />
    -rw-r--r-- root/root      3419 2002-07-19 09:08:58 ./usr/share/doc/nano/BUGS.gz<br />
    -rw-r--r-- root/root      1847 2005-08-30 02:29:02 ./usr/share/doc/nano/AUTHORS<br />
    -rw-r--r-- root/root    102030 2006-03-30 14:34:43 ./usr/share/doc/nano/changelog.gz<br />
    -rw-r--r-- root/root      2338 2005-03-20 05:33:13 ./usr/share/doc/nano/README<br />
    -rw-r--r-- root/root      3234 2006-03-17 01:57:28 ./usr/share/doc/nano/THANKS<br />
    -rw-r--r-- root/root      2206 2005-06-08 10:28:06 ./usr/share/doc/nano/TODO<br />
    -rw-r--r-- root/root      1066 2003-03-24 21:09:26 ./usr/share/doc/nano/UPGRADE</p>
<p>    .....</p>
<p>6. 使用源提供的源代码构建 .deb 包</p>
<p>    * 下载源码包</p>
<p>      APT提供了一套简便的方法帮你获得发布版中众多程序的源代码以及创建一个.deb所需的所有文件。</p>
<p>      首先, 在 /etc/apt/sources.list 文件中加入 deb-src 条目. 详细参阅 APT HOWTO</p>
<p>      然后, 运行命令</p>
<p>          # apt-get update</p>
<p>      或</p>
<p>          # aptitude update</p>
<p>      就可以用下面的命令下载源码包：</p>
<p>          # apt-get source packagename</p>
<p>      或</p>
<p>          # aptitude source packagename</p>
<p>      通常会下载三个文件：.orig.tar.gz，.dsc 和 .diff.gz。对于 Debian 专用的软件包，最后一个文件不会下载，第一个文件的文件名中没有“orig”项。</p>
<p>      dpkg-source 读取 .dsc 文件信息，将源码包解包到 packagename-version 目录，下载下来的源码包中有一个 debian/ 目录，里面是创建 .deb 包所需的文件。</p>
<p>      例如:</p>
<p>          $ apt-get source nano<br />
          Reading package lists... Done<br />
          Building dependency tree... Done<br />
          Need to get 1199kB of source archives.<br />
          Get:1 http://ftp.us.debian.org testing/main nano 1.3.11-2 (dsc) [706B]<br />
          Get:2 http://ftp.us.debian.org testing/main nano 1.3.11-2 (tar) [1173kB]<br />
          Get:3 http://ftp.us.debian.org testing/main nano 1.3.11-2 (diff) [25.4kB]<br />
          Fetched 1199kB in 3m46s (5287B/s)<br />
          ... ...<br />
          dpkg-source: extracting nano in nano-1.3.11<br />
          dpkg-source: unpacking nano_1.3.11.orig.tar.gz<br />
          dpkg-source: applying ./nano_1.3.11-2.diff.gz</p>
<p>      做相应调整后, 在源代码的根目录 nano-1.3.11 下运行:</p>
<p>          # dpkg-buildpackage -rfakeroot -uc -b</p>
<p>      将代码编译成为软件包.</p>
<p>      想要下载的源码包自动编译成软件包，只需在命令行中加上 -b，例如:</p>
<p>          # apt-get -b source packagename</p>
<p>      请在下载包所在的目录中运行上面的命令。</p>
<p>          # dpkg -i file.deb</p>
<p>      apt-get的source命令与它的其它命令有所不同，普通用户权限就可以运行source命令，指定文件被下载到用户调用 apt-source package 命令时所处的目录中。<br />
    * 编译源码包所需的软件包</p>
<p>      通常，编译源码包时要用到某些头文件和共享库，所有的源码包的管理文件 (control file) 中都有一个域 "Build-Depends:", 域中指出了编译该源码包需要哪些附加包。</p>
<p>      如果你仅仅想检查一下编译当前包需要哪些相关软件包，可以使用 apt-cache show 命令的一个变种，它将显示软件包信息中有关 Build-Depends 的行。</p>
<p>          $ apt-cache showsrc nano|grep Build-Depends<br />
          Build-Depends: dpkg-dev (&gt;= 1.13.9), libncurses5-dev, libncursesw5-dev, libslang2-dev, debhelper (&gt;= 5.0.22), dpatch</p>
<p>      APT 提供了一个简单的方法下载这些附加包，你只需运行 apt-get build-dep package, 其中 package 就是你打算编译的源码包名称。例如：</p>
<p>          # apt-get build-dep nano<br />
          Reading package lists... Done<br />
          Building dependency tree... Done<br />
          The following NEW packages will be installed:<br />
            build-essential dpatch g++ libncursesw5-dev libslang2-dev<br />
          0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.<br />
          Need to get 986kB of archives.<br />
          After unpacking 2806kB of additional disk space will be used.<br />
          Do you want to continue [Y/n]? </p>
<p>      这些用于 nano 正确编译指定源码包的附加包将会被安装。注意这个命令不能用来搜索软件的源码包，你得另外运行 apt-get source 下载源码包。</p>
<p>7. 对现有文件打包:</p>
<p>    * 创建工作目录</p>
<p>      构建模拟根目录, 比如 fakeroot :</p>
<p>          $ mkdir fakeroot</p>
<p>    * 部署文件</p>
<p>      在 fakeroot 下构建模拟文件系统, 将欲打包文件放置到对应目录</p>
<p>      形如:</p>
<p>          tony@tony:~$ tree fakeroot/<br />
          fakeroot/<br />
          |-- DEBIAN<br />
          |   |-- control<br />
          |   `-- preinst<br />
          `-- usr<br />
              `-- share<br />
                  `-- doc<br />
                      `-- securing-debian-howto.zh-cn<br />
                          |-- ap-bind-chuser.zh-cn.html<br />
                          |-- ap-bridge-fw.zh-cn.html<br />
                          |-- ap-checklist.zh-cn.html<br />
          ... ...</p>
<p>    * 创建配置文件</p>
<p>      在 fakeroot 下创建DEBIAN目录用于放置控制文件比如:</p>
<p>      control preinst postinst prerm postrm 等, 只有 control 是必须的, 其他为可选.</p>
<p>      可以在 /var/lib/dpkg/info 目录下找到这些脚本的范例</p>
<p>      比如</p>
<p>          tony@tony:~/fakeroot/DEBIAN$ cat control</p>
<p>          Package: securing-debian-howto.zh-cn<br />
          Priority: extra<br />
          Section: doc<br />
          Maintainer: tony &lt;etony@tom.com&gt;<br />
          Architecture: all<br />
          Version: 3.0<br />
          Description: Securing Debian Manual<br />
          This manual describes the security of the Debian GNU/Linux operating system and within the Debian project. It covers some of the common tasks involved in setting up a secure user and network environment, gives information on the security tools available, steps to take before and after a compromise and also describes how security is enforced in Debian by the security team. The document includes a step by step hardening guide and within the appendix there is detailed information on how to setup an intrusion detection system and a bridge firewall with Debian GNU/Linux.</p>
<p>          tony@tony:~/fakeroot/DEBIAN$ cat preinst<br />
          #! /bin/sh</p>
<p>          echo "."<br />
          echo "."</p>
<p>          echo "Welcome to install Securing Debian HOWTO. "<br />
          echo "press any key to continue... "<br />
          read<br />
          exit 0</p>
<p>    * 生成 .deb 包</p>
<p>      在 fakeroot 目录外执行:</p>
<p>          $ dpkg -b fakeroot securing-debian-howto-zh-cn.deb</p>
<p>          dpkg-deb: building package `securing-debian-howto.zh-cn' in `securing-debian-howto-zh-cn.deb'.</p>
<p>      将会在当前目录下生成 securing-debian-howto-zh-cn.deb 包<br />
    * 检查包内容</p>
<p>      可是用以下命令检查:</p>
<p>          $ dpkg -c securing-debian-howto-zh-cn.deb</p>
<p>          $ dpkg -I securing-debian-howto-zh-cn.deb</p>
<p>8. 源代码构建</p>
<p>这次以 leafpad 为例, leafpad 的当前版本为 0.8.9</p>
<p>    * 下载程序源代码</p>
<p>          #wget http://savannah.nongnu.org/download/leafpad/leafpad-0.8.9.tar.gz   </p>
<p>    * 创建工作目录</p>
<p>          # mkdir leafpad  </p>
<p>          #mv leafpad-0.8.9.tar.gz leafpad/</p>
<p>          #cd leafpad</p>
<p>          #tar zxvf leafpad-0.8.9.tar.gz</p>
<p>          #cd leafpad-0.8.9</p>
<p>    * 安装打包环境</p>
<p>      运行一下命令,安装编译 leafpad 所需的环境</p>
<p>          # apt-get install dh-make dpkg-dev g++ patch make libc6-dev fakeroot libgtk2.0-dev cdbs debhelper pkg-config gnome-pkg-tools</p>
<p>    * Debian 初始化</p>
<p>          # dh_make -e etony@tom.com -f ../leafpad-0.8.9.tar.gz</p>
<p>          Type of package: single binary, multiple binary, library, kernel module or cdbs?<br />
           [s/m/l/k/b] s</p>
<p>          Maintainer name : tony<br />
          Email-Address   : etony@tom.com<br />
          Date            : Sun, 28 May 2006 22:38:08 +0800<br />
          Package Name    : leafpad<br />
          Version         : 0.8.9<br />
          License         : blank<br />
          Type of Package : Single<br />
          Hit &lt;enter&gt; to confirm:<br />
          Done. Please edit the files in the debian/ subdirectory now. leafpad<br />
          uses a configure script, so you probably don't have to edit the Makefiles.</p>
<p>    * 构建配置文件</p>
<p>      根据需求修改 debian/ 目录下的内容</p>
<p>      修改 changelog, control,</p>
<p>      以下为自动生成的 changelog, control 配置文件框架</p>
<p>          /leafpad/leafpad-0.8.9/debian$ cat control<br />
          Source: leafpad<br />
          Section: unknown<br />
          Priority: optional<br />
          Maintainer: tony &lt;etony@tom.com&gt;<br />
          Build-Depends: debhelper (&gt;= 4.0.0), autotools-dev<br />
          Standards-Version: 3.6.2</p>
<p>          Package: leafpad<br />
          Architecture: any<br />
          Depends: ${shlibs:Depends}, ${misc:Depends}<br />
          Description: &lt;insert up to 60 chars description&gt;<br />
           &lt;insert long description, indented with spaces&gt;</p>
<p>          /leafpad/leafpad-0.8.9/debian$ cat changelog<br />
          leafpad (0.8.9-1) unstable; urgency=low</p>
<p>            * Initial release Closes: #nnnn  (nnnn is the bug number of your ITP)</p>
<p>           -- tony &lt;etony@tom.com&gt;  Sun, 28 May 2006 22:38:08 +0800</p>
<p>      如有需要自己,根据示例文件 *.ex 生成 postinst, postrm, prerm 等脚本文件<br />
    * 构建 .deb 包</p>
<p>          # dpkg-buildpackage -rfakeroot -uc -b</p>
<p>      如果您已经多次运行了上边的命令, 也可以使用下边的命令快速构建临时 .deb 包:</p>
<p>          #fakeroot debian/rules binary</p>
<p>      将会在其上一级目录生成 leafpad_0.8.9-1_i386.deb</p>
<p>9. 参考文档</p>
<p>    * Debian 新维护人员手册<br />
    * 用Open Source工具开发软件: 软件包制作</code>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/340/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在debian/ubuntu中查询软件包的依赖关系</title>
		<link>http://wlx.westgis.ac.cn/315/</link>
		<comments>http://wlx.westgis.ac.cn/315/#comments</comments>
		<pubDate>Sun, 17 Dec 2006 15:20:20 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apt-cache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[depends]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://wlx.westgis.ac.cn/315/</guid>
		<description><![CDATA[如何在debian/ubuntu中查询某软件的依赖关系？或者该软件的反向依赖关系？
我一直以来都是在GUI界面synaptic下查询这些问题的，没想到用命令很简单就能得到结果。
1 查询依赖关系：
wlx@cngis:~$ apt-cache depends proj
proj
  依赖: libc6
  建议: proj-ps-doc
2 查询反向依赖关系：
wlx@cngis:~$ apt-cache rdepends proj
proj
Reverse Depends:
  qgis
  xastir
  thuban
  qgis
  python-mapscript
  proj-ps-doc
  postgresql-8.1-postgis
  php5-mapscript
  php4-mapscript
  perl-mapscript
  mapserver-bin
  libqgis0-dev
  libgrass
  libgdal1-1.3.1
  grass
  gpx2shp
  cgi-mapserver

简单吧，这样我就应该知道proj是轻易不能动的，是个基础包阿。
]]></description>
			<content:encoded><![CDATA[<p>如何在debian/ubuntu中查询某软件的依赖关系？或者该软件的反向依赖关系？</p>
<p>我一直以来都是在GUI界面synaptic下查询这些问题的，没想到用命令很简单就能得到结果。</p>
<p>1 查询依赖关系：</p>
<blockquote><p>wlx@cngis:~$ apt-cache depends proj<br />
proj<br />
  依赖: libc6<br />
  建议: proj-ps-doc</p></blockquote>
<p>2 查询反向依赖关系：</p>
<blockquote><p>wlx@cngis:~$ apt-cache rdepends proj<br />
proj<br />
Reverse Depends:<br />
  qgis<br />
  xastir<br />
  thuban<br />
  qgis<br />
  python-mapscript<br />
  proj-ps-doc<br />
  postgresql-8.1-postgis<br />
  php5-mapscript<br />
  php4-mapscript<br />
  perl-mapscript<br />
  mapserver-bin<br />
  libqgis0-dev<br />
  libgrass<br />
  libgdal1-1.3.1<br />
  grass<br />
  gpx2shp<br />
  cgi-mapserver
</p></blockquote>
<p>简单吧，这样我就应该知道proj是轻易不能动的，是个基础包阿。</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/315/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>转移DNS服务器</title>
		<link>http://wlx.westgis.ac.cn/297/</link>
		<comments>http://wlx.westgis.ac.cn/297/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 15:20:38 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bind9]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://wlxblog.westgis.ac.cn/297/</guid>
		<description><![CDATA[本来的服务器是安装在一个REDHAT LINUX 9的服务器上，现在需要转移到另外debian服务器上。
1、首先在debian服务器上安装bind9：
aptitude install bind9
2、拷贝旧服务器上的dns配置：
scp user@redhat:/var/named/db.westgis.ac.cn /etc/bind/
scp user@redhat:/var/named/db.210.77.68 /etc/bind/
3、设置新服务器

nano /etc/bind/name.conf.local
添加如下内容：
zone "westgis.ac.cn" {
    type master;
    file "/etc/bind/db.westgis.ac.cn";
};
zone "68.77.210.in-addr.arpa" {
        type master;
        file "db.210.77.68";
};

4、IP地址转移
停掉旧服务器上的IP，在新服务器上添加IP。
这一点，还是DEBIAN的服务器要好用的多，直接修改/etc/network/interface文件的内容就可以了，而redhat上感觉就复杂一些。
或许，是因为我DEBIAN用得比REDHAT要好？
5、启用新DNS
/etc/init.d/bind9 restart
]]></description>
			<content:encoded><![CDATA[<p>本来的服务器是安装在一个REDHAT LINUX 9的服务器上，现在需要转移到另外debian服务器上。<span id="more-297"></span></p>
<p>1、首先在debian服务器上安装bind9：</p>
<blockquote><p>aptitude install bind9</p></blockquote>
<p>2、拷贝旧服务器上的dns配置：</p>
<blockquote><p>scp user@redhat:/var/named/db.westgis.ac.cn /etc/bind/<br />
scp user@redhat:/var/named/db.210.77.68 /etc/bind/</p></blockquote>
<p>3、设置新服务器</p>
<blockquote><p>
nano /etc/bind/name.conf.local</p></blockquote>
<p>添加如下内容：</p>
<blockquote><p>zone "westgis.ac.cn" {<br />
    type master;<br />
    file "/etc/bind/db.westgis.ac.cn";<br />
};<br />
zone "68.77.210.in-addr.arpa" {<br />
        type master;<br />
        file "db.210.77.68";<br />
};</p>
</blockquote>
<p>4、IP地址转移<br />
停掉旧服务器上的IP，在新服务器上添加IP。<br />
这一点，还是DEBIAN的服务器要好用的多，直接修改/etc/network/interface文件的内容就可以了，而redhat上感觉就复杂一些。<br />
或许，是因为我DEBIAN用得比REDHAT要好？<br />
5、启用新DNS</p>
<blockquote><p>/etc/init.d/bind9 restart</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/297/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bibus的安装</title>
		<link>http://wlx.westgis.ac.cn/287/</link>
		<comments>http://wlx.westgis.ac.cn/287/#comments</comments>
		<pubDate>Mon, 04 Dec 2006 08:44:43 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bibus]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[locale]]></category>
		<category><![CDATA[ubuntu-edgy]]></category>
		<category><![CDATA[中文]]></category>

		<guid isPermaLink="false">http://wlxblog.westgis.ac.cn/287/</guid>
		<description><![CDATA[看到别人使用bibus与openoffice制作的论文模板，感觉很好用。
原来一直想找一个linux下的文献管理软件，但试验了很多，感觉都不好用，或者不太适合。
又：听说openoffice 3将会集成文献管理功能，或许到时会好的多。
首先，可以直接把bibus的repository挂上：
sudo nano /etc/apt/source.list
#add repos
deb http://switch.dl.sourceforge.net/sourceforge/bibus-biblio ./
sudo aptitude update
sudo aptitude install python-sqlite2 bibus bibus-doc-en
其网站声明支持debian testing(估计指debian sarge)和ubuntu breezy，我在ubuntu edgy下也能使用。
但是其版本好像稍微落后，而且我看官方中有提供中文支持，但是安装后没有中文locale显示，但在文献中使用中文没有问题。
因此，就直接从CVS中取出了最新版本，打算在本地编译deb包，来看看有没有什么变化。
编译完成后，发现仍然无法显示中文locale。
浏览代码后，发现是其提供的locale有问题。
删除了locale/cn目录，修改locale/zh_cn为locale/zh_CN。（因为在ubuntu edgy下，中文默认locale是zh_CN）。
然后有重新编译了po文件：
msgfmt bibus.po -o bibus.mo
当然，其中翻译不满意的，可以运行poedit再来修改，呵呵。
最终就可以打包了：
dch -i
dpkg-buildpackage -rfakeroot
水木的MetalslugX还作了一个CNKI的插件，但我使用后发现好像不支持现在的CNKI了，或许，近期CNKI改版过？还有一个中文"...等"的插件，这个我没使用。
]]></description>
			<content:encoded><![CDATA[<p>看到别人使用bibus与openoffice制作的论文模板，感觉很好用。<br />
原来一直想找一个linux下的文献管理软件，但试验了很多，感觉都不好用，或者不太适合。<br />
又：听说openoffice 3将会集成文献管理功能，或许到时会好的多。</p>
<p>首先，可以直接把bibus的repository挂上：</p>
<blockquote><p>sudo nano /etc/apt/source.list<br />
#add repos<br />
deb http://switch.dl.sourceforge.net/sourceforge/bibus-biblio ./<br />
sudo aptitude update<br />
sudo aptitude install python-sqlite2 bibus bibus-doc-en</p></blockquote>
<p>其网站声明支持debian testing(估计指debian sarge)和ubuntu breezy，我在ubuntu edgy下也能使用。<br />
但是其版本好像稍微落后，而且我看官方中有提供中文支持，但是安装后没有中文locale显示，但在文献中使用中文没有问题。<br />
因此，就直接从CVS中取出了最新版本，打算在本地编译deb包，来看看有没有什么变化。<br />
编译完成后，发现仍然无法显示中文locale。<br />
浏览代码后，发现是其提供的locale有问题。<br />
删除了locale/cn目录，修改locale/zh_cn为locale/zh_CN。（因为在ubuntu edgy下，中文默认locale是zh_CN）。<br />
然后有重新编译了po文件：</p>
<blockquote><p>msgfmt bibus.po -o bibus.mo</p></blockquote>
<p>当然，其中翻译不满意的，可以运行poedit再来修改，呵呵。<br />
最终就可以打包了：</p>
<blockquote><p>dch -i<br />
dpkg-buildpackage -rfakeroot</p></blockquote>
<p>水木的MetalslugX<a href="http://www.newsmth.net/bbstcon.php?board=Python&#038;gid=27980">还作了一个CNKI的插件</a>，但我使用后发现好像不支持现在的CNKI了，或许，近期CNKI改版过？还有一个中文"...等"的插件，这个我没使用。</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/287/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debian testing上安装oracle 10g</title>
		<link>http://wlx.westgis.ac.cn/261/</link>
		<comments>http://wlx.westgis.ac.cn/261/#comments</comments>
		<pubDate>Mon, 16 Oct 2006 09:31:38 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://wlxblog.westgis.ac.cn/261/</guid>
		<description><![CDATA[安装10g express一直有问题，决定安装oracle 10g版本。
这个安装要比xe版复杂得多。
一、安装前的准备
1.硬件要求
Oracle建议内存为512MB或以上,至少1G交换分区，并且需要400MB的临时目录空间。
使用以下的命令查看你的内存和交换分区大小：
# grep MemTotal /proc/meminfo
# grep SwapTotal /proc/meminfo
你可以使用以下方法添加临时交换分区：
su - root
dd if=/dev/zero of=tmpswap bs=1k count=900000
chmod 600 tmpswap
mkswap tmpswap
swapon tmpswap
可以通过以下命令查看临时空间大小：
#df /tmp
可以自己新建临时目录，安装完后再删除
#su - root
#mkdir /opt/tmp
#chown root.root /opt/tmp/
# chmod 1777 /opt/tmp
# echo TEMP
# export TEMP=/opt/tmp
# export TEMPDIR=/opt/tmp
对硬盘空间大小的限制，建议预留3G空间。
2.系统参数调整
修改/etc/sysctl.conf，添加
＃我的机器只有1G内存
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
执行
#/sbin/sysctl -p
设置shell限制,在/etc/security/limits.conf添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle [...]]]></description>
			<content:encoded><![CDATA[<p>安装10g express一直有问题，决定安装oracle 10g版本。<br />
这个安装要比xe版复杂得多。</p>
<p>一、安装前的准备</p>
<p>1.硬件要求</p>
<p>Oracle建议内存为512MB或以上,至少1G交换分区，并且需要400MB的临时目录空间。<br />
使用以下的命令查看你的内存和交换分区大小：</p>
<p># grep MemTotal /proc/meminfo<br />
# grep SwapTotal /proc/meminfo</p>
<p>你可以使用以下方法添加临时交换分区：</p>
<p>su - root<br />
dd if=/dev/zero of=tmpswap bs=1k count=900000<br />
chmod 600 tmpswap<br />
mkswap tmpswap<br />
swapon tmpswap</p>
<p>可以通过以下命令查看临时空间大小：</p>
<p>#df /tmp</p>
<p>可以自己新建临时目录，安装完后再删除</p>
<p>#su - root<br />
#mkdir /opt/tmp<br />
#chown root.root /opt/tmp/<br />
# chmod 1777 /opt/tmp<br />
# echo TEMP<br />
# export TEMP=/opt/tmp<br />
# export TEMPDIR=/opt/tmp</p>
<p>对硬盘空间大小的限制，建议预留3G空间。</p>
<p>2.系统参数调整</p>
<p>修改/etc/sysctl.conf，添加</p>
<p>＃我的机器只有1G内存<br />
kernel.shmmax = 1073741824<br />
kernel.shmmni = 4096<br />
kernel.sem = 250 32000 100 128<br />
fs.file-max = 65536<br />
net.ipv4.ip_local_port_range = 1024 65000</p>
<p>执行<br />
#/sbin/sysctl -p</p>
<p>设置shell限制,在/etc/security/limits.conf添加<br />
oracle soft nproc 2047<br />
oracle hard nproc 16384<br />
oracle soft nofile 1024<br />
oracle hard nofile 65536</p>
<p>修改login设置，修改 /etc/pam.d/login，添加<br />
session required /lib/security/pam_limits.so</p>
<p>在/etc/profile中添加以下语句：</p>
<p>if [ $USER = "oracle" ]; then<br />
if [ $SHELL = "/bin/ksh" ]; then<br />
ulimit -p 16384<br />
ulimit -n 65536<br />
else<br />
ulimit -u 16384 -n 65536<br />
fi<br />
fi</p>
<p>3、安装设置</p>
<p>确保你已经安装了下列软件</p>
<p>sudo apt-get install gcc make binutils lesstif2 libc6 libc6-dev rpm libmotif3 libaio1 libstdc++5 gawk<br />
确保你的系统中有以下组和用户，方法：</p>
<p>#grep dba /etc/group<br />
#grep oinstall /etc/group<br />
#grep nobody /etc/group</p>
<p>#id oracle<br />
#id nobody</p>
<p>切换到root，添加oralce帐户</p>
<p>#su - root<br />
#groupadd dba # group of users to be granted SYSDBA system privilege<br />
#groupadd oinstall # group owner of Oracle files<br />
#useradd -c "Oracle software owner" -g oinstall -G dba -d /opt/oracle oracle<br />
#passwd oracle<br />
输入oracle密码</p>
<p>debian中需要额外的添加nobody用户组：<br />
#groupadd nobody<br />
系统nogroup组中已经有nobody用户，把nobody用户添加到新建的nobody组中，<br />
#usermod -G nobody nobody</p>
<p>建立oracle目录<br />
#su root<br />
#mkdir /opt/oracle<br />
#chown -R oralce.oinstall /opt/oracle<br />
mkdir -p /u01/app<br />
chown -R  oracle.oinstall /u01/app<br />
debian需要额外的做以下操作：<br />
# ln -s /usr/bin/awk /bin/awk<br />
# ln -s /usr/bin/rpm /bin/rpm<br />
# ln -s /usr/bin/basename /bin/basename<br />
# ln -s /etc /etc/rc.d</p>
<p>模拟redhat-3进行安装，新建一个文件/etc/redhat-release,写入以下内容：<br />
Red Hat Enterprise Linux AS release 3 (Taroon)</p>
<p>二、开始安装</p>
<p>你可以从http://mirrors.cn99.com上下载oracle 10g,按以下方法进行解压：<br />
su - oracle<br />
wget http://mirrors.cn99.com/oracle/10g/10201_database_linux32.zip<br />
unzip 10210_database_linux32.zip<br />
若是远程连接到服务器，则需要这样操作：<br />
ssh -X oracle@your_server_ip<br />
export ORACLE_BASE=/u01/app<br />
export ORACLE_SID=orcl #你可以自己命名sid<br />
#确保此时环境中没有ORACLE_HOME 和TNS_ADMIN<br />
$ unset ORACLE_HOME<br />
$ unset TNS_ADMIN</p>
<p>可以将这些写进.bash_profile<br />
export ORACLE_BASE=/opt/oracle<br />
export ORACLE_SID=oralin<br />
unset ORACLE_HOME<br />
unset TNS_ADMIN</p>
<p>umask 022</p>
<p>执行<br />
cd database<br />
LC_ALL=en_US ./runInstaller</p>
<p>三、安装后</p>
<p>oracle启动脚本/etc/init.d/oracle</p>
<p>su<br />
nano /etc/init.d/oracle</p>
<blockquote><p><code >#!/bin/bash<br />
#<br />
# /etc/init.d/oracledb<br />
#<br />
# Run-level Startup script for the Oracle Instance, Listener, and<br />
# Web Interface</p>
<p>export ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1/<br />
export ORACLE_SID=orcl<br />
export PATH=$PATH:$ORACLE_HOME/bin</p>
<p>ORA_OWNR="oracle"</p>
<p># if the executables do not exist -- display error</p>
<p>if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]<br />
then<br />
        echo "Oracle startup: cannot start"<br />
        exit 1<br />
fi</p>
<p># depending on parameter -- startup, shutdown, restart<br />
# of the instance and listener or usage display</p>
<p>case "$1" in<br />
    start)<br />
        # Oracle listener and instance startup<br />
        echo -n "Starting Oracle: "<br />
        su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"<br />
        su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart<br />
        touch /var/lock/oracle</p>
<p>        su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"<br />
        su $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl start"<br />
        echo "OK"<br />
        ;;<br />
    stop)<br />
        # Oracle listener and instance shutdown<br />
        echo -n "Shutdown Oracle: "<br />
        su  - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl stop"<br />
        su  - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"<br />
        su  - $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"<br />
        su  - $ORA_OWNR -c $ORACLE_HOME/bin/dbshut<br />
        rm -f /var/lock/oracle</p>
<p>        echo "OK"<br />
        ;;<br />
    reload|restart)<br />
        $0 stop<br />
        $0 start<br />
        ;;<br />
    *)<br />
        echo "Usage: `basename $0` start|stop|restart|reload"<br />
        exit 1<br />
esac<br />
exit 0</code></p></blockquote>
<p>chmod 755 /etc/init.d/oracledb<br />
update-rc.d oracledb defaults 99</p>
<p>可以通过/etc/init.d/oracle start来启动oracle.</p>
<p>参考：<br />
1 http://sysop.com.cn/system5504,1.html<br />
2 https://help.ubuntu.com/community/Oracle10g<br />
3 http://mirrors.cn99.com/oracle/10g/</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/261/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>dbstart无法启动</title>
		<link>http://wlx.westgis.ac.cn/262/</link>
		<comments>http://wlx.westgis.ac.cn/262/#comments</comments>
		<pubDate>Tue, 10 Oct 2006 13:43:02 +0000</pubDate>
		<dc:creator>wlx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[dbstart]]></category>
		<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://wlxblog.westgis.ac.cn/262/</guid>
		<description><![CDATA[安装完成后一直有问题，
su oracle
dbstart
提示：
"Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr"
解决办法：
To solve this problem please follow the steps.
Step 1 Edit $ORACLE_HOME/bin/dbstart
Step 2 Goto line 78
Step 3 Replace the line with
ORACLE_HOME_LISTNER=$ORACLE_HOME
Step 4 Save and exit the editor.
Step 5 Now reexecute the dbstart 
见：http://forums.oracle.com/forums/thread.jspa?messageID=1094708&#1094708
]]></description>
			<content:encoded><![CDATA[<p>安装完成后一直有问题，<br />
su oracle<br />
dbstart<br />
提示：<br />
"Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr"<br />
解决办法：</p>
<blockquote><p>To solve this problem please follow the steps.</p>
<p>Step 1 Edit $ORACLE_HOME/bin/dbstart<br />
Step 2 Goto line 78<br />
Step 3 Replace the line with<br />
ORACLE_HOME_LISTNER=$ORACLE_HOME<br />
Step 4 Save and exit the editor.<br />
Step 5 Now reexecute the dbstart </p></blockquote>
<p>见：http://forums.oracle.com/forums/thread.jspa?messageID=1094708&#1094708</p>
]]></content:encoded>
			<wfw:commentRss>http://wlx.westgis.ac.cn/262/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
