<?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>奔向远方 &#187; 服务器</title>
	<atom:link href="http://www.tisswb.com/archives/category/server/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tisswb.com</link>
	<description>结婚开始倒计时了，高兴~</description>
	<lastBuildDate>Tue, 19 Jul 2011 09:30:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>php编译参数的含义</title>
		<link>http://www.tisswb.com/archives/576.html</link>
		<comments>http://www.tisswb.com/archives/576.html#comments</comments>
		<pubDate>Sat, 31 Jul 2010 16:42:44 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=576</guid>
		<description><![CDATA[今天整理编译php的时候的参数，在网上搜集了一些关于configure参数的资料：
./configure
&#8211;prefix=/usr/local/php                                   php 安装目录
&#8211;with-apxs2=/usr/local/apache/bin/apxs
&#8211;with-config-file-path=/usr/local/php/etc               指定php.ini位置
&#8211;with-mysql=/usr/local/mysql                        mysql安装目录，对mysql的支持
&#8211;with-mysqli=/usr/local/mysql/bin/mysql_config            mysqli文件目录,优化支持
<span class="readmore"><a href="http://www.tisswb.com/archives/576.html" title="php编译参数的含义" target="_blank">阅读全文——共2772字</a></span>]]></description>
			<content:encoded><![CDATA[<p>今天整理编译php的时候的参数，在网上搜集了一些关于configure参数的资料：</p>
<p>./configure</p>
<p>&#8211;prefix=/usr/local/php                                   <a target="_self"><strong>php</strong> </a>安装目录<br />
&#8211;with-apxs2=/usr/local/apache/bin/apxs<br />
&#8211;with-config-file-path=/usr/local/php/etc               指定php.ini位置<br />
&#8211;with-mysql=/usr/local/mysql                        mysql安装目录，对mysql的支持<br />
&#8211;with-mysqli=/usr/local/mysql/bin/mysql_config            mysqli文件目录,优化支持<br />
&#8211;enable-safe-mode                              打开安全模式<br />
&#8211;enable-ftp                                 打开ftp的支持<br />
&#8211;enable-zip                                 打开对zip的支持<br />
&#8211;with-bz2                                    打开对bz2文件的支持                        <br />
&#8211;with-jpeg-dir                                 打开对jpeg图片的支持<br />
&#8211;with-png-dir                                 打开对png图片的支持<br />
&#8211;with-freetype-dir                              打开对freetype字体库的支持<br />
&#8211;without-iconv                                 关闭iconv函数，种字符集间的转换<br />
&#8211;with-libxml-dir                                 打开libxml2库的支持<br />
&#8211;with-xmlrpc                                 打开xml-rpc的c语言<br />
&#8211;with-zlib-dir                                 打开zlib库的支持<br />
&#8211;with-gd                                    打开gd库的支持<br />
&#8211;enable-gd-native-ttf                           支持TrueType字符串函数库<br />
&#8211;with-curl                                    打开curl浏览工具的支持<br />
&#8211;with-curlwrappers                              运用curl工具打开url流<br />
&#8211;with-ttf                                    打开freetype1.*的支持，可以不加了<br />
&#8211;with-xsl                                     打开XSLT 文件支持，扩展了libxml2库 ，需要libxslt软件<br />
&#8211;with-gettext                                 打开gnu 的gettext 支持，编码库用到<br />
&#8211;with-pear                      打开pear命令的支持，php扩展用的<br />
&#8211;enable-calendar                  打开日历扩展功能<br />
&#8211;enable-mbstring                  多字节，字符串的支持<br />
&#8211;enable-bcmath                  打开图片大小调整,用到zabbix监控的时候用到了这个模块<br />
&#8211;enable-sockets                  打开 sockets 支持<br />
&#8211;enable-exif                      图片的元数据支持<br />
&#8211;enable-magic-quotes               魔术引用的支持<br />
&#8211;disable-rpath                     关闭额外的运行库文件<br />
&#8211;disable-debug                  关闭调试模式<br />
&#8211;with-mime-magic=/usr/share/file/magic.mime      魔术头文件位置</p>
<p>cgi方式安装才用的<a target="_self"><strong>参数</strong> </a><br />
&#8211;enable-fpm                     打上php-fpm 补丁后才有这个参数，cgi方式安装的启动程序<br />
&#8211;enable-fastcgi                  支持fastcgi方式启动php<br />
&#8211;enable-force-cgi-redirect             同上 ,帮助里没有解释<br />
&#8211;with-ncurses                     支持ncurses 屏幕绘制以及基于文本终端的图形互动功能的动态库<br />
&#8211;enable-pcntl                     freeTDS需要用到的，可能是链接mssql 才用到</p>
<p>mhash和mcrypt算法的扩展<br />
&#8211;with-mcrypt                     算法<br />
&#8211;with-mhash                     算法</p>
<p>&#8211;with-gmp<br />
&#8211;enable-inline-optimization<br />
&#8211;with-openssl                     openssl的支持，加密传输时用到的<br />
&#8211;enable-dbase<br />
&#8211;with-pcre-dir=/usr/local/bin/pcre-config      perl的正则库案安装位置<br />
&#8211;disable-dmalloc<br />
&#8211;with-gdbm                     dba的gdbm支持<br />
&#8211;enable-sigchild<br />
&#8211;enable-sysvsem<br />
&#8211;enable-sysvshm<br />
&#8211;enable-zend-multibyte               支持zend的多字节<br />
&#8211;enable-mbregex<br />
&#8211;enable-wddx<br />
&#8211;enable-shmop<br />
&#8211;enable-soap</p>
<p>来源：<a href="http://nedvedheqing.javaeye.com/blog/545632">http://nedvedheqing.javaeye.com/blog/545632</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/576.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>编译安装LNMP(Linux+Nginx+Mysql+PHP+Memcache)服务器</title>
		<link>http://www.tisswb.com/archives/564.html</link>
		<comments>http://www.tisswb.com/archives/564.html#comments</comments>
		<pubDate>Thu, 29 Jul 2010 14:16:04 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=564</guid>
		<description><![CDATA[最近学习了一段时间的LNMP和Nginx的负载均衡方面的内容，并且试着自己编译了几个生产环境，使用效果还不错，今天首先把这次安装配置的流水账先写下来，等消化一下具体内容，在好好写一份详细的LNMP编译安装配置的文章：
一、系统安装升级
1.最小化安装CentOS（最小化安装CentOS可以参考http://www.tisswb.cn/archives/519.html）
2.更新源更改为搜狐的源：mirrors.sohu.com
3.yum update
4.服务器基本配置
yum install setuptool ntsysv ntp vixie-cron crontabs microcode_ctl wget irqbalance vim-enhanced
5.执行setup命令
5.1 关闭iptables和selinux
5.2 仅仅开启crond irqbalance microcode_ctl network sshd syslog
<span class="readmore"><a href="http://www.tisswb.com/archives/564.html" title="编译安装LNMP(Linux+Nginx+Mysql+PHP+Memcache)服务器" target="_blank">阅读全文——共16020字</a></span>]]></description>
			<content:encoded><![CDATA[<p>最近学习了一段时间的LNMP和Nginx的负载均衡方面的内容，并且试着自己编译了几个生产环境，使用效果还不错，今天首先把这次安装配置的流水账先写下来，等消化一下具体内容，在好好写一份详细的LNMP编译安装配置的文章：</p>
<p>一、系统安装升级<br />
1.最小化安装CentOS（最小化安装CentOS可以参考<a href="http://www.tisswb.cn/archives/519.html">http://www.tisswb.cn/archives/519.html</a>）<br />
2.更新源更改为搜狐的源：mirrors.sohu.com<br />
3.yum update<br />
4.服务器基本配置<br />
<code>yum install setuptool ntsysv ntp vixie-cron crontabs microcode_ctl wget irqbalance vim-enhanced<br />
</code>5.执行setup命令<br />
5.1 关闭iptables和selinux<br />
5.2 仅仅开启crond irqbalance microcode_ctl network sshd syslog</p>
<p>二、LNMP环境搭建<br />
1.配置编译需要的环境<br />
yum -y install autoconf bzip2 bzip2-devel curl curl-devel e2fsprogs e2fsprogs-devel freetype freetype-devel gcc gcc-c++ gcc-g77 gd gd-devel glib2 glib2-devel glibc glibc-devel krb5 krb5-devel libevent libevent-devel libidn libidn-devel libjpeg libjpeg-devel libpng libpng10 libpng10-devel libpng-devel libtool libtool-libs libxml2 libxml2-devel make ncurses ncurses-devel nss_ldap openldap openldap-clients openldap-devel openldap-servers openssl openssl-devel patch pspell-devel zlib zlib-devel<br />
2.下载所需要安装的软件<br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/nginx/nginx-0.8.36.tar.gz">http://blog.s135.com/soft/linux/nginx_php/nginx/nginx-0.8.36.tar.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/php/php-5.2.13.tar.gz">http://blog.s135.com/soft/linux/nginx_php/php/php-5.2.13.tar.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.13-fpm-0.5.13.diff.gz">http://blog.s135.com/soft/linux/nginx_php/phpfpm/php-5.2.13-fpm-0.5.13.diff.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.38.tar.gz">http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.1.38.tar.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz">http://blog.s135.com/soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz">http://blog.s135.com/soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz">http://blog.s135.com/soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz">http://blog.s135.com/soft/linux/nginx_php/memcache/memcache-2.2.5.tgz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz">http://blog.s135.com/soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/pcre/pcre-8.01.tar.gz">http://blog.s135.com/soft/linux/nginx_php/pcre/pcre-8.01.tar.gz</a><br />
wget <a href="http://blog.s135.com/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.6.tar.bz2">http://blog.s135.com/soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.6.tar.bz2</a><br />
3.安装PHP 5.2.13（FastCGI模式）<br />
3.1编译安装PHP 5.2.13所需的支持库<br />
tar zxvf libiconv-1.13.tar.gz<br />
cd libiconv-1.13/<br />
./configure &#8211;prefix=/usr/local<br />
make<br />
make install<br />
cd ../<br />
tar zxvf libmcrypt-2.5.8.tar.gz<br />
cd libmcrypt-2.5.8/<br />
./configure<br />
make<br />
make install<br />
/sbin/ldconfig<br />
cd libltdl/<br />
./configure &#8211;enable-ltdl-install<br />
make<br />
make install<br />
cd ../../<br />
tar zxvf mhash-0.9.9.9.tar.gz<br />
cd mhash-0.9.9.9/<br />
./configure<br />
make<br />
make install<br />
cd ../<br />
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la<br />
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so<br />
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4<br />
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8<br />
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a<br />
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la<br />
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so<br />
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2<br />
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1<br />
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config<br />
tar zxvf mcrypt-2.6.8.tar.gz<br />
cd mcrypt-2.6.8/<br />
/sbin/ldconfig<br />
./configure<br />
make<br />
make install<br />
cd ../<br />
3.2编译安装MySQL 5.1.38<br />
/usr/sbin/groupadd mysql<br />
/usr/sbin/useradd -g mysql mysql<br />
tar zxvf mysql-5.1.38.tar.gz<br />
cd mysql-5.1.38/<br />
./configure &#8211;prefix=/usr/local/webserver/mysql/ &#8211;enable-assembler &#8211;with-extra-charsets=complex &#8211;enable-thread-safe-client &#8211;with-big-tables &#8211;with-readline &#8211;with-ssl &#8211;with-embedded-server &#8211;enable-local-infile &#8211;with-plugins=innobase<br />
make &amp;&amp; make install<br />
chmod +w /usr/local/webserver/mysql<br />
chown -R mysql:mysql /usr/local/webserver/mysql<br />
cd ../<br />
如果你想在这台服务器上运行MySQL数据库，则执行以下两步。如果你只是希望让PHP支持MySQL扩展库，能够连接其他服务器上的MySQL数据库，那么，以下两步无需执行。<br />
3.2.1创建MySQL数据库存放目录<br />
mkdir -p /data0/mysql/3306/data/<br />
chown -R mysql:mysql /data0/mysql/<br />
3.2.2以mysql用户帐号的身份建立数据表<br />
/usr/local/webserver/mysql/bin/mysql_install_db &#8211;basedir=/usr/local/webserver/mysql &#8211;datadir=/data0/mysql/3306/data &#8211;user=mysql<br />
3.2.3创建my.cnf配置文件<br />
[client]<br />
default-character-set = utf8<br />
port    = 3306<br />
socket  = /tmp/mysql.sock</p>
<p>[mysql]<br />
#prompt=&#8221;(\u:blog.s135.com:)[\d]&gt; &#8221;<br />
no-auto-rehash</p>
<p>[mysqld]<br />
#default-character-set = utf8<br />
user    = mysql<br />
port    = 3306<br />
socket  = /tmp/mysql.sock<br />
basedir = /usr/local/webserver/mysql<br />
datadir = /data0/mysql/3306/data<br />
open_files_limit    = 10240<br />
back_log = 600<br />
max_connections = 3000<br />
max_connect_errors = 6000<br />
table_cache = 614<br />
external-locking = FALSE<br />
max_allowed_packet = 32M<br />
sort_buffer_size = 2M<br />
join_buffer_size = 2M<br />
thread_cache_size = 300<br />
thread_concurrency = 8<br />
query_cache_size = 32M<br />
query_cache_limit = 2M<br />
query_cache_min_res_unit = 2k<br />
default-storage-engine = MyISAM<br />
default_table_type = MyISAM<br />
thread_stack = 192K<br />
transaction_isolation = READ-COMMITTED<br />
tmp_table_size = 246M<br />
max_heap_table_size = 246M<br />
long_query_time = 1<br />
log_long_format<br />
log-bin = /data0/mysql/3306/binlog<br />
binlog_cache_size = 4M<br />
binlog_format = MIXED<br />
max_binlog_cache_size = 8M<br />
max_binlog_size = 512M<br />
expire_logs_days = 7<br />
key_buffer_size = 256M<br />
read_buffer_size = 1M<br />
read_rnd_buffer_size = 16M<br />
bulk_insert_buffer_size = 64M<br />
myisam_sort_buffer_size = 128M<br />
myisam_max_sort_file_size = 10G<br />
myisam_max_extra_sort_file_size = 10G<br />
myisam_repair_threads = 1<br />
myisam_recover</p>
<p>skip-name-resolve<br />
master-connect-retry = 10<br />
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396</p>
<p>server-id = 1</p>
<p>innodb_additional_mem_pool_size = 16M<br />
innodb_buffer_pool_size = 2048M<br />
innodb_data_file_path = ibdata1:1024M:autoextend<br />
innodb_file_io_threads = 4<br />
innodb_thread_concurrency = 8<br />
innodb_flush_log_at_trx_commit = 2<br />
innodb_log_buffer_size = 16M<br />
innodb_log_file_size = 128M<br />
innodb_log_files_in_group = 3<br />
innodb_max_dirty_pages_pct = 90<br />
innodb_lock_wait_timeout = 120<br />
innodb_file_per_table = 0<br />
[mysqldump]<br />
quick<br />
max_allowed_packet = 32M<br />
3.2.4创建管理MySQL数据库的shell脚本：<br />
vi /data0/mysql/3306/mysql</p>
<p>#!/bin/sh</p>
<p>mysql_port=3306<br />
mysql_username=&#8221;admin&#8221;<br />
mysql_password=&#8221;asdasdasd&#8221;</p>
<p>function_start_mysql()<br />
{<br />
printf &#8220;Starting MySQL&#8230;\n&#8221;<br />
/bin/sh /usr/local/webserver/mysql/bin/mysqld_safe &#8211;defaults-file=/data0/mysql/${mysql_port}/my.cnf 2&gt;&amp;1 &gt; /dev/null &amp;<br />
}</p>
<p>function_stop_mysql()<br />
{<br />
printf &#8220;Stoping MySQL&#8230;\n&#8221;<br />
/usr/local/webserver/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -S /tmp/mysql.sock shutdown<br />
}</p>
<p>function_restart_mysql()<br />
{<br />
printf &#8220;Restarting MySQL&#8230;\n&#8221;<br />
function_stop_mysql<br />
sleep 5<br />
function_start_mysql<br />
}</p>
<p>function_kill_mysql()<br />
{<br />
kill -9 $(ps -ef | grep &#8216;bin/mysqld_safe&#8217; | grep ${mysql_port} | awk &#8216;{printf $2}&#8217;)<br />
kill -9 $(ps -ef | grep &#8216;libexec/mysqld&#8217; | grep ${mysql_port} | awk &#8216;{printf $2}&#8217;)<br />
}</p>
<p>if [ "$1" = "start" ]; then<br />
function_start_mysql<br />
elif [ "$1" = "stop" ]; then<br />
function_stop_mysql<br />
elif [ "$1" = "restart" ]; then<br />
function_restart_mysql<br />
elif [ "$1" = "kill" ]; then<br />
function_kill_mysql<br />
else<br />
printf &#8220;Usage: /data0/mysql/${mysql_port}/mysql {start|stop|restart|kill}\n&#8221;<br />
fi<br />
3.2.5 赋予shell脚本可执行权限<br />
chmod +x /data0/mysql/3306/mysql<br />
3.2.6 启动MySQL<br />
/data0/mysql/3306/mysql start<br />
3.2.7 通过命令行登录管理MySQL服务器（提示输入密码时直接回车）：<br />
/usr/local/webserver/mysql/bin/mysql -u root -p -S /tmp/mysql.sock<br />
3.2.8 输入以下SQL语句，创建一个具有root权限的用户（admin）和密码（asdasdasd）：<br />
GRANT ALL PRIVILEGES ON *.* TO &#8216;admin&#8217;@'localhost&#8217; IDENTIFIED BY &#8216;asdasdasd&#8217;;<br />
GRANT ALL PRIVILEGES ON *.* TO &#8216;admin&#8217;@&#8217;127.0.0.1&#8242; IDENTIFIED BY &#8216;asdasdasd&#8217;;<br />
GRANT ALL PRIVILEGES ON *.* TO &#8216;root&#8217;@&#8217;192.168.%.%&#8217; IDENTIFIED BY &#8216;asdasdasd&#8217;;<br />
3.2.9 停止MySQL<br />
/data0/mysql/3306/mysql stop<br />
3.3 编译安装PHP（FastCGI模式）<br />
tar zxvf php-5.2.13.tar.gz<br />
gzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.13 -p1<br />
cd php-5.2.13/<br />
./configure &#8211;prefix=/usr/local/webserver/php &#8211;with-config-file-path=/usr/local/webserver/php/etc &#8211;with-mysql=/usr/local/webserver/mysql &#8211;with-mysqli=/usr/local/webserver/mysql/bin/mysql_config &#8211;with-iconv-dir=/usr/local &#8211;with-freetype-dir &#8211;with-jpeg-dir &#8211;with-png-dir &#8211;with-zlib &#8211;with-libxml-dir=/usr &#8211;enable-xml &#8211;disable-rpath &#8211;enable-discard-path &#8211;enable-safe-mode &#8211;enable-bcmath &#8211;enable-shmop &#8211;enable-sysvsem &#8211;enable-inline-optimization &#8211;with-curl &#8211;with-curlwrappers &#8211;enable-mbregex &#8211;enable-fastcgi &#8211;enable-fpm &#8211;enable-force-cgi-redirect &#8211;enable-mbstring &#8211;with-mcrypt &#8211;with-gd &#8211;enable-gd-native-ttf &#8211;with-openssl &#8211;with-mhash &#8211;enable-pcntl &#8211;enable-sockets &#8211;with-ldap &#8211;with-ldap-sasl &#8211;with-xmlrpc &#8211;enable-zip &#8211;enable-soap<br />
make ZEND_EXTRA_LIBS=&#8217;-liconv&#8217;<br />
make install<br />
cp php.ini-dist /usr/local/webserver/php/etc/php.ini<br />
cd ../<br />
3.4 编译安装PHP5扩展模块<br />
tar zxvf memcache-2.2.5.tgz<br />
cd memcache-2.2.5/<br />
/usr/local/webserver/php/bin/phpize<br />
./configure &#8211;with-php-config=/usr/local/webserver/php/bin/php-config<br />
make<br />
make install<br />
cd ../</p>
<p>tar jxvf eaccelerator-0.9.6.tar.bz2<br />
cd eaccelerator-0.9.6/<br />
/usr/local/webserver/php/bin/phpize<br />
./configure &#8211;enable-eaccelerator=shared &#8211;with-php-config=/usr/local/webserver/php/bin/php-config<br />
make<br />
make install<br />
cd ../<br />
3.5 修改php.ini文件<br />
手工修改：查找/usr/local/webserver/php/etc/php.ini中的extension_dir = &#8220;./&#8221;<br />
修改为extension_dir = &#8220;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/&#8221;<br />
并在此行后增加以下几行，然后保存：<br />
extension = &#8220;memcache.so&#8221;<br />
再查找output_buffering = Off<br />
修改为output_buffering = On<br />
3.6 配置eAccelerator加速PHP<br />
mkdir -p /usr/local/webserver/eaccelerator_cache<br />
vi /usr/local/webserver/php/etc/php.ini<br />
按shift+g键跳到配置文件的最末尾，加上以下配置信息：<br />
[eaccelerator]<br />
zend_extension=&#8221;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so&#8221;<br />
eaccelerator.shm_size=&#8221;64&#8243;<br />
eaccelerator.cache_dir=&#8221;/usr/local/webserver/eaccelerator_cache&#8221;<br />
eaccelerator.enable=&#8221;1&#8243;<br />
eaccelerator.optimizer=&#8221;1&#8243;<br />
eaccelerator.check_mtime=&#8221;1&#8243;<br />
eaccelerator.debug=&#8221;0&#8243;<br />
eaccelerator.filter=&#8221;"<br />
eaccelerator.shm_max=&#8221;0&#8243;<br />
eaccelerator.shm_ttl=&#8221;3600&#8243;<br />
eaccelerator.shm_prune_period=&#8221;3600&#8243;<br />
eaccelerator.shm_only=&#8221;0&#8243;<br />
eaccelerator.compress=&#8221;1&#8243;<br />
eaccelerator.compress_level=&#8221;9&#8243;<br />
3.7 创建www用户和组<br />
/usr/sbin/groupadd www<br />
/usr/sbin/useradd -g www www<br />
3.8创建php-fpm配置文件<br />
在/usr/local/webserver/php/etc/目录中创建php-fpm.conf文件<br />
rm -f /usr/local/webserver/php/etc/php-fpm.conf<br />
vi /usr/local/webserver/php/etc/php-fpm.conf</p>
<p>&lt;?xml version=&#8221;1.0&#8243; ?&gt;<br />
&lt;configuration&gt;</p>
<p> All relative paths in this config are relative to php&#8217;s install prefix</p>
<p> &lt;section name=&#8221;global_options&#8221;&gt;</p>
<p>  Pid file<br />
  &lt;value name=&#8221;pid_file&#8221;&gt;/usr/local/webserver/php/logs/php-fpm.pid&lt;/value&gt;</p>
<p>  Error log file<br />
  &lt;value name=&#8221;error_log&#8221;&gt;/usr/local/webserver/php/logs/php-fpm.log&lt;/value&gt;</p>
<p>  Log level<br />
  &lt;value name=&#8221;log_level&#8221;&gt;notice&lt;/value&gt;</p>
<p>  When this amount of php processes exited with SIGSEGV or SIGBUS &#8230;<br />
  &lt;value name=&#8221;emergency_restart_threshold&#8221;&gt;10&lt;/value&gt;</p>
<p>  &#8230; in a less than this interval of time, a graceful restart will be initiated.<br />
  Useful to work around accidental curruptions in accelerator&#8217;s shared memory.<br />
  &lt;value name=&#8221;emergency_restart_interval&#8221;&gt;1m&lt;/value&gt;</p>
<p>  Time limit on waiting child&#8217;s reaction on signals from master<br />
  &lt;value name=&#8221;process_control_timeout&#8221;&gt;5s&lt;/value&gt;</p>
<p>  Set to &#8216;no&#8217; to debug fpm<br />
  &lt;value name=&#8221;daemonize&#8221;&gt;yes&lt;/value&gt;</p>
<p> &lt;/section&gt;</p>
<p> &lt;workers&gt;</p>
<p>  &lt;section name=&#8221;pool&#8221;&gt;</p>
<p>   Name of pool. Used in logs and stats.<br />
   &lt;value name=&#8221;name&#8221;&gt;default&lt;/value&gt;</p>
<p>   Address to accept fastcgi requests on.<br />
   Valid syntax is &#8216;ip.ad.re.ss:port&#8217; or just &#8216;port&#8217; or &#8216;/path/to/unix/socket&#8217;<br />
   &lt;value name=&#8221;listen_address&#8221;&gt;127.0.0.1:9000&lt;/value&gt;</p>
<p>   &lt;value name=&#8221;listen_options&#8221;&gt;</p>
<p>    Set listen(2) backlog<br />
    &lt;value name=&#8221;backlog&#8221;&gt;-1&lt;/value&gt;</p>
<p>    Set permissions for unix socket, if one used.<br />
    In Linux read/write permissions must be set in order to allow connections from web server.<br />
    Many BSD-derrived systems allow connections regardless of permissions.<br />
    &lt;value name=&#8221;owner&#8221;&gt;&lt;/value&gt;<br />
    &lt;value name=&#8221;group&#8221;&gt;&lt;/value&gt;<br />
    &lt;value name=&#8221;mode&#8221;&gt;0666&lt;/value&gt;<br />
   &lt;/value&gt;</p>
<p>   Additional php.ini defines, specific to this pool of workers.<br />
   &lt;value name=&#8221;php_defines&#8221;&gt;<br />
    &lt;value name=&#8221;sendmail_path&#8221;&gt;/usr/sbin/sendmail -t -i&lt;/value&gt;<br />
    &lt;value name=&#8221;display_errors&#8221;&gt;0&lt;/value&gt;<br />
   &lt;/value&gt;</p>
<p>   Unix user of processes<br />
   &lt;value name=&#8221;user&#8221;&gt;www&lt;/value&gt;</p>
<p>   Unix group of processes<br />
   &lt;value name=&#8221;group&#8221;&gt;www&lt;/value&gt;</p>
<p>   Process manager settings<br />
   &lt;value name=&#8221;pm&#8221;&gt;</p>
<p>    Sets style of controling worker process count.<br />
    Valid values are &#8216;static&#8217; and &#8216;apache-like&#8217;<br />
    &lt;value name=&#8221;style&#8221;&gt;static&lt;/value&gt;</p>
<p>    Sets the limit on the number of simultaneous requests that will be served.<br />
    Equivalent to Apache MaxClients directive.<br />
    Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi<br />
    Used with any pm_style.<br />
    &lt;value name=&#8221;max_children&#8221;&gt;128&lt;/value&gt;</p>
<p>    Settings group for &#8216;apache-like&#8217; pm style<br />
    &lt;value name=&#8221;apache_like&#8221;&gt;</p>
<p>     Sets the number of server processes created on startup.<br />
     Used only when &#8216;apache-like&#8217; pm_style is selected<br />
     &lt;value name=&#8221;StartServers&#8221;&gt;20&lt;/value&gt;</p>
<p>     Sets the desired minimum number of idle server processes.<br />
     Used only when &#8216;apache-like&#8217; pm_style is selected<br />
     &lt;value name=&#8221;MinSpareServers&#8221;&gt;5&lt;/value&gt;</p>
<p>     Sets the desired maximum number of idle server processes.<br />
     Used only when &#8216;apache-like&#8217; pm_style is selected<br />
     &lt;value name=&#8221;MaxSpareServers&#8221;&gt;35&lt;/value&gt;</p>
<p>    &lt;/value&gt;</p>
<p>   &lt;/value&gt;</p>
<p>   The timeout (in seconds) for serving a single request after which the worker process will be terminated<br />
   Should be used when &#8216;max_execution_time&#8217; ini option does not stop script execution for some reason<br />
   &#8217;0s&#8217; means &#8216;off&#8217;<br />
   &lt;value name=&#8221;request_terminate_timeout&#8221;&gt;0s&lt;/value&gt;</p>
<p>   The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file<br />
   &#8217;0s&#8217; means &#8216;off&#8217;<br />
   &lt;value name=&#8221;request_slowlog_timeout&#8221;&gt;0s&lt;/value&gt;</p>
<p>   The log file for slow requests<br />
   &lt;value name=&#8221;slowlog&#8221;&gt;logs/slow.log&lt;/value&gt;</p>
<p>   Set open file desc rlimit<br />
   &lt;value name=&#8221;rlimit_files&#8221;&gt;65535&lt;/value&gt;</p>
<p>   Set max core size rlimit<br />
   &lt;value name=&#8221;rlimit_core&#8221;&gt;0&lt;/value&gt;</p>
<p>   Chroot to this directory at the start, absolute path<br />
   &lt;value name=&#8221;chroot&#8221;&gt;&lt;/value&gt;</p>
<p>   Chdir to this directory at the start, absolute path<br />
   &lt;value name=&#8221;chdir&#8221;&gt;&lt;/value&gt;</p>
<p>   Redirect workers&#8217; stdout and stderr into main error log.<br />
   If not set, they will be redirected to /dev/null, according to FastCGI specs<br />
   &lt;value name=&#8221;catch_workers_output&#8221;&gt;yes&lt;/value&gt;</p>
<p>   How much requests each process should execute before respawn.<br />
   Useful to work around memory leaks in 3rd party libraries.<br />
   For endless request processing please specify 0<br />
   Equivalent to PHP_FCGI_MAX_REQUESTS<br />
   &lt;value name=&#8221;max_requests&#8221;&gt;1024&lt;/value&gt;</p>
<p>   Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.<br />
   Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)<br />
   Makes sense only with AF_INET listening socket.<br />
   &lt;value name=&#8221;allowed_clients&#8221;&gt;127.0.0.1&lt;/value&gt;</p>
<p>   Pass environment variables like LD_LIBRARY_PATH<br />
   All $VARIABLEs are taken from current environment<br />
   &lt;value name=&#8221;environment&#8221;&gt;<br />
    &lt;value name=&#8221;HOSTNAME&#8221;&gt;$HOSTNAME&lt;/value&gt;<br />
    &lt;value name=&#8221;PATH&#8221;&gt;/usr/local/bin:/usr/bin:/bin&lt;/value&gt;<br />
    &lt;value name=&#8221;TMP&#8221;&gt;/tmp&lt;/value&gt;<br />
    &lt;value name=&#8221;TMPDIR&#8221;&gt;/tmp&lt;/value&gt;<br />
    &lt;value name=&#8221;TEMP&#8221;&gt;/tmp&lt;/value&gt;<br />
    &lt;value name=&#8221;OSTYPE&#8221;&gt;$OSTYPE&lt;/value&gt;<br />
    &lt;value name=&#8221;MACHTYPE&#8221;&gt;$MACHTYPE&lt;/value&gt;<br />
    &lt;value name=&#8221;MALLOC_CHECK_&#8221;&gt;2&lt;/value&gt;<br />
   &lt;/value&gt;</p>
<p>  &lt;/section&gt;</p>
<p> &lt;/workers&gt;</p>
<p>&lt;/configuration&gt;<br />
3.9启动php-cgi进程，监听127.0.0.1的9000端口，进程数为128（如果服务器内存小于3GB，可以只开启64个进程），用户为www<br />
ulimit -SHn 65535<br />
/usr/local/webserver/php/sbin/php-fpm start</p>
<p>4.安装安装Nginx 0.8.36<br />
4.1 安装Nginx所需的pcre库<br />
tar zxvf pcre-8.01.tar.gz<br />
cd pcre-8.01/<br />
./configure<br />
make &amp;&amp; make install<br />
cd ../<br />
4.2 安装Nginx<br />
tar zxvf nginx-0.8.36.tar.gz<br />
cd nginx-0.8.36/<br />
./configure &#8211;user=www &#8211;group=www &#8211;prefix=/usr/local/webserver/nginx &#8211;with-http_stub_status_module &#8211;with-http_ssl_module<br />
make &amp;&amp; make install<br />
cd ../<br />
4.3 创建Nginx日志目录<br />
mkdir -p /data0/logs<br />
chmod +w /data0/logs<br />
chown -R www:www /data0/logs<br />
4.4 创建Nginx配置文件<br />
4.4.1 在/usr/local/webserver/nginx/conf/目录中创建nginx.conf文件<br />
rm -f /usr/local/webserver/nginx/conf/nginx.conf<br />
vi /usr/local/webserver/nginx/conf/nginx.conf</p>
<p>4.4.2 在/usr/local/webserver/nginx/conf/目录中创建fcgi.conf文件<br />
vi /usr/local/webserver/nginx/conf/fcgi.conf</p>
<p>fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;<br />
fastcgi_param  SERVER_SOFTWARE    nginx;</p>
<p>fastcgi_param  QUERY_STRING       $query_string;<br />
fastcgi_param  REQUEST_METHOD     $request_method;<br />
fastcgi_param  CONTENT_TYPE       $content_type;<br />
fastcgi_param  CONTENT_LENGTH     $content_length;</p>
<p>fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;<br />
fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;<br />
fastcgi_param  REQUEST_URI        $request_uri;<br />
fastcgi_param  DOCUMENT_URI       $document_uri;<br />
fastcgi_param  DOCUMENT_ROOT      $document_root;<br />
fastcgi_param  SERVER_PROTOCOL    $server_protocol;</p>
<p>fastcgi_param  REMOTE_ADDR        $remote_addr;<br />
fastcgi_param  REMOTE_PORT        $remote_port;<br />
fastcgi_param  SERVER_ADDR        $server_addr;<br />
fastcgi_param  SERVER_PORT        $server_port;<br />
fastcgi_param  SERVER_NAME        $server_name;</p>
<p># PHP only, required if PHP was built with &#8211;enable-force-cgi-redirect<br />
fastcgi_param  REDIRECT_STATUS    200;<br />
4.5 启动Nginx<br />
ulimit -SHn 65535<br />
/usr/local/webserver/nginx/sbin/nginx</p>
<p>5. 配置开机自动启动Nginx + PHP<br />
vi /etc/rc.local<br />
ulimit -SHn 65535<br />
/usr/local/webserver/php/sbin/php-fpm start<br />
/usr/local/webserver/nginx/sbin/nginx</p>
<p>6. 优化Linux内核参数<br />
vi /etc/sysctl.conf<br />
# Add<br />
net.ipv4.tcp_max_syn_backlog = 65536<br />
net.core.netdev_max_backlog =  32768<br />
net.core.somaxconn = 32768</p>
<p>net.core.wmem_default = 8388608<br />
net.core.rmem_default = 8388608<br />
net.core.rmem_max = 16777216<br />
net.core.wmem_max = 16777216</p>
<p>net.ipv4.tcp_timestamps = 0<br />
net.ipv4.tcp_synack_retries = 2<br />
net.ipv4.tcp_syn_retries = 2</p>
<p>net.ipv4.tcp_tw_recycle = 1<br />
#net.ipv4.tcp_tw_len = 1<br />
net.ipv4.tcp_tw_reuse = 1</p>
<p>net.ipv4.tcp_mem = 94500000 915000000 927000000<br />
net.ipv4.tcp_max_orphans = 3276800</p>
<p>#net.ipv4.tcp_fin_timeout = 30<br />
#net.ipv4.tcp_keepalive_time = 120<br />
net.ipv4.ip_local_port_range = 1024  65535</p>
<p>使配置立即生效<br />
/sbin/sysctl -p</p>
<p>以上就是所有的文章内容，这次的安装过程主要要感谢：<br />
张晏：<a href="http://blog.s135.com/nginx_php_v6/">http://blog.s135.com/nginx_php_v6/</a>   <a href="http://blog.s135.com/nginx_php_v5/">http://blog.s135.com/nginx_php_v5/</a><br />
LNMP一键安装（<a title="关注VPS Linux Nginx MySQL PHP WEB开发 系统管理 服务器架构 Debian CentOS" href="http://blog.licess.org/">Licess</a>）：<a href="http://lnmp.org/">http://lnmp.org/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/564.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux 死机的应对方法</title>
		<link>http://www.tisswb.com/archives/562.html</link>
		<comments>http://www.tisswb.com/archives/562.html#comments</comments>
		<pubDate>Wed, 02 Jun 2010 03:33:21 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=562</guid>
		<description><![CDATA[最近这两天，CentOS的web服务器连续死掉了2次，远程直接没有反应，在机房里能输入用户名，输入完了就没有下文了。最头疼的是没有找到原因何在，也没有任何办法能够进系统重启或者查看内容，每次都是很心疼的摁住电源重启。于是就来找如何应对Linux这种键盘不响应的死机情况，还真找到了一篇：
Linux 会死机么？我可以很肯定地说，会！要让 Linux 死机很容易，但难的是在死机以后如何安全的让他摆脱死机状态，本文讲述如何从 linux 的死机状态中挣脱出来。

Linux 死机有很多种情况，最常见的是系统负载过高导致的。如上次介绍的 fork 炸弹就是这个原理，此外还可以运行内存耗用极大的程序（如虚拟机），也会迅速提升系统负载。由于系统负载过高导致的卡死，一定是解决的越快越好！此时必须记住的是，不能再试图依赖任何图形界面的东西，如 Gnome 的系统监视器（这是我从 Windows 遗留下来的愚昧习惯……），这只会继续加重这种卡死的局面。那怎么办？
<span class="readmore"><a href="http://www.tisswb.com/archives/562.html" title="linux 死机的应对方法" target="_blank">阅读全文——共1415字</a></span>]]></description>
			<content:encoded><![CDATA[<p>最近这两天，CentOS的web服务器连续死掉了2次，远程直接没有反应，在机房里能输入用户名，输入完了就没有下文了。最头疼的是没有找到原因何在，也没有任何办法能够进系统重启或者查看内容，每次都是很心疼的摁住电源重启。于是就来找如何应对Linux这种键盘不响应的死机情况，还真找到了一篇：</p>
<p>Linux 会死机么？我可以很肯定地说，会！要让 Linux 死机很容易，但难的是在死机以后如何安全的让他摆脱死机状态，本文讲述如何从 linux 的死机状态中挣脱出来。</p>
<p><a id="more"></a></p>
<p>Linux 死机有很多种情况，最常见的是系统负载过高导致的。如上次介绍的 fork 炸弹就是这个原理，此外还可以运行内存耗用极大的程序（如虚拟机），也会迅速提升系统负载。由于系统负载过高导致的卡死，一定是解决的越快越好！此时必须记住的是，<strong>不能再试图依赖任何图形界面的东西</strong>，如 Gnome 的系统监视器（这是我从 Windows 遗留下来的愚昧习惯……），这只会继续加重这种卡死的局面。那怎么办？</p>
<p>不要怕，Linux 最初就是不需要图形界面的，因为有一个很强大的文字界面。按 Ctrl-Alt-F1（F1-F6 一般来说都可以），然后等一会儿，就会切换到 tty，也就是所谓的文字界面。这个时候需要用用户名密码登入。注意，可能键盘输入的速度比较慢，不过应该还是可以忍受的。下面在提示符后面输入 top 回车，这时会看到一张动态的表，上面列出了耗用资源最多的进程。观察它刷新一两次，按q退出，然后输入 kill ，其中的 PID 你可以在 top 里面看到。这个时候应该会快了不少，如果你发现没有成功结束掉，就再输入 kill -KILL ，这次基本上就没问题了。</p>
<p>除了上面这种情况外，一些底层软件的 bug 也可能导致一些奇怪的死机问题。我某位同学近日就因为莫名其妙的死机强制重启把 ext4 的分区给伤了。（最后是 sysreccd 修复了，貌似是分区表部分损坏）据其说，死机是键鼠均无反应。一般来说，系统负载高导致的死机，在可怕键盘也会有反应，有人说如果死机到键盘无响应“负载 都无限大了”，亦有人说这可能是 X Server 与驱动配合有问题导致的。不过我们考虑一下遇到这种情况怎么办？</p>
<p>OK，这是今天才学到的方法，叫做 reisub，这个方法可以在各种情况下安全地重启计算机。大家在键盘上找，可以找到一个叫做“Sys Rq”的键，在台机的键盘上通常与 Prt Sc 共键，在笔记本可能在其他位置，如 Delete。以台机为例，要使用这种方法需要<em>按住</em> Alt-Print(Sys Rq)，然后依次按下 reisub 这几个键，按完 b 系统就会重启。</p>
<p>下面解释一下这个方法：其实 Sys Rq 是一种叫做系统请求的东西，按住 Alt-Print 的时候就相当于按住了 Sys Rq 键，这个时候输入的一切都会直接由 Linux 内核来处理，它可以进行许多低级操作。这个时候 reisub 中的每一个字母都是一个独立操作，他们分别表示：</p>
<pre>un<strong>R</strong>aw      将键盘控制从 X Server 那里抢回来
t<strong>E</strong>rminate 给所有进程发送 SIGTERM 信号，让他们自己解决善后
<strong>KI</strong>ll      给所有进程发送 SIGKILL 信号，强制他们马上关闭
<strong>S</strong>ync     将所有数据同步至磁盘
<strong>U</strong>nmount  将所有分区挂载为只读模式
re<strong>B</strong>oot     重启</pre>
<pre>这6个字母的顺序是不可以记错的。那怎么记呢？这里提供一个个人认为比较好的方法：单词 busier（busy 的比较级，更忙）倒过来就是了。</pre>
<p>基本上就这样了，Linux 的死机本来就不多见，现在见了也可以安全解决，多好~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/562.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS中yum的详细使用方法</title>
		<link>http://www.tisswb.com/archives/558.html</link>
		<comments>http://www.tisswb.com/archives/558.html#comments</comments>
		<pubDate>Thu, 27 May 2010 07:36:36 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=558</guid>
		<description><![CDATA[一直以来，使用Centos经常使用到yum这个命令，最近刚装了个centos5.4的系统，想yum安装一些基本的软件，由于操作不当，把yum搞了个乱起八糟，老是想安装的提示找不到什么的。于是好好学了一下yum的详细使用方法：
yum是什么
yum = Yellow dog Updater, Modified
主要功能是更方便的添加/删除/更新RPM包.
它能自动解决包的倚赖性问题.
它能便于管理大量系统的更新问题
yum特点
可以同时配置多个资源库(Repository)
简洁的配置文件(/etc/yum.conf
自动解决增加或删除rpm包时遇到的倚赖性问题
<span class="readmore"><a href="http://www.tisswb.com/archives/558.html" title="CentOS中yum的详细使用方法" target="_blank">阅读全文——共2597字</a></span>]]></description>
			<content:encoded><![CDATA[<p>一直以来，使用Centos经常使用到yum这个命令，最近刚装了个centos5.4的系统，想yum安装一些基本的软件，由于操作不当，把yum搞了个乱起八糟，老是想安装的提示找不到什么的。于是好好学了一下yum的详细使用方法：</p>
<p>yum是什么</p>
<p>yum = Yellow dog Updater, Modified</p>
<p>主要功能是更方便的添加/删除/更新RPM包.</p>
<p>它能自动解决包的倚赖性问题.</p>
<p>它能便于管理大量系统的更新问题</p>
<p>yum特点</p>
<p>可以同时配置多个资源库(Repository)</p>
<p>简洁的配置文件(/etc/yum.conf</p>
<p>自动解决增加或删除rpm包时遇到的倚赖性问题</p>
<p>使用方便</p>
<p>保持与RPM数据库的一致性</p>
<p>yum安装</p>
<p>CentOS自带(yum-*.noarch.rpm)</p>
<p>#rpm -ivh yum-*.noarch.rpm</p>
<p>在第一次启用yum之前首先需要导入系统的RPM-GPG-KEY：</p>
<p>#rpm &#8211;import /usr/share/doc/centos-release-3(4)/RPM-GPG-KEY-CentOS-3(4)</p>
<p>yum指令</p>
<p>注:当第一次使用yum或yum资源库有更新时,yum会自动下载所有所需的headers放置于/var/cache/yum目录下,所需时间可能较长.</p>
<p>rpm包的更新</p>
<p>检查可更新的rpm包</p>
<p>#yum check-update</p>
<p>更新所有的rpm包</p>
<p>#yum update</p>
<p>更新指定的rpm包,如更新kernel和kernel source</p>
<p>#yum update kernel kernel-source</p>
<p>大规模的版本升级,与yum update不同的是,连旧的淘汰的包也升级</p>
<p>#yum upgrade</p>
<p>rpm包的安装和删除</p>
<p>安装rpm包,如xmms-mp3</p>
<p>#yum install xmms-mp3</p>
<p>删除rpm包,包括与该包有倚赖性的包</p>
<p>#yum remove licq</p>
<p>注:同时会提示删除licq-gnome,licq-qt,licq-text</p>
<p>yum暂存(/var/cache/yum/)的相关参数</p>
<p>清除暂存中rpm包文件</p>
<p>#yum clean packages</p>
<p>清除暂存中rpm头文件</p>
<p>#yum clearn headers</p>
<p>清除暂存中旧的rpm头文件</p>
<p>#yum clean oldheaders</p>
<p>清除暂存中旧的rpm头文件和包文件</p>
<p>#yum clearn 或#yum clearn all</p>
<p>注:相当于yum clean packages + yum clean oldheaders</p>
<p>包列表</p>
<p>列出资源库中所有可以安装或更新的rpm包</p>
<p>#yum list</p>
<p>列出资源库中特定的可以安装或更新以及已经安装的rpm包</p>
<p>#yum list mozilla#yum list mozilla*</p>
<p>注:可以在rpm包名中使用匹配符,如列出所有以mozilla开头的rpm包</p>
<p>列出资源库中所有可以更新的rpm包</p>
<p>#yum list updates</p>
<p>列出已经安装的所有的rpm包</p>
<p>#yum list installed</p>
<p>列出已经安装的但是不包含在资源库中的rpm包</p>
<p>#yum list extras</p>
<p>注:通过其它网站下载安装的rpm包</p>
<p>rpm包信息显示(info参数同list)</p>
<p>列出资源库中所有可以安装或更新的rpm包的信息</p>
<p>#yum info</p>
<p>列出资源库中特定的可以安装或更新以及已经安装的rpm包的信息</p>
<p>#yum info mozilla#yum info mozilla*</p>
<p>注:可以在rpm包名中使用匹配符,如列出所有以mozilla开头的rpm包的信息</p>
<p>列出资源库中所有可以更新的rpm包的信息</p>
<p>#yum info updates</p>
<p>列出已经安装的所有的rpm包的信息</p>
<p>#yum info installed</p>
<p>列出已经安装的但是不包含在资源库中的rpm包的信息</p>
<p>#yum info extras</p>
<p>注:通过其它网站下载安装的rpm包的信息</p>
<p>搜索rpm包</p>
<p>搜索匹配特定字符的rpm包</p>
<p>#yum search mozilla</p>
<p>注:在rpm包名,包描述等中搜索</p>
<p>搜索有包含特定文件名的rpm包</p>
<p>#yum provides realplay</p>
<p>增加资源库</p>
<p>例如:增加rpm.livna.org作为资源库</p>
<p>安装Livna.org rpms GPG key</p>
<p>#rpm &#8211;import http://rpm.livna.org/RPM-LIVNA-GPG-KEY</p>
<p>检查GPG Key</p>
<p># rpm -qa gpg-pubkey*</p>
<p>显示Key信息</p>
<p>#rpm -qi gpg-pubkey-a109b1ec-3f6e28d5</p>
<p>(注:如果要删除Key,使用#rpm -e gpg-pubkey-a109b1ec-3f6e28d5)</p>
<p>yum常用的命令</p>
<p># yum install xxx 安装xxx软件</p>
<p># yum info xxx 查看xxx软件的信息</p>
<p># yum remove xxx 删除软件包</p>
<p># yum list 列出软件包</p>
<p># yum clean 清除缓冲和就的包</p>
<p># yum provides xxx 以xxx为关键字搜索包（提供的信息为关键字）</p>
<p># yum search xxx 搜索软件包（以名字为关键字）</p>
<p># yum groupupdate xxx</p>
<p># yum grouplist xxx</p>
<p># yum groupremove xxx</p>
<p>这三个都是一组为单位进行升级 列表和删除的操作。。比如 &#8220;Mysql Database&#8221;就是一个组会同时操作相关的所有软件包；</p>
<p># yum update 系统升级</p>
<p># yum list available 列出所有升级源上的包；</p>
<p># yum list updates 列出所有升级源上的可以更新包；</p>
<p># yum list installed 列出已经安装的包；</p>
<p># yun update kernel 升级内核；</p>
<p>yum常用的源</p>
<p>1) 自动选择最快的源</p>
<p>由于yum中有的mirror速度是非常慢的，如果yum选择了这个mirror，这个时候yum就会非常慢，对此，可以下载fastestmirror插件，它会自动选择最快的mirror：</p>
<p>#yum install yum-fastestmirror</p>
<p>配置文件：（一般不用动）/etc/yum/pluginconf.d/fastestmirror.conf</p>
<p>你的yum镜像的速度测试记录文件：/var/cache/yum/timedhosts.txt</p>
<p>(2)使用图形界面的yum</p>
<p>如果觉得命令行的yum不方便，那么可以使用图形化的yumex，这个看起来更方便，因为可以自由地选择软件仓库：</p>
<p>#yum install yumex</p>
<p>然后在系统工具中就可以看到yum extender了。实际上系统自带的“添加/删除程序“也可以实现图形化的软件安装，但有些yumex的功能它没有。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/558.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>配置LAMP生产环境：安装Apache、PHP、Mysql</title>
		<link>http://www.tisswb.com/archives/526.html</link>
		<comments>http://www.tisswb.com/archives/526.html#comments</comments>
		<pubDate>Sat, 28 Nov 2009 16:59:52 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=526</guid>
		<description><![CDATA[上一篇主要说了一下快速最小化安装CentOS5.3的过程，这一篇主要讲一讲APM（Apache、PHP、Mysql的缩写）的安装过程。下一篇将集中讲述一下我是优化LAMP（CentOS5.3+Apache2.2.14+PHP5.2.11+Mysql5.0.36）的具体细节。
在CentOS5.3下面安装APM 主要有两种方法，第一种，yum快速安装；第二种，编译安装。这两种方法可以说各有各的好处，作为生产环境都是可以的，下面我们分别讲讲两种方法。
第一种，yum快速安装APM

安装APM之前，为了保证使用mysql5.1.x和php5.2.x，首先要添加一个源
安装相应的GPG key
# rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
新建一个repo
# /etc/yum.repos.d/utterramblings.repo 
<span class="readmore"><a href="http://www.tisswb.com/archives/526.html" title="配置LAMP生产环境：安装Apache、PHP、Mysql" target="_blank">阅读全文——共1272字</a></span>]]></description>
			<content:encoded><![CDATA[<p>上一篇主要说了一下<a href="http://www.tisswb.cn/archives/519.html" target="_self">快速最小化安装CentOS5.3</a>的过程，这一篇主要讲一讲APM（Apache、PHP、Mysql的缩写）的安装过程。下一篇将集中讲述一下我是优化LAMP（CentOS5.3+Apache2.2.14+PHP5.2.11+Mysql5.0.36）的具体细节。</p>
<p>在CentOS5.3下面安装APM 主要有两种方法，第一种，yum快速安装；第二种，编译安装。这两种方法可以说各有各的好处，作为生产环境都是可以的，下面我们分别讲讲两种方法。</p>
<p>第一种，yum快速安装APM</p>
<ol>
<li>安装APM之前，为了保证使用mysql5.1.x和php5.2.x，首先要添加一个源
<p>安装相应的GPG key</p>
<p><code># rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka</code></p>
<p>新建一个repo</p>
<p><code># /etc/yum.repos.d/utterramblings.repo </code></p>
<p>把以下内容添加进去，保存退出就OK了</p>
<p><code>[utterramblings]<br />
name=Jason's Utter Ramblings Repo<br />
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/<br />
enabled=1<br />
gpgcheck=1<br />
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka </code></p>
</li>
<li>安装APM
<p>安装命令如下：</p>
<p><code>yum install httpd httpd-devel mysql mysql-devel mysql-server php php-devel php-mysql php-common php-gd php-mbstring php-mcrypt php-xml</code></p>
<p>使用/etc/init.d/httpd start 就可以开启web服务器。</p>
<p>使用/etc/init.d/mysqld start 就可以开启Mysql数据库服务器。</li>
<li>初始化Mysql
<p>第一次启动mysql以后执行如下命令：</p>
<p><code>/usr/bin/mysqladmin -u root password 'asdasd'</code></p>
<p>其中&#8221;中的asdasd是密码，你可以设置成想要的密码。</p>
<p>给root用户授权局域网访问</p>
<p><code>GRANT ALL ON *.* TO root@'192.168.%.%' IDENTIFIED BY '密码';<br />
flush privileges;</code></p>
<p>这样的话就可以使用如下命令登陆mysql了：</p>
<p><code>mysql -uroot -p</code></li>
<li>设置httpd和mysqld开机启动
<p>命令如下：</p>
<p><code>chkconfig httpd on</p>
<p>chkconfig mysqld on</p>
<p></code></li>
<li>在/var/www/html下面新建网页phpinfo.php，内容如下：
<p>这样就可以访问基本的web了：http://192.168.0.6/phpinfo.php （其中192.168.0.6是服务器的ip地址）</li>
</ol>
<p>第二种，编译安装APM</p>
<p>具体编译过程正在整理，敬请期待</p>
<p>20100525 今天更新了一下yum的安装方法，添加了几个devel的安装，因为有些时候安装其他的软件的时候需要用到。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/526.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>配置LAMP生产环境：安装CentOS5.3</title>
		<link>http://www.tisswb.com/archives/519.html</link>
		<comments>http://www.tisswb.com/archives/519.html#comments</comments>
		<pubDate>Thu, 26 Nov 2009 14:20:13 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[LAMP]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=519</guid>
		<description><![CDATA[有几个月没有任何文章，今天回来了。几个月前换了新的工作，主要是将一个大数据量和大访问量的论坛的从dvbbs迁移到discuz，并且为新的程序配置LAMP安装生产环境并逐步优化，中间还负责对discuz进行了二次开发。从这篇文章开始，我开始总结一下这几个月的工作吧，首先安装操作系统，我的生产环境选择的是CentOS5.3，下面主要介绍一下CentOS的最小化安装过程。

系统启动到选择安装方式的时候，选择linux text，文本方式安装。
安装过程中，因为是最小化安装，所以语言选择en即可，分区我采用的是默认的没有进行修改，ip是自定义设置的，时间选项选择在上海，去掉了使用UTC的选项，最后选择程序的时候全部不选择。
最小化安装速度很快，也就是10分钟左右，基本的系统就能安装好，然后重启。
重启后，执行以下操作：
yum install setuptool ntsysv ntp vixie-cron crontabs microcode_ctl wget irqbalance vim-enhanced
<span class="readmore"><a href="http://www.tisswb.com/archives/519.html" title="配置LAMP生产环境：安装CentOS5.3" target="_blank">阅读全文——共1030字</a></span>]]></description>
			<content:encoded><![CDATA[<p>有几个月没有任何文章，今天回来了。几个月前换了新的工作，主要是将一个大数据量和大访问量的论坛的从dvbbs迁移到discuz，并且为新的程序配置LAMP安装生产环境并逐步优化，中间还负责对discuz进行了二次开发。从这篇文章开始，我开始总结一下这几个月的工作吧，首先安装操作系统，我的生产环境选择的是CentOS5.3，下面主要介绍一下CentOS的最小化安装过程。</p>
<ol>
<li>系统启动到选择安装方式的时候，选择linux text，文本方式安装。</li>
<li>安装过程中，因为是最小化安装，所以语言选择en即可，分区我采用的是默认的没有进行修改，ip是自定义设置的，时间选项选择在上海，去掉了使用UTC的选项，最后选择程序的时候全部不选择。</li>
<li>最小化安装速度很快，也就是10分钟左右，基本的系统就能安装好，然后重启。</li>
<li>重启后，执行以下操作：<br />
<code><span style="color: #ff0000;">yum install setuptool ntsysv ntp vixie-cron crontabs microcode_ctl wget irqbalance vim-enhanced</span></code><br />
setuptool：可以让文本方式下的setup管用<br />
ntsysv：在setup下有system service管理<br />
ntp：时间更新服务<br />
vixie-cron，crontabs：cron服务<br />
microcode_ctl：inter CPU的微代码之类的东西<br />
wget：从网上下东西<br />
irqbalance：当服务器CPU为S.M.P架构或支持双核心、HT技术时安装，否则不用。<br />
vim-enhanced：个人比较喜欢vim，然后在vim中:syntax on就可以设置高亮了</li>
<li>安装完成后，执行如下命令：<br />
<code><span style="color: #ff0000;">setup</span></code><br />
其中关闭Firewall，禁用SELinux。<br />
服务只留下：<br />
<code><strong>crond</strong><br />
<strong>irqbalance</strong> 没装，需要时用yum安装，仅当服务器CPU为S.M.P架构或支持双核心、HT技术时，才需开启，否则关闭。<br />
<strong>microcode_ctl<br />
network<br />
sshd<br />
syslog</strong></code></li>
</ol>
<p>这样，一个基本的CentOS系统就安装完了，下一篇我们就来说一说<a href="http://www.tisswb.cn/archives/526.html" target="_blank">安装Apache、PHP、MySql</a>。</p>
<p><strong>附录：</strong></p>
<p>1.官方的源不给力，可以用国内的源，比如搜狐、网易的源都不错。<br />
将/etc/yum.repos.d/CentOS-Base.repo 的内容替换搜狐或者网易的源都是不错的选择。<br />
2.如果不想使用fastmirror来自动搜索源，修改/etc/yum/pluginconf.d下得fastestmirror.conf，enabled=0。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/519.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>在ubuntu9.04下安装ZendStudio7.0详解</title>
		<link>http://www.tisswb.com/archives/517.html</link>
		<comments>http://www.tisswb.com/archives/517.html#comments</comments>
		<pubDate>Sun, 16 Aug 2009 14:31:39 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web技术]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ZendStudio]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=517</guid>
		<description><![CDATA[ZendStudio7绝对是php编辑的神器，最近一段时间使用的是不亦乐乎。但是最近工作环境转移到了Ubuntu上了，还是相当希望能够使用ZS7。当然，zend公司还是给我们提供了linux下的安装文件了，由于是初次在linux下面安装ZendStudio7，下面记录一下安装步骤细节，以备以后查阅：
1.下载zendstudio的linux版本，我下载的地址是：http://downloads.zend.com/studio-eclipse/7.0.0/ZendStudio-7.0.0.tar.gz
2.安装支持环境，zendstudio7需要jre支持，所以需要安装一下
sudo apt-get instll sun-java6-jre sun-java6-jdk
3.解压缩ZendStudio7的压缩包，把内容解压缩到个人的home目录中，解压缩出来的文件是一个叫ZendStudio7_0_0.bin的文件
<span class="readmore"><a href="http://www.tisswb.com/archives/517.html" title="在ubuntu9.04下安装ZendStudio7.0详解" target="_blank">阅读全文——共511字</a></span>]]></description>
			<content:encoded><![CDATA[<p>ZendStudio7绝对是php编辑的神器，最近一段时间使用的是不亦乐乎。但是最近工作环境转移到了Ubuntu上了，还是相当希望能够使用ZS7。当然，zend公司还是给我们提供了linux下的安装文件了，由于是初次在linux下面安装ZendStudio7，下面记录一下安装步骤细节，以备以后查阅：</p>
<p>1.下载zendstudio的linux版本，我下载的地址是：<a title="zendstudio7的官方下载地址" href="http://downloads.zend.com/studio-eclipse/7.0.0/ZendStudio-7.0.0.tar.gz">http://downloads.zend.com/studio-eclipse/7.0.0/ZendStudio-7.0.0.tar.gz</a></p>
<p>2.安装支持环境，zendstudio7需要jre支持，所以需要安装一下<br />
<code>sudo apt-get instll sun-java6-jre sun-java6-jd</code>k</p>
<p>3.解压缩ZendStudio7的压缩包，把内容解压缩到个人的home目录中，解压缩出来的文件是一个叫ZendStudio7_0_0.bin的文件</p>
<p>4.使用如下命令安装这个bin文件<br />
<code>./ZendStudio7_0_0.bin</code></p>
<p>5.再往后的安装步骤就跟在window下面安装一样了，一直点下一步就可以了</p>
<p>安装完成后的配置也跟windows下面的一样了，这里我就不多说了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/517.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux自动备份数据脚本</title>
		<link>http://www.tisswb.com/archives/515.html</link>
		<comments>http://www.tisswb.com/archives/515.html#comments</comments>
		<pubDate>Wed, 29 Jul 2009 07:09:20 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=515</guid>
		<description><![CDATA[Linux如果天天手工备份真是太麻烦了，今天抽空写了一份自动备份脚本具体步骤如下：
1.脚本文件
位置：/usr/systembak/backup.sh
内容：
#!/bin/sh
# File: /usr/systembak/backup.sh
# Database info
DB_USER=&#8221;dumpuser&#8221;
DB_PASS=&#8221;dumpuser&#8221;
# Others vars
<span class="readmore"><a href="http://www.tisswb.com/archives/515.html" title="Linux自动备份数据脚本" target="_blank">阅读全文——共1184字</a></span>]]></description>
			<content:encoded><![CDATA[<p>Linux如果天天手工备份真是太麻烦了，今天抽空写了一份自动备份脚本具体步骤如下：</p>
<p>1.脚本文件</p>
<p>位置：/usr/systembak/backup.sh</p>
<p>内容：</p>
<p>#!/bin/sh<br />
# File: /usr/systembak/backup.sh</p>
<p># Database info<br />
DB_USER=&#8221;dumpuser&#8221;<br />
DB_PASS=&#8221;dumpuser&#8221;</p>
<p># Others vars<br />
BIN_DIR=&#8221;/usr/bin&#8221;<br />
BCK_DIR=&#8221;/usr/systembak&#8221;<br />
WEB_DIR=&#8221;/var/www/html&#8221;<br />
DATA_DIR=&#8221;/var/lib/mysql&#8221;<br />
DATE=`date +%F`<br />
#FTP_SERV=&#8221;211.144.155.111&#8243;<br />
#FTP_USER=&#8221;username&#8221;<br />
#FTP_PASS=&#8221;12345678&#8243;<br />
#FTP_DIR=&#8221;"</p>
<p>#ZIP<br />
$BIN_DIR/mysqldump &#8211;opt -u$DB_USER -p$DB_PASS e23user | gzip &gt; $BCK_DIR/e23user_dump_$DATE.gz<br />
$BIN_DIR/mysqldump &#8211;opt -u$DB_USER -p$DB_PASS sdbbs | gzip &gt; $BCK_DIR/sdbbs_dump_$DATE.gz<br />
tar -czf $BCK_DIR/web_$DATE.tar.gz  $WEB_DIR<br />
tar -czf $BCK_DIR/e23user_$DATE.tar.gz  $DATA_DIR/e23user<br />
tar -czf $BCK_DIR/sdbbs_$DATE.tar.gz  $WEB_DIR/sdbbs</p>
<p>#UPLOAD<br />
#ftp -i -n $FTP_SERV &lt;&lt;FTP_END<br />
#user $FTP_USER $FTP_PASS<br />
#passive<br />
#binary<br />
#put $BCK_DIR/e23user_dump_$DATE.gz $FTP_DIR/e23user_dump_$DATE.gz<br />
#put $BCK_DIR/sdbbs_dump_$DATE.gz $FTP_DIR/sdbbs_dump_$DATE.gz<br />
#put $BCK_DIR/web_$DATE.tar.gz $FTP_DIR/web_$DATE.tar.gz<br />
#put $BCK_DIR/e23user_$DATE.tar.gz $FTP_DIR/e23user_$DATE.tar.gz<br />
#put $BCK_DIR/sdbbs_$DATE.tar.gz $FTP_DIR/sdbbs_$DATE.tar.gz<br />
#FTP_END</p>
<p>说明：由于没有远程备份服务器，所以UPLOAD部分暂时注释掉了，有了备份服务器只有即可去掉注释。</p>
<p>2.设置定时执行</p>
<p>修改文件：/etc/crontab</p>
<p>在最后添加：05 5 * * 0 root /usr/systembak/backup.sh</p>
<p>意义是在每周日的凌晨5点5分执行备份脚本</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/515.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ubuntu忘记密码和破解登陆密码</title>
		<link>http://www.tisswb.com/archives/482.html</link>
		<comments>http://www.tisswb.com/archives/482.html#comments</comments>
		<pubDate>Thu, 09 Apr 2009 08:39:12 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=482</guid>
		<description><![CDATA[如果谁说他的Linux从来没有遇到“疑难杂症”，我觉得是不可信的，就算是操作界面最友好的Window  XP也时常遇到各种各样的问题，有的问题实在蹊跷到只有更换硬件才能解决！Linux也是这样的，而且他的自由性，更是加大出问题的频繁程度。当然也是因  为Linux开源的特点，不管出了什么问题，你都可以在源代码级找到症结所在，这正是Linux魅力所在。
1、在不登录情况下，获得root权限
如果没有设置GRUB密码，那我们可以使用最简单的方法，首先启动电脑，等待GRUB菜单，如果GRUB菜单隐藏，可以按Esc调出， 选择Ubuntu,  kernel 2.6.12-*-* (recovery mode)，也就是“恢复模式”按Enter启动就可以了。 　　  　　另外一个办法是用Ubuntu安装盘获得root权限，用Ubuntu安装盘启动电脑，当显示“boot:”时，输入“rescue”
boot: rescue
<span class="readmore"><a href="http://www.tisswb.com/archives/482.html" title="ubuntu忘记密码和破解登陆密码" target="_blank">阅读全文——共1620字</a></span>]]></description>
			<content:encoded><![CDATA[<p>如果谁说他的Linux从来没有遇到“疑难杂症”，我觉得是不可信的，就算是操作界面最友好的Window  XP也时常遇到各种各样的问题，有的问题实在蹊跷到只有更换硬件才能解决！Linux也是这样的，而且他的自由性，更是加大出问题的频繁程度。当然也是因  为Linux开源的特点，不管出了什么问题，你都可以在源代码级找到症结所在，这正是Linux魅力所在。</p>
<p>1、在不登录情况下，获得root权限</p>
<p>如果没有设置GRUB密码，那我们可以使用最简单的方法，首先启动电脑，等待GRUB菜单，如果GRUB菜单隐藏，可以按Esc调出， 选择Ubuntu,  kernel 2.6.12-*-* (recovery mode)，也就是“恢复模式”按Enter启动就可以了。 　　  　　另外一个办法是用Ubuntu安装盘获得root权限，用Ubuntu安装盘启动电脑，当显示“boot:”时，输入“rescue”</p>
<p>boot: rescue</p>
<p>按屏幕提示操作就可以了。</p>
<p>2、通过改变内核启动参数获得根权限</p>
<p>启动电脑，等待GRUB菜单，如果GRUB菜单隐藏，可以按Esc调出，如果设置了GRUB密码，按p来解锁，比如我们选择了 Ubuntu, kernel  2.6.12-8-386，按e在启动前编辑启动参数，选择kernel /boot/vmlinuz-2.6.12-8-386 root=/dev/hda2 ro  quiet splash，按e编辑选定的启动菜单项，在参数最后添加rw init=/bin/bash，即改为如下命令行：</p>
<p>grub edit&gt; kernel /boot/vmlinuz-2.6.12-8-386 root=/dev/hda2 ro quiet  splash rw init=/bin/bash</p>
<p>按b启动即可。</p>
<p>3、忘记了root用户/主用户密码</p>
<p>按照第一项：在不登录情况下，获得root权限后，在命令行输入：</p>
<p>passwd root 　　 　　按照提示，输入两次密码就可以设定root用户密码了.</p>
<p>要更改主用户密码：</p>
<p>passwd system_main_username</p>
<p>按照提示，输入两次密码就可以了。</p>
<p>4、忘记了GRUB菜单密码</p>
<p>在命令行输入</p>
<p>grub 　　等提示符变为grub&gt; 后，输入： 　　md5crypt  　　这是计算密码的md5值，也就是加密值，然后在提示Password:后，输入新密码： 　　Password: ****** (ubuntu)  　　系统会计算出加密值： 　　Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 　　按quit退出</p>
<p>然后备份并编辑文件menu.lst： sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup  sudo gedit /boot/grub/menu.lst</p>
<p>找到</p>
<p>password &#8211;md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/</p>
<p>替换为</p>
<p>password &#8211;md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (这是我们上面计算出的加密值)</p>
<p>保存文件即可。</p>
<p>5、在安装Windows后恢复GRUB启动菜单</p>
<p>经常出现的情况是，我们想重装一下windows系统，但是重装会把启动Linux的菜单冲掉，这是个让人头疼的问题，我们这样来解决它：  　　首先按照第一项，用Ubuntu安装盘获得root权限，我们假定 /dev/hda 为 /boot 所在分区，然后在提示符输入：</p>
<p># grub-install /dev/hda</p>
<p>这样grub-install程序会为我们安装grub菜单。</p>
<p>6、在Windows中读取Linux分区(ext2, ext3)  　　我们用软件Ext2fs可以在Windows中读取Linux分区，软件官方首页：http://www.fs-  driver.org/index.html，下载地址是：http://www.fs- driver.org/download/Ext2IFS_1_10b.exe</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/482.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为ubuntu快速搭建C/C++编译环境</title>
		<link>http://www.tisswb.com/archives/306.html</link>
		<comments>http://www.tisswb.com/archives/306.html#comments</comments>
		<pubDate>Wed, 18 Mar 2009 15:48:09 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=306</guid>
		<description><![CDATA[　　虽然ubuntu提供的apt功能强悍无比，给大家一个很简单的入门linux的机会，但是有时候我们需要自己编译一下。但是Ubuntu缺省情况下，并没有提供C/C＋＋的编译环境，因此还需要手动安装。
　　如果单独安装gcc以及g++比较麻烦，幸运的是，为了能够编译Ubuntu的内核，Ubuntu提供了一个build-essential软件包。
　　查看该软件包的依赖关系，可以看到以下内容：
$ apt-cache depends build-essential
build-essential
依赖: libc6-dev
依赖:libc6-dev
依赖: gcc
依赖: g++
依赖: make
<span class="readmore"><a href="http://www.tisswb.com/archives/306.html" title="为ubuntu快速搭建C/C++编译环境" target="_blank">阅读全文——共411字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　虽然ubuntu提供的apt功能强悍无比，给大家一个很简单的入门linux的机会，但是有时候我们需要自己编译一下。但是Ubuntu缺省情况下，并没有提供C/C＋＋的编译环境，因此还需要手动安装。</p>
<p>　　如果单独安装gcc以及g++比较麻烦，幸运的是，为了能够编译Ubuntu的内核，Ubuntu提供了一个build-essential软件包。</p>
<p>　　查看该软件包的依赖关系，可以看到以下内容：</p>
<p><code>$ apt-cache depends build-essential<br />
build-essential<br />
依赖: libc6-dev<br />
依赖:libc6-dev<br />
依赖: gcc<br />
依赖: g++<br />
依赖: make<br />
依赖: dpkg-dev</code></p>
<p>　　也就是说，安装了该软件包，编译c/c++所需要的软件包也都会被安装。因此如果想在Ubuntu中编译c/c++程序，只需要安装该软件包就可以了。</p>
<p>　　安装方法如下：</p>
<p><code>$sudo apt-get install build-essential</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/306.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php安装模式mod_php和Fastcgi的选择与对比</title>
		<link>http://www.tisswb.com/archives/294.html</link>
		<comments>http://www.tisswb.com/archives/294.html#comments</comments>
		<pubDate>Sun, 15 Mar 2009 17:01:38 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=294</guid>
		<description><![CDATA[安装php又面临到了模式的选择，以前都是选择mod_php模式，因为这样安装比较方便哈，今天突然关心起FastCGI这种模式，败毒了一把，找到了一些关于mod_php和Fastcgi的选择与对比这方面的讨论，现在发出来留一个记号，以便进一步研究：
第一篇：php在apache中安装模式的区别：fastcgi和mod_php
    说到fastCgi就不得不说Cgi。
    CGI英文全称是 Common Gateway Interface，通常翻译为共同网关接口，是HTTP服务器与机器上的其他程序进行通信的一个接口。这个“其他程序”可以使用任何计算机语言来编写，它通过CGI这个接口从HTTP服务器取得输入，然后把运行的结果又通过CGI这个接口交给HTTP服务器，而HTTP服务器把这个结果送给浏览器。
    CGI的出现让WEB从静态变为为动态，随着Web的越来越普及，很多的网站的都需要有动态的页面，以便与浏览者互交。CGI方式的缺点也越来越突出。因为HTTP要生成一个动态页面，系统就必须启动一个新的进程以运行CGI程序，不断地fork是一项很消耗时间和资源的工作。这就出现了FastCGI。
<span class="readmore"><a href="http://www.tisswb.com/archives/294.html" title="php安装模式mod_php和Fastcgi的选择与对比" target="_blank">阅读全文——共3123字</a></span>]]></description>
			<content:encoded><![CDATA[<p>安装php又面临到了模式的选择，以前都是选择mod_php模式，因为这样安装比较方便哈，今天突然关心起FastCGI这种模式，败毒了一把，找到了一些关于mod_php和Fastcgi的选择与对比这方面的讨论，现在发出来留一个记号，以便进一步研究：</p>
<p>第一篇：<a href="http://www.tisswb.cn/wp-admin/read.php/150.htm" target="_blank">php在apache中安装模式的区别：fastcgi和mod_php</a></p>
<p>    说到fastCgi就不得不说Cgi。<br />
    CGI英文全称是 Common Gateway Interface，通常翻译为共同网关接口，是HTTP服务器与机器上的其他程序进行通信的一个接口。这个“其他程序”可以使用任何计算机语言来编写，它通过CGI这个接口从HTTP服务器取得输入，然后把运行的结果又通过CGI这个接口交给HTTP服务器，而HTTP服务器把这个结果送给浏览器。</p>
<p>    CGI的出现让WEB从静态变为为动态，随着Web的越来越普及，很多的网站的都需要有动态的页面，以便与浏览者互交。CGI方式的缺点也越来越突出。因为HTTP要生成一个动态页面，系统就必须启动一个新的进程以运行CGI程序，不断地fork是一项很消耗时间和资源的工作。这就出现了FastCGI。</p>
<p>   百度百科关于FastCGI</p>
<p><code>　1. FastCGI 像是一个常驻 (long-live) 型的 CGI，它可以一直执行着，只要激活后，不会每次都要花费时间去 fork 一次 (这是 CGI 最为人诟病的 fork-and-execute 模式)。<br />
　2. FastCGI 可在任何平台上使用，Netscape Enterprise 及 IIS 都有 FastCGI 的模块可供使用，阿帕契 (Apache，以及利用 Apache 衍生出做的服务器) 上也有 mod_fastcgi 可用。<br />
　3. FastCGI 支持 C/C++，Ruby, Perl，Tcl，Java，Python 等程序语言。<br />
　4. FastCGI 的应用程序亦兼容于 CGI。即 FastCGI 的应用程序也可以当成 CGI 来执行。<br />
　5. 现有的 CGI 程序要改写成 FastCGI 非常简单，最少可能只需要多加入三行程序代码。<br />
　6. FastCGI 的侦错方式与 CGI 大同小异，只要带入程序所需的环境变量及参数，即可在命令列模式执行或侦错。<br />
　7. FastCGI 应用程序的写作方式与 CGI 类似，除了几项原则要特别注意外，FastCGI 的写作方式跟 CGI 几乎一样，与学习 Web Server API 比较起来， FastCGI 简单多了。<br />
　8. FastCGI 支授分布式运算 (distributed computing)，即 FastCGI 程序可以在网站服务器以外的主机上执行并且接受来自其它网站服务器来的请求。</code></p>
<p>    mod_php就是把PHP做为APACHE一个内置模块。让apache http服务器本身能够支持PHP语言，不需要每一个请求就启动PHP解释器来解释PHP。</p>
<p>第二篇：<a href="http://hi.baidu.com/sprite_sy/blog/item/808adeca3cb14185c8176877.html" target="_blank">mod_php or fastcgi性能比较与选择</a></p>
<p>用php肯定少了不这个问题的选择，cgi自然就不必说了，但是mod_php和fastcgi的争论确还是比较多的。<br />
找了一些资料，晾在这，可供参考。<br />
首先，性能应该是大家最关心的问题了，除了mod_php和fastcgi 的 benchmark，还有一些服务器差别的测试，如apache vs lighthttpd</p>
<p>1 <a href="http://www.gnegg.ch/archives/305-mod_php,-LightTPD,-FastCGI-Whats-fastest.html" target="_blank">mod_php, LightTPD, FastCGI &#8211; What&#8217;s fastest?</a><br />
     这个bechmark的结果是 Apache(prefork)+Fastcgi+php的性能是最好的。超过了apache+mod_php，甚至也超过了lightty+fastcgi+php。当然，这个结果得出值相差都很小。另外，以上说的几个结果都使用了APC加速，使用APC后性能提高1倍以上。</p>
<p>2 <a href="http://www.meebey.net/projects/php4-mod-vs-cgi/" target="_blank">php4-mod-vs-cgi<br />
</a>   这个bechmark是在php4的环境下完成的。其<a href="http://www.meebey.net/projects/php4-mod-vs-cgi/summary.txt" target="_blank">summary.txt</a>的内容如下。<br />
<code>Summary of the benchmark<br />
------------------------</p>
<p>PHP4 module, very simple script (phpinfo.php): requests/s<br />
plain 130.04<br />
+turckcache 129.42<br />
+turckcache+zend-optimizer 125.50</p>
<p>PHP4 module, very complex script (insurance application): requests/s<br />
plain 1.84<br />
+turckcache 6.23<br />
+turckcache+zend-optimizer 5.58<br />
+optimizer 1.58</p>
<p>PHP4 CGI, very simple script (phpinfo.php): requests/s<br />
plain 22.69<br />
+turckcache n/a*<br />
+turckcache+zend-optimizer n/a*<br />
+optimizer 21.23</p>
<p>PHP4 CGI, very complex script (insurance application): requests/s<br />
plain 2.00<br />
+turckcache n/a*<br />
+turckcache+zend-optimizer n/a*<br />
+optimizer 1.72</p>
<p>* = turkcache doesn't support caching of the PHP scripts in CGI mode</code><br />
上面的结果我觉得需要关注的是无cache的情况，因为使用mod_php或fastcgi主要还是用来生成动态页面。前面的cache有更好的工具来实现，如squid。所以，这个结果也是fastcgi胜出，相差也不大。</p>
<p>3 <a href="http://buytaert.net/drupal-performance?page=1" target="_blank">http://buytaert.net/drupal-performance?page=1</a><br />
   这个文章的结果和上面两个刚好相反。使用fastcgi代替mod_php后，&#8221;When switching from <code>mod_php</code> to <code>FastCGI</code> we observe a 63% slowdown for anonymous visitors, and a 18% slowdown for authenticated visitors.&#8221;以下是图表</p>
<div><a href="http://buytaert.net/images/drupal/drupal-4.7-fastcgi-vs-mod_php.jpg" target="_blank"><img class="blogimg" src="http://buytaert.net/images/drupal/drupal-4.7-fastcgi-vs-mod_php.jpg" border="0" alt="" /></a></div>
<p>另外，benchmark中也做了和lightty的比较，如下图：</p>
<div><a href="http://buytaert.net/images/drupal/drupal-4.7-apache-vs-lighttpd.jpg" target="_blank"><img class="blogimg" src="http://buytaert.net/images/drupal/drupal-4.7-apache-vs-lighttpd.jpg" border="0" alt="" /></a></div>
<p>这个文章的结论是Apache+mod_php性能好于Apache+fastcgi。另外，Apache+mod_php略好于lightty+fastcgi。</p>
<p>4 最后看看 <a href="http://www.fastcgi.com/devkit/doc/fcgi-perf.htm#S2" target="_blank">fastcgi</a>官方自己怎么说的吧<br />
    Of course, the answer is that it depends upon the application. A more complete answer is that FastCGI often wins by a significant margin, and seldom loses by very much.</p>
<p>5 结论是，还是根据自己的应用测一下吧&#8230;.</p>
<p>最后,个人观点<br />
如果mod_php和fastcgi的性能相差不是很大的话，还是倾向于fastcgi的，这种方式毕竟更灵活、安全和简单。<br />
1 使用fastcgi，你的web server 可以比较简单的切换，可以测试不同的服务器，Apache,lightty,ngix 等等，不需要有代码的修改<br />
2 如果想换脚本的实现，如不用php，而是改成perl,python之类的，web服务器也不需要任何的改动<br />
3 web server和fastcgi可以用不同的帐号运行，带来了一定的安全隔离<br />
4 只在Apache中编个mod_fastcgi可以说是简单多了，把mod_php编进apache时，出问题时很难定位是php的问题还是apache的问题，我就见过这样的core，函数调用几十层，一点头绪都没有</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/294.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>freebsd+discuz解决无法上传图片的方法</title>
		<link>http://www.tisswb.com/archives/291.html</link>
		<comments>http://www.tisswb.com/archives/291.html#comments</comments>
		<pubDate>Sun, 15 Mar 2009 16:45:59 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[discuz]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=291</guid>
		<description><![CDATA[今天维护dz发现无法上传图片，由于是更换的新服务器，所以怀疑是环境没有配置正确。
检查发现：
1.discuz下目录属性是正常的
2.discuz后台设置没有任何问题，具体可以搜索附件设置功能
3.php.ini中upload_tmp_dir  没有设定目录
于是在php.ini中配置好了upload_tmp_dir的路径为/tmp。重启apache，这样可以重新加载php.ini，重启完成后，可以正常上传了。
]]></description>
			<content:encoded><![CDATA[<p>今天维护dz发现无法上传图片，由于是更换的新服务器，所以怀疑是环境没有配置正确。</p>
<p>检查发现：</p>
<p>1.discuz下目录属性是正常的</p>
<p>2.discuz后台设置没有任何问题，具体可以搜索附件设置功能</p>
<p>3.php.ini中upload_tmp_dir  没有设定目录</p>
<p>于是在php.ini中配置好了upload_tmp_dir的路径为/tmp。重启apache，这样可以重新加载php.ini，重启完成后，可以正常上传了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/291.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>discuz 伪静态开启需要注意的地方</title>
		<link>http://www.tisswb.com/archives/289.html</link>
		<comments>http://www.tisswb.com/archives/289.html#comments</comments>
		<pubDate>Sun, 15 Mar 2009 16:38:42 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[discuz]]></category>
		<category><![CDATA[URL静态化]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=289</guid>
		<description><![CDATA[discuz的安装说明里虽然已经有很详细的设置伪静态的方法。有很多人按照官方的设置，还是不能顺利开启伪静态化。其实原因是多方面的，今天我就遇到了一个这样的问题，最后解决了这个问题，现在给大家总结一下后台开启伪静态失败后检查的主要步骤与解决方法：
1.按照官方的说明文件，开启服务器的rewrite功能或者与服务商联系开启一些必要的功能。这些可以详细查阅官方说明文件，再此略过。
2.如果按照说明无法开启伪静态一般有两种结果：第一种、无法打开列表页，这种应该是重写规则没有设置到正确的位置；第二种、开启完全无效，还是完全的动态地址，这种情况一般是使用了其他的模板风格或者修改模板造成的，解决方法很简单，就是在模板的footer.html里面body里面添加{eval output();}，这个是discuz控制重写的一个必须的部分。因此，在开启伪静态的时候，最好先切换的默认的模板，看看是否已经成功，如果成功就能确定是新模板的问题了。
]]></description>
			<content:encoded><![CDATA[<p>discuz的安装说明里虽然已经有很详细的设置伪静态的方法。有很多人按照官方的设置，还是不能顺利开启伪静态化。其实原因是多方面的，今天我就遇到了一个这样的问题，最后解决了这个问题，现在给大家总结一下后台开启伪静态失败后检查的主要步骤与解决方法：</p>
<p>1.按照官方的说明文件，开启服务器的rewrite功能或者与服务商联系开启一些必要的功能。这些可以详细查阅官方说明文件，再此略过。</p>
<p>2.如果按照说明无法开启伪静态一般有两种结果：第一种、无法打开列表页，这种应该是重写规则没有设置到正确的位置；第二种、开启完全无效，还是完全的动态地址，这种情况一般是使用了其他的模板风格或者修改模板造成的，解决方法很简单，就是在模板的footer.html里面body里面添加{eval output();}，这个是discuz控制重写的一个必须的部分。因此，在开启伪静态的时候，最好先切换的默认的模板，看看是否已经成功，如果成功就能确定是新模板的问题了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/289.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>调整更改ubuntu时区,时间,locale</title>
		<link>http://www.tisswb.com/archives/241.html</link>
		<comments>http://www.tisswb.com/archives/241.html#comments</comments>
		<pubDate>Thu, 12 Feb 2009 03:56:40 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=241</guid>
		<description><![CDATA[更改时区，时间
执行
tzselect
按照提示进行选择时区
sudo cp /usr/share/zoneinfo/Asia/ShangHai /etc/localtime
执行
sudo ntpdate cn.pool.ntp.org
cn.pool.ntp.org是位于中国的公共NTP服务器，用来同步你的时间
时间
sudo date -s 20080701
<span class="readmore"><a href="http://www.tisswb.com/archives/241.html" title="调整更改ubuntu时区,时间,locale" target="_blank">阅读全文——共1233字</a></span>]]></description>
			<content:encoded><![CDATA[<h1>更改时区，时间</h1>
<p>执行<br />
<code>tzselect</code><br />
按照提示进行选择时区<br />
<code>sudo cp /usr/share/zoneinfo/Asia/ShangHai /etc/localtime</code><br />
执行<br />
<code>sudo ntpdate cn.pool.ntp.org</code><br />
cn.pool.ntp.org是位于中国的公共NTP服务器，用来同步你的时间</p>
<p>时间<br />
sudo date -s 20080701</p>
<h1>更在locale</h1>
<p>修改/var/lib/locales/supported.d/local</p>
<p>比如:<br />
　　en_US.UTF-8 UTF-8<br />
　　zh_CN.UTF-8 UTF-8<br />
　　zh_CN.GBK GBK<br />
　　zh_CN GB2312</p>
<p>然后运行locale-gen就可以了。</p>
<p>或sudo dpkg-reconfigure locales</p>
<h1>怎样设定locale呢？</h1>
<p>设定locale就是设定12大类的locale分类属性，即 12个LC_*。除了这12个变量可以设定以外，为了简便起见，还有两个变量：LC_ALL和LANG。它们之间有一个优先级的关系：<br />
LC_ALL&gt;LC_*&gt;LANG<br />
可以这么说，LC_ALL是最上级设定或者强制设定，而LANG是默认设定值。<br />
1、如果你设定了LC_ALL＝zh_CN.UTF-8，那么不管LC_*和LANG设定成什么值，它们都会被强制服从LC_ALL的设定，成为 zh_CN.UTF-8。<br />
2、假如你设定了LANG＝zh_CN.UTF-8，而其他的LC_*=en_US.UTF-8，并且没有设定LC_ALL的话，那么系统的locale设定以LC_*=en_US.UTF-8。<br />
3、假如你设定了LANG＝zh_CN.UTF-8，而其他的LC_*，和LC_ALL均未设定的话，系统会将LC_*设定成默认值，也就是LANG的值 zh_CN.UTF-8 。<br />
4、假如你设定了LANG＝zh_CN.UTF-8，而其他的LC_CTYPE=en_US.UTF-8，其他的LC_*，和LC_ALL均未设定的话，那么系统的locale设定将是：LC_CTYPE=en_US.UTF-8，其余的 LC_COLLATE，LC_MESSAGES等等均会采用默认值，也就是LANG的值，也就是LC_COLLATE＝LC_MESSAGES＝……＝ LC_PAPER＝LANG＝zh_CN.UTF-8。</p>
<p>所以，locale是这样设定的：<br />
1、如果你需要一个纯中文的系统的话，设定LC_ALL= zh_CN.XXXX，或者LANG= zh_CN.XXXX都可以，当然你可以两个都设定，但正如上面所讲，LC_ALL的值将覆盖所有其他的locale设定，不要作无用功。<br />
2、如果你只想要一个可以输入中文的环境，而保持菜单、标题，系统信息等等为英文界面，那么只需要设定 LC_CTYPE＝zh_CN.XXXX，LANG=en_US.XXXX就可以了。这样LC_CTYPE＝zh_CN.XXXX，而 LC_COLLATE＝LC_MESSAGES＝……＝ LC_PAPER＝LANG＝en_US.XXXX。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/241.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux服务器优化的一点点心得</title>
		<link>http://www.tisswb.com/archives/223.html</link>
		<comments>http://www.tisswb.com/archives/223.html#comments</comments>
		<pubDate>Sun, 21 Dec 2008 14:54:43 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=223</guid>
		<description><![CDATA[最近终于给自己弄了一台服务器，操作系统是linux的，把自己的博客，还有一个linux论坛赶紧迁移了上去，一开始感觉相当爽，毕竟一个服务器就自己一个人用，那感觉相当的爽哈。可是没几天，麻烦事情就来了：服务器越来越慢，打开我的博客和论坛，速度都是出奇的慢，一开始我以为是机器的问题，毕竟是个奔三的服务器，有6年的历史了。
今天问了一个服务器方面的专家朋友，他看了看我的设置，给了我一个建议，打开像Gzip一类的服务器压缩模块和增加服务器缓存试一试。
于是我就到网上查找相关资料，我的服务器操作系统是ubuntu8.04。
然后我打开了apapche的mem_cache和deflate模块，命令分别是：
sudo a2enmod mem_cache
sudo a2enmod deflate
然后重启apache
这两个模块的设置我没有修改，先测试再说。
然后我又到网上找到了开启wordpress2.7和discuz7的Gzip的方法，照着做了一遍。
<span class="readmore"><a href="http://www.tisswb.com/archives/223.html" title="linux服务器优化的一点点心得" target="_blank">阅读全文——共441字</a></span>]]></description>
			<content:encoded><![CDATA[<p>最近终于给自己弄了一台服务器，操作系统是linux的，把自己的<a href="http://www.tisswb.cn">博客</a>，还有一个<a href="http://www.nowlinux.cn" target="_blank">linux论坛</a>赶紧迁移了上去，一开始感觉相当爽，毕竟一个服务器就自己一个人用，那感觉相当的爽哈。可是没几天，麻烦事情就来了：服务器越来越慢，打开我的<a href="http://www.tisswb.cn" target="_self">博客</a>和<a href="http://www.nowlinux.cn">论坛</a>，速度都是出奇的慢，一开始我以为是机器的问题，毕竟是个奔三的服务器，有6年的历史了。</p>
<p>今天问了一个服务器方面的专家朋友，他看了看我的设置，给了我一个建议，打开像Gzip一类的服务器压缩模块和增加服务器缓存试一试。</p>
<p>于是我就到网上查找相关资料，我的服务器操作系统是ubuntu8.04。</p>
<p>然后我打开了apapche的mem_cache和deflate模块，命令分别是：</p>
<p>sudo a2enmod mem_cache<br />
sudo a2enmod deflate</p>
<p>然后重启apache</p>
<p>这两个模块的设置我没有修改，先测试再说。</p>
<p>然后我又到网上找到了开启wordpress2.7和discuz7的Gzip的方法，照着做了一遍。</p>
<p>在来访问我的网站，hoho速度果然快了，快了好多～～～～</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/223.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vsftpd.conf中的配置信息详解</title>
		<link>http://www.tisswb.com/archives/205.html</link>
		<comments>http://www.tisswb.com/archives/205.html#comments</comments>
		<pubDate>Fri, 14 Nov 2008 08:22:16 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[vsftp]]></category>
		<category><![CDATA[vsftpd.conf]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=205</guid>
		<description><![CDATA[　　Anonymous_enable=yes (允许匿名登陆)
　　Dirmessage_enable=yes （切换目录时，显示目录下.message的内容）
　　Local_umask=022 (FTP上本地的文件权限，默认是077)
　　Connect_form_port_20=yes （启用FTP数据端口的数据连接）*
　　Xferlog_enable=yes （激活上传和下传的日志）
　　Xferlog_std_format=yes (使用标准的日志格式)
　　Ftpd_banner=XXXXX （欢迎信息）
　　Pam_service_name=vsftpd （验证方式）*
　　Listen=yes （独立的VSFTPD服务器）*
　　Anon_upload_enable=yes (开放上传权限)
<span class="readmore"><a href="http://www.tisswb.com/archives/205.html" title="vsftpd.conf中的配置信息详解" target="_blank">阅读全文——共1970字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　Anonymous_enable=yes (允许匿名登陆)</p>
<p>　　Dirmessage_enable=yes （切换目录时，显示目录下.message的内容）</p>
<p>　　Local_umask=022 (FTP上本地的文件权限，默认是077)</p>
<p>　　Connect_form_port_20=yes （启用FTP数据端口的数据连接）*</p>
<p>　　Xferlog_enable=yes （激活上传和下传的日志）</p>
<p>　　Xferlog_std_format=yes (使用标准的日志格式)</p>
<p>　　Ftpd_banner=XXXXX （欢迎信息）</p>
<p>　　Pam_service_name=vsftpd （验证方式）*</p>
<p>　　Listen=yes （独立的VSFTPD服务器）*</p>
<p>　　Anon_upload_enable=yes (开放上传权限)</p>
<p>　　Anon_mkdir_write_enable=yes （可创建目录的同时可以在此目录中上传文件）</p>
<p>　　Write_enable=yes (开放本地用户写的权限)</p>
<p>　　Anon_other_write_enable=yes (匿名帐号可以有删除的权限)</p>
<p>　　Anon_world_readable_only=no (放开匿名用户浏览权限)</p>
<p>　　Ascii_upload_enable=yes (启用上传的ASCII传输方式)</p>
<p>　　Ascii_download_enable=yes (启用下载的ASCII传输方式)</p>
<p>　　Banner_file=/var/vsftpd_banner_file (用户连接后欢迎信息使用的是此文件中的相关信息)</p>
<p>　　Idle_session_timeout=600(秒) （用户会话空闲后10分钟）</p>
<p>　　Data_connection_timeout=120（秒） （将数据连接空闲2分钟断）</p>
<p>　　Accept_timeout=60（秒） （将客户端空闲1分钟后断）</p>
<p>　　Connect_timeout=60（秒） （中断1分钟后又重新连接）</p>
<p>　　Local_max_rate=50000（bite） （本地用户传输率50K）</p>
<p>　　Anon_max_rate=30000（bite） （匿名用户传输率30K）</p>
<p>　　Pasv_min_port=50000 （将客户端的数据连接端口改在</p>
<p>　　Pasv_max_port=60000 50000—60000之间）</p>
<p>　　Max_clients=200 （FTP的最大连接数）</p>
<p>　　Max_per_ip=4 （每IP的最大连接数）</p>
<p>　　Listen_port=5555 （从5555端口进行数据连接）</p>
<p>　　Local_enble=yes （本地帐户能够登陆）</p>
<p>　　Write_enable=no （本地帐户登陆后无权删除和修改文件）</p>
<p>　　这是一组</p>
<p>　　Chroot_local_user=yes （本地所有帐户都只能在自家目录）</p>
<p>　　Chroot_list_enable=yes （文件中的名单可以调用）</p>
<p>　　Chroot_list_file=/任意指定的路径/vsftpd.chroot_list</p>
<p>　　（前提是chroot_local_user=no）</p>
<p>　　这又是一组</p>
<p>　　Userlist_enable=yes （在指定的文件中的用户不可以访问）</p>
<p>　　Userlist_deny=yes</p>
<p>　　Userlist_file=/指定的路径/vsftpd.user_list</p>
<p>　　又开始单的了</p>
<p>　　Banner_fail=/路径/文件名 （连接失败时显示文件中的内容）</p>
<p>　　Ls_recurse_enable=no</p>
<p>　　Async_abor_enable=yes</p>
<p>　　One_process_model=yes</p>
<p>　　Listen_address=10.2.2.2 （将虚拟服务绑定到某端口）</p>
<p>　　Guest_enable=yes (虚拟用户可以登陆)</p>
<p>　　Guest_username=所设的用户名 （将虚拟用户映射为本地用户）</p>
<p>　　User_config_dir=/任意指定的路径/为用户策略自己所建的文件夹</p>
<p>　　(指定不同虚拟用户配置文件的路径)</p>
<p>　　又是一组</p>
<p>　　Chown_uploads=yes （改变上传文件的所有者为root）</p>
<p>　　Chown_username=root</p>
<p>　　又是一组</p>
<p>　　Deny_email_enable=yes (是否允许禁止匿名用户使用某些邮件地址)</p>
<p>　　Banned_email_file=//任意指定的路径/xx/</p>
<p>　　又是单的</p>
<p>　　Pasv_enable=yes （ 服务器端用被动模式）</p>
<p>　　User_config_dir=/任意指定的路径//任意文件目录 (指定虚拟用户存放配置文件的路径)</p>
<p>有一点需要注意，配置文件中不能有多余的空行，特别是每行结尾处，否则会出现无法登陆的错误</p>
<p>可以使用 sed -n &#8217;1,$l&#8217; vsftpd.conf   命令查看vsftpd.conf文件，检查每一行结尾是否出现多余空格。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/205.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FreeBSD7.0用ports安装apache+php+mysql</title>
		<link>http://www.tisswb.com/archives/201.html</link>
		<comments>http://www.tisswb.com/archives/201.html#comments</comments>
		<pubDate>Wed, 12 Nov 2008 05:13:39 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=201</guid>
		<description><![CDATA[网上有很多介绍apache+php+mysql安装的教程，但大多都是基于源代码编译或者给予RPM包的方式，对于FreeBSD自带的ports安装很少见到，有方便的干嘛弄得复杂呢？
首先确定主机联网
cvsup -h cvsup.freebsd.org /usr/share/example/cvsup/ports-supfile #同步ports
cd /usr/ports/databases/mysql50-server/
make install clean # n长的编译过程
rehash
cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf #由于我这台机器以pgsql为主所以使用小内存模式
mysql_install_db -u mysql ; mysqld_safe -u mysql &#038;
cd /usr/ports/www/apache2/
<span class="readmore"><a href="http://www.tisswb.com/archives/201.html" title="FreeBSD7.0用ports安装apache+php+mysql" target="_blank">阅读全文——共939字</a></span>]]></description>
			<content:encoded><![CDATA[<p>网上有很多介绍apache+php+mysql安装的教程，但大多都是基于源代码编译或者给予RPM包的方式，对于FreeBSD自带的ports安装很少见到，有方便的干嘛弄得复杂呢？<br />
首先确定主机联网<br />
cvsup -h cvsup.freebsd.org /usr/share/example/cvsup/ports-supfile #同步ports<br />
cd /usr/ports/databases/mysql50-server/<br />
make install clean # n长的编译过程<br />
rehash<br />
cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf #由于我这台机器以pgsql为主所以使用小内存模式<br />
mysql_install_db -u mysql ; mysqld_safe -u mysql &#038;<br />
cd /usr/ports/www/apache2/<br />
make install clean<br />
cd ../mod_php5<br />
make install clean<br />
在/usr/local/etc/apache/httpd.conf中加一句：<br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps #可不加<br />
rehash<br />
apachectl start<br />
echo &#8220;< ?php phpinfo() ?>&#8221; > /usr/loacl/www/data/info.php<br />
如果启动成功并能显示lynx http://localhost/info.php说明基本的 php+apache2已经工作正常！<br />
cd /usr/port/lang/php5-extensions/<br />
make install clean #如果第一次安装会出现提示框，否则先make conf设置<br />
选择需要的模块，当然也可以选择必须的，日后再添加。<br />
apachectl restart<br />
如果lynx http://localhost/info.php有改动，恭喜你！安装成功！！<br />
后续工作：<br />
echo &#8216; mysql_enable = &#8220;YES&#8221; &#8216; >> /etc/rc.conf<br />
echo &#8216; apache2_enable=&#8221;YES&#8221; &#8216; >> /etc/rc.conf<br />
#以便开机后自动启动mysql apache </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/201.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD安装配置Ports详解</title>
		<link>http://www.tisswb.com/archives/194.html</link>
		<comments>http://www.tisswb.com/archives/194.html#comments</comments>
		<pubDate>Wed, 12 Nov 2008 02:35:45 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=194</guid>
		<description><![CDATA[在您能使用 ports 之前， 您必须先获得 Ports Collection ── 本质上是 /usr/ports 目录下的一堆 Makefile、补丁和描述文件。
在您安装 FreeBSD 系统的时候， sysinstall 会询问您是否需要安装 Ports Collection。 如果您选择 no， 那您可以用下面的指令来安装 Ports Collection：
CVSup 方法
保持您本地 Ports 套件最新的一种快捷的方法， 是使用 CVSup 来进行更新。 如果您希望了解更多关于 CVSup 的细节， 请参见 使用 CVSup。
注意: csup 是用 C 语言对 CVSup 软件的重写， 在 FreeBSD 6.2 和更高版本中，作为系统的一部分提供。 您可以直接使用系统附带的 csup 而跳过 #1 这一步， 并将这份文档余下部分中的 cvsup 命令改为 csup。 对于较早版本而言， 可以使用 net/csup port 或预编译包来安装 csup。
<span class="readmore"><a href="http://www.tisswb.com/archives/194.html" title="FreeBSD安装配置Ports详解" target="_blank">阅读全文——共1938字</a></span>]]></description>
			<content:encoded><![CDATA[<p>在您能使用 ports 之前， 您必须先获得 Ports Collection ── 本质上是 /usr/ports 目录下的一堆 Makefile、补丁和描述文件。</p>
<p>在您安装 FreeBSD 系统的时候， sysinstall 会询问您是否需要安装 Ports Collection。 如果您选择 no， 那您可以用下面的指令来安装 Ports Collection：</p>
<p>CVSup 方法<br />
保持您本地 Ports 套件最新的一种快捷的方法， 是使用 CVSup 来进行更新。 如果您希望了解更多关于 CVSup 的细节， 请参见 使用 CVSup。</p>
<p>注意: csup 是用 C 语言对 CVSup 软件的重写， 在 FreeBSD 6.2 和更高版本中，作为系统的一部分提供。 您可以直接使用系统附带的 csup 而跳过 #1 这一步， 并将这份文档余下部分中的 cvsup 命令改为 csup。 对于较早版本而言， 可以使用 net/csup port 或预编译包来安装 csup。</p>
<p>在首次运行 CVSup 之前， 务必确认 /usr/ports 是空的！ 如果您之前已经用其他地方安装了一份 Ports 套件，则 CVSup 可能不会自动删除已经在上游服务器上删除掉的补丁文件。</p>
<p>安装 net/cvsup-without-gui 软件包：<br />
# pkg_add -r cvsup-without-gui<br />
请参见 如何安装 CVSup (第 A.5.2 节) 以了解更多细节。</p>
<p>启用cvsup命令<br />
#rehash</p>
<p>运行 cvsup：<br />
# cvsup -L 2 -h cvsup.FreeBSD.org /usr/share/examples/cvsup/ports-supfile<br />
将 cvsup.FreeBSD.org 改为离您较近的 CVSup 服务器。 请参见 CVSup 镜像 (第 A.5.7 节) 中的镜像站点完整列表。</p>
<p>注意: 有时可能希望使用自己的 ports-supfile， 比如说，不想每次都通过命令行来指定所使用的 CVSup 服务器。</p>
<p>这种情况下， 需要以 root 身份将 /usr/share/examples/cvsup/ports-supfile 复制到新的位置， 例如 /root 或您的主目录。<br />
编辑 ports-supfile。<br />
把 CHANGE_THIS.FreeBSD.org 修改成离您较近的 CVSup 服务器。 可以参考 CVSup 镜像 (第 A.5.7 节) 中的镜像站点完整列表。</p>
<p>接下来按如下的方式运行 cvsup：<br />
# cvsup -L 2 /root/ports-supfile</p>
<p>此后运行 cvsup(1) 命令将下载最近所进行的改动， 并将它们应用到您的 Ports Collection 上，不过这一过程并不重新联编您系统上的 ports。</p>
<p>Portsnap 方式<br />
Portsnap 是另一种用于发布 Ports 套件的方法。 它最早从 FreeBSD 6.0 开始引入。 在较早的系统中， 您可以通过 ports-mgmt/portsnap package 来安装它：<br />
# pkg_add -r portsnap<br />
请参见 使用 Portsnap 以了解关于全部 Portsnap 功能的详细描述。</p>
<p>如果您使用 FreeBSD 6.1-RELEASE， 或通过 port 或 package 安装了较新版本的 Portsnap 的话， 可以直接跳过这一步。 /usr/ports 将在首次使用 portsnap(8) 命令时自动创建。 而如果您使用的是较早期版本的 Portsnap，就只能手工创建空的 /usr/ports 目录了。<br />
# mkdir /usr/ports<br />
下载压缩的 Ports 套件快照到 /var/db/portsnap。您可以根据需要在这之后关闭 Internet 连接。<br />
# portsnap fetch</p>
<p>假如您是首次运行 Portsnap， 则需要将快照释放到 /usr/ports：<br />
# portsnap extract<br />
如果您已经有装好的 /usr/ports 而您只想更新，则应执行下面的命令：<br />
# portsnap update</p>
<p>Sysinstall 方式<br />
这种方法需要使用 sysinstall 从安装介质上安装 Ports 套件。注意， 安装的将是发布发行版时的旧版 Ports 套件。 如果您能访问 Internet，应使用前面介绍的方法之一。</p>
<p>以 root 身份运行 sysinstall (对 FreeBSD 5.2 之前的版本， 应执行 /stand/sysinstall)：<br />
# sysinstall<br />
用光标向下选择 Configure， 并按 Enter。<br />
向下并选择 Distributions， 按 Enter。<br />
选择 ports， 并按 Space。<br />
选择 Exit， 并按 Enter。<br />
选择所希望的安装介质， 例如 CDROM、 FTP， 等等。<br />
选择 Exit 并按 Enter。</p>
<p>按 X 退出 sysinstall。</p>
<p>参考文章：<a href="http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/handbook/cvsup.html#CVSUP-INSTALL">http://cnsnap.cn.freebsd.org/doc/zh_CN.GB2312/books/handbook/cvsup.html#CVSUP-INSTALL</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/194.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apt和dpkg快速参考</title>
		<link>http://www.tisswb.com/archives/184.html</link>
		<comments>http://www.tisswb.com/archives/184.html#comments</comments>
		<pubDate>Fri, 31 Oct 2008 08:02:46 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=184</guid>
		<description><![CDATA[apt-cache search # &#8212;&#8212;(package 搜索包)
apt-cache show #&#8212;&#8212;(package 获取包的相关信息，如说明、大小、版本等)
sudo apt-get install # &#8212;&#8212;(package 安装包)
sudo apt-get install # &#8212;&#8211;(package &#8211; - reinstall 重新安装包)
sudo apt-get -f install # &#8212;&#8211;(强制安装?#&#8221;-f = &#8211;fix-missing&#8221;当是修复安装吧&#8230;)
sudo apt-get remove #&#8212;&#8211;(package 删除包)
sudo apt-get remove &#8211; - purge # &#8212;&#8212;(package 删除包，包括删除配置文件等)
<span class="readmore"><a href="http://www.tisswb.com/archives/184.html" title="Apt和dpkg快速参考" target="_blank">阅读全文——共3453字</a></span>]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">apt-cache search # &#8212;&#8212;(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">搜索包</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
apt-cache show #&#8212;&#8212;(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">获取包的相关信息，如说明、大小、版本等</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
sudo apt-get install # &#8212;&#8212;(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">安装包</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
sudo apt-get install # &#8212;&#8211;(package &#8211; - reinstall </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">重新安装包</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
sudo apt-get -f install # &#8212;&#8211;(</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">强制安装</span><span lang="EN-US"><span style="font-family: Calibri;">?#&#8221;-f = &#8211;fix-missing&#8221;</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">当是修复安装吧</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">&#8230;)<br />
sudo apt-get remove #&#8212;&#8211;(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">删除包</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
sudo apt-get remove &#8211; - purge # &#8212;&#8212;(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">删除包，包括删除配置文件等</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
sudo apt-get autoremove &#8211;purge # &#8212;-(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">删除包及其依赖的软件包</span><span lang="EN-US"><span style="font-family: Calibri;">+</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">配置文件等（只对</span><span lang="EN-US"><span style="font-family: Calibri;">6.10</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">有效，强烈推荐）</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
sudo apt-get update #&#8212;&#8212;</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">更新源</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">sudo apt-get upgrade #&#8212;&#8212;</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">更新已安装的包</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">sudo apt-get dist-upgrade # &#8212;&#8212;&#8212;</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">升级系统</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">sudo apt-get dselect-upgrade #&#8212;&#8212;</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">使用</span><span lang="EN-US"><span style="font-family: Calibri;"> dselect </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">升级</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">apt-cache depends #&#8212;&#8212;-(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">了解使用依赖</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
apt-cache rdepends # &#8212;&#8212;(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">了解某个具体的依赖</span><span lang="EN-US"><span style="font-family: Calibri;">?#</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">当是查看该包被哪些包依赖吧</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">&#8230;)<br />
sudo apt-get build-dep # &#8212;&#8212;(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">安装相关的编译环境</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
apt-get source #&#8212;&#8212;(package </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">下载该包的源代码</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)<br />
sudo apt-get clean &amp;&amp; sudo apt-get autoclean # &#8212;&#8212;&#8211;</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">清理下载文件的存盘</span><span lang="EN-US"><span style="font-family: Calibri;"> &amp;&amp; </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">只清理过时的包</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">sudo apt-get check #&#8212;&#8212;-</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">检查是否有损坏的依赖</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">apt-get install<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">下载</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">以及所有倚赖的包裹，同时进行包裹的安装或升级。如果某个包裹被设置了</span><span lang="EN-US"><span style="font-family: Calibri;"> hold (</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">停止标志，就会被搁在一边</span><span lang="EN-US"><span style="font-family: Calibri;">(</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">即不会被升级</span><span lang="EN-US"><span style="font-family: Calibri;">)</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。更多</span><span lang="EN-US"><span style="font-family: Calibri;"> hold </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">细节请看下面。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">apt-get remove [--purge]<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">移除</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">以及任何倚赖这个包裹的其它包裹。</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">&#8211;purge </span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">指明这个包裹应该被完全清除</span><span lang="EN-US"><span style="font-family: Calibri;"> (purged) </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">，更多信息请看</span><span lang="EN-US"><span style="font-family: Calibri;"> dpkg -P</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">apt-get update<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">升级来自</span><span lang="EN-US"><span style="font-family: Calibri;"> Debian </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">镜像的包裹列表，如果你想安装当天的任何软件，至少每天运行一次，而且每次修改了</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">/etc/apt/sources.list </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">后，必须执行。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">apt-get upgrade [-u]<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">升级所以已经安装的包裹为最新可用版本。不会安装新的或移除老的包裹。如果一个包改变了倚赖关系而需要安装一个新的包裹，那么它将不会被升级，而是标志为</span><span lang="EN-US"><span style="font-family: Calibri;"> hold</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。</span><span lang="EN-US"><span style="font-family: Calibri;">apt-get update </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">不会升级被标志为</span><span lang="EN-US"><span style="font-family: Calibri;"> hold </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的包裹</span><span lang="EN-US"><span style="font-family: Calibri;"> (</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">这个也就是</span><span lang="EN-US"><span style="font-family: Calibri;"> hold </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的意思</span><span lang="EN-US"><span style="font-family: Calibri;">)</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。请看下文如何手动设置包裹为</span><span lang="EN-US"><span style="font-family: Calibri;"> hold</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。我建议同时使用</span><span lang="EN-US"><span style="font-family: Calibri;"> &#8216;-u&#8217; </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">选项，因为这样你就能看到哪些包裹将会被升级。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">apt-get dist-upgrade [-u]<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">和</span><span lang="EN-US"><span style="font-family: Calibri;"> apt-get upgrade </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">类似，除了</span><span lang="EN-US"><span style="font-family: Calibri;"> dist-upgrade </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">会安装和移除包裹来满足倚赖关系。因此具有一定的危险性。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">apt-cache search<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">搜索满足</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的包裹和描述。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">apt-cache show<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">显示</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的完整的描述。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">apt-cache showpkg<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">显示</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">许多细节，以及和其它包裹的关系。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dselect<br />
console-apt<br />
aptitude<br />
gnome-apt<br />
APT </span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的几个图形前端</span><span lang="EN-US"><span style="font-family: Calibri;">(</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">其中一些在使用前得先安装</span><span lang="EN-US"><span style="font-family: Calibri;">)</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。这里</span><span lang="EN-US"><span style="font-family: Calibri;"> dselect </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">无疑是最强大的，也是最古老，最难驾驭。</span></span><span lang="EN-US"></p>
<p></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">普通</span><span lang="EN-US"><span style="font-family: Calibri;"> Dpkg </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">用法</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">dpkg -i<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">安装一个</span><span lang="EN-US"><span style="font-family: Calibri;"> Debian </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">包裹文件，如你手动下载的文件。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg -c<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">列出</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的内容。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg -I<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">从</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中提取包裹信息。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg -r<br />
</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">移除一个已安装的包裹。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg -P<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">完全清除一个已安装的包裹。和</span><span lang="EN-US"><span style="font-family: Calibri;"> remove </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">不同的是，</span><span lang="EN-US"><span style="font-family: Calibri;">remove </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">只是删掉数据和可执行文件，</span><span lang="EN-US"><span style="font-family: Calibri;">purge </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">另外还删除所有的配制文件。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg -L<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">列出</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">安装的所有文件清单。同时请看</span><span lang="EN-US"><span style="font-family: Calibri;"> dpkg -c </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">来检查一个</span><span lang="EN-US"><span style="font-family: Calibri;"> .deb </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">文件的内容。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg -s<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">显示已安装包裹的信息。同时请看</span><span lang="EN-US"><span style="font-family: Calibri;"> apt-cache </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">显示</span><span lang="EN-US"><span style="font-family: Calibri;"> Debian </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">存盘中的包裹信息，以及</span><span lang="EN-US"><span style="font-family: Calibri;"> dpkg -I </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">来显示从一个</span><span lang="EN-US"><span style="font-family: Calibri;"> .deb </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">文件中提取的包裹信息。</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg-reconfigure<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">重新配制一个已经安装的包裹，如果它使用的是</span><span lang="EN-US"><span style="font-family: Calibri;"> debconf (debconf </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">为包裹安装提供了一个统一的配制界面</span><span lang="EN-US"><span style="font-family: Calibri;">)</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。你能够重新配制</span><span lang="EN-US"><span style="font-family: Calibri;"> debconf </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">它本身，如你想改变它的前端或提问的优先权。例如，重新配制</span><span lang="EN-US"><span style="font-family: Calibri;"> debconf</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">，使用一个</span><span lang="EN-US"><span style="font-family: Calibri;"> dialog </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">前端，简单运行：</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg-reconfigure &#8211;frontend=dialog debconf (</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">如果你安装时选错了，这里可以改回来哟：</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)</p>
<p>echo &#8221; hold&#8221; | dpkg &#8211;set-selections<br />
</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">设置</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的状态为</span><span lang="EN-US"><span style="font-family: Calibri;"> hlod (</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">命令行方式</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)</p>
<p>dpkg &#8211;get-selections &#8220;&#8221;<br />
</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">取的</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的当前状态</span><span lang="EN-US"><span style="font-family: Calibri;"> (</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">命令行方式</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">)</p>
<p></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">支持通配符，如：</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">Debian:~# dpkg &#8211;get-selections *wine*<br />
libwine                                         hold<br />
libwine-alsa                                    hold<br />
libwine-arts                                    hold<br />
libwine-dev                                     hold<br />
libwine-nas                                     hold<br />
libwine-print                                   hold<br />
libwine-twain                                   hold<br />
wine                                            hold<br />
wine+                                           hold<br />
wine-doc                                        hold<br />
wine-utils                                      hold</p>
<p></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">例如：</span></span><span lang="EN-US"><br />
</span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">大家现在用的都是</span><span lang="EN-US"><span style="font-family: Calibri;"> gaim-0.58 + QQ-plugin</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">，为了防止</span><span lang="EN-US"><span style="font-family: Calibri;"> gaim </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">被升级，我们可以采用如下方法：</span></span><span lang="EN-US"></p>
<p></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">方法一：</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">Debian:~# echo &#8220;gaim hold&#8221; | dpkg &#8211;set-selections<br />
</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">然后用下面命令检查一下：</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">Debian:~# dpkg &#8211;get-selections &#8220;gaim&#8221;<br />
gaim                                            hold<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">现在的状态标志是</span><span lang="EN-US"><span style="font-family: Calibri;"> hold</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">，就不能被升级了。</span></span><span lang="EN-US"></p>
<p></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">如果想恢复怎么办呢</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">?<br />
Debian:~# echo &#8220;gaim install&#8221; | dpkg &#8211;set-selections<br />
Debian:~# dpkg &#8211;get-selections &#8220;gaim&#8221;<br />
gaim                                            install<br />
</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">这时状态标志又被重置为</span><span lang="EN-US"><span style="font-family: Calibri;"> install</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">，可以继续升级了。</span></span><span lang="EN-US"></p>
<p></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">同志们会问，哪个这些状态标志都写在哪个文件中呢</span></span><span style="font-size: small;"><span lang="EN-US"><span style="font-family: Calibri;">?<br />
</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US"><span style="font-family: Calibri;"> /var/lib/dpkg/status </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">里，你也可以通过修改这个文件实现</span><span lang="EN-US"><span style="font-family: Calibri;"> hold</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。</span></span><span lang="EN-US"></p>
<p></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">有时你会发现有的软件状态标志是</span><span lang="EN-US"><span style="font-family: Calibri;"> purge</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">，不要奇怪。</span></span><span lang="EN-US"><br />
</span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">如：事先已经安装了</span><span lang="EN-US"><span style="font-family: Calibri;"> amsn</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">，然后把它卸了。</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">apt-get remove &#8211;purge amsn<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">那么状态标志就从</span><span lang="EN-US"><span style="font-family: Calibri;"> install </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">变成</span><span lang="EN-US"><span style="font-family: Calibri;"> purge</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">。</span></span><span lang="EN-US"></p>
<p></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">方法二：</span></span><span lang="EN-US"><br />
</span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US"><span style="font-family: Calibri;">/etc/apt </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">下手动建一个</span><span lang="EN-US"><span style="font-family: Calibri;"> preferences </span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">文件</span></span><span lang="EN-US"><br />
</span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">内容：</span></span><span lang="EN-US"><br />
<span style="font-size: small; font-family: Calibri;">Package: gaim<br />
Pin: version 0.58*<br />
</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;"><span style="font-size: small;">保存</span></span><span lang="EN-US"></p>
<p><span style="font-size: small; font-family: Calibri;">dpkg -S<br />
</span></span><span style="font-size: small;"><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在包裹数据库中查找</span><span style="font-family: Calibri;"> </span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">，并告诉你哪个包裹包含了这个文件。</span><span lang="EN-US"><span style="font-family: Calibri;">(</span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">注：查找的是事先已经安装的包裹</span><span lang="EN-US"><span style="font-family: Calibri;">)</span></span></span>
</p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: small;"><span style="display: none; font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-hide: all;">取自</span><span style="display: none; mso-hide: all;" lang="EN-US"><span style="font-family: Calibri;">&#8220;</span><a href="http://wiki.ubuntu.org.cn/index.php?title=Apt%E5%92%8Cdpkg%E5%BF%AB%E9%80%9F%E5%8F%82%E8%80%83&amp;variant=zh-hant"><span style="color: #800080; font-family: Calibri;">http://wiki.ubuntu.org.cn/index.php?title=Apt%E5%92%8Cdpkg%E5%BF%AB%E9%80%9F%E5%8F%82%E8%80%83&amp;variant=zh-hant</span></a><span style="font-family: Calibri;">&#8220;</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US"><span style="font-size: small; font-family: Calibri;"> </span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/184.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD7.0安装VMware Tools方法</title>
		<link>http://www.tisswb.com/archives/156.html</link>
		<comments>http://www.tisswb.com/archives/156.html#comments</comments>
		<pubDate>Thu, 09 Oct 2008 09:26:38 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[虚拟化应用]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=156</guid>
		<description><![CDATA[经常使用虚拟机，特别是VM的人，估计对vmtools都不陌生，这个东东确实对虚拟机性能提升很大，建议安装哦~
FreeBSD7中安装VMtools正常安装会报错 要装perl5.8与compat6x 如果你安装FreeBSD时已经装了Perl5.8可以去掉第一行操作以root登陆或者su到root执行一下操作即可安装Vmware tools 注意开始你必须选择在VM里设置把VMware-FreeBSD-tools的iso镜像挂载到虚拟里



#cd /usr/ports/lang/perl5.8 &#38;&#38; make WITH_GDBM=yes install clean
#cd /usr/ports/misc/compat6x &#38;&#38; make install clean
#ln -s /usr/local/lib/compat/libc.so.6 /lib
#unsetenv REMOTEHOST
<span class="readmore"><a href="http://www.tisswb.com/archives/156.html" title="FreeBSD7.0安装VMware Tools方法" target="_blank">阅读全文——共992字</a></span>]]></description>
			<content:encoded><![CDATA[<p>经常使用虚拟机，特别是VM的人，估计对vmtools都不陌生，这个东东确实对虚拟机性能提升很大，建议安装哦~</p>
<p>FreeBSD7中安装VMtools正常安装会报错 要装perl5.8与compat6x 如果你安装FreeBSD时已经装了Perl5.8可以去掉第一行操作以root登陆或者su到root执行一下操作即可安装Vmware tools 注意开始你必须选择在VM里设置把VMware-FreeBSD-tools的iso镜像挂载到虚拟里</p>
<table style="width: 98%; border: #ffffff 1px solid;" border="0">
<tbody>
<tr class="tr3">
<td>#cd /usr/ports/lang/perl5.8 &amp;&amp; make WITH_GDBM=yes install clean<br />
#cd /usr/ports/misc/compat6x &amp;&amp; make install clean<br />
#ln -s /usr/local/lib/compat/libc.so.6 /lib<br />
#unsetenv REMOTEHOST<br />
#mount /cdrom<br />
#cd /cdrom<br />
#cp vmware-freebsd-tools.tar.gz /root<br />
#cd /root<br />
#tar -zxvf vmware-freebsd-tools.tar.gz<br />
#cd vmware-tools-distrib<br />
#./vmware-install.pl</td>
</tr>
</tbody>
</table>
<p> </p>
<p>VMware-tools的使用</p>
<p>　　要使用VMware-tools，需要在VMware主程序界面中选择“VM”菜单下的“Install vmware-tools”</p>
<p>　　主要的可执行程序放在 /usr/local/bin目录下：</p>
<p>　　vmware-config-tools.pl</p>
<p>　　这是个shell环境下可执行脚本，可以在命令行下直接输入vmware-config-tools运行，它的主要作用就是启动vmware-tools，设置屏幕分辨率。</p>
<p>　　vmware-toolbox</p>
<p>　　这是个运行在X终端环境下的Gtk图形界面的管理程序，必须在X环境下才能执行，vmware-tools默认安装时，这个程序运行时有问题，提示需要libc.so.5和libm.so.3两个库，为了能够运行，需要在/usr/lib文件夹内建立两个库的连接：</p>
<p>　　cd /usr/lib</p>
<p>　　ln -s libc.so libc.so.5</p>
<p>　　ln -s libm.so libm.so.3</p>
<p>　　启动X，比如KDE，在模拟终端中输入“vmware-toolbox”即可进入vmware-tools的控制面板</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/156.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

