<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>FreeLAMP.com</title>
<link>http://archive.freelamp.com</link>
<description>FreeLAMP.com ，像风一样自由</description>
<language>zh-cn</language>
<image> 
<title>FreeLAMP.com</title> 
<url>http://archive.freelamp.com/Images/sitetitle_img</url> 
<link>http://archive.freelamp.com</link> 
</image> 
<item> 
<title>FreeLAMP.com 将搬移到新域名</title> 
<link>http://archive.freelamp.com/1224253304</link> 
<description>终于决定要放弃在 Zope + SquishDot 上的架构了。&lt;br&gt; &lt;BR&gt;
会把里面的精华文章搬移到新的域名下。 然后把新的域名修改为 FreeLAMP.com 。&lt;BR&gt;
&lt;BR&gt;
希望2009年春节以前能够完成。</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2008-10-19</dc:date>
</item>
<item> 
<title>Zope Error Email 不能发送</title> 
<link>http://archive.freelamp.com/1216454788</link> 
<description>在后台的 maillog 看到这样的消息：&lt;BR&gt;
Oct 17 22:07:10 freelamp sendmail[14342]: m9HE70S7014342: ruleset=check_mail, arg1=&amp;lt;Zope&amp;gt;, relay=localhost [127.0.0.1], reject=553 5.5.4 &amp;lt;Zope&amp;gt;... Domain name required for sender address Zope&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;br&gt;解决的办法是修改 DTML Document:  standard_error_message&lt;BR&gt;
&lt;BR&gt;
修改为： &lt;BR&gt;
&amp;lt;dtml-if &amp;quot;error_type!='NotFound'&amp;quot;&amp;gt;&lt;BR&gt;
&amp;lt;!--#sendmail mailhost=&amp;quot;MailHost&amp;quot;--&amp;gt;&lt;BR&gt;
To: Site Administrator &amp;lt;&amp;lt;dtml-var error_email&amp;gt;&amp;gt;&lt;BR&gt;
From: Zope System&amp;lt;ZopeATfreelamp.com&amp;gt;&lt;BR&gt;
Subject: Zope Problem&lt;BR&gt;
MIME-Version: 1.0&lt;BR&gt;
Content-Type: text/plain&lt;BR&gt;
Error: &amp;lt;dtml-var error_message&amp;gt; &lt;BR&gt;
&amp;lt;dtml-if error_type&amp;gt;  Error Type: &amp;lt;dtml-var error_type&amp;gt; &amp;lt;/dtml-if&amp;gt; &lt;BR&gt;
&amp;lt;dtml-if error_value&amp;gt; Error Value: &amp;lt;dtml-var error_value&amp;gt; &amp;lt;/dtml-if&amp;gt; &lt;BR&gt;
URL: &amp;lt;dtml-var URL&amp;gt; &lt;BR&gt;
Address: &amp;lt;dtml-var REMOTE_ADDR&amp;gt; &lt;BR&gt;
Agent: &amp;lt;dtml-var HTTP_USER_AGENT&amp;gt; &lt;BR&gt;
Request: &lt;BR&gt;
&amp;lt;dtml-in &amp;quot;REQUEST.items()&amp;quot; sort&amp;gt;&lt;BR&gt;
  &amp;lt;dtml-var sequence-key&amp;gt;: &amp;lt;dtml-var sequence-item&amp;gt; &lt;BR&gt;
&amp;lt;/dtml-in&amp;gt; &lt;BR&gt;
&lt;BR&gt;
&amp;lt;!--#/sendmail--&amp;gt;&lt;BR&gt;
&amp;lt;/dtml-if&amp;gt;&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2008-07-21</dc:date>
</item>
<item> 
<title>Solaris  8 Performance Tuning</title> 
<link>http://archive.freelamp.com/1216454769</link> 
<description>尽管是针对 SOlaris 8 的，但是读起来“风韵犹存”。&lt;BR&gt;
&lt;BR&gt;
When talking about tuning the performance of a UNIX system, sys admins generally work through a number of concepts, such as the current perceived performance, the difference between this level and a desired level of performance, the optimal level claimed by the application vendor, how to measure performance differences, and finally, what to tune and test.&lt;BR&gt;
&lt;br&gt;The current perceived level of performance is based on what your users tell you and what you observe in your regular system monitoring. In a networked environment, if you have some users on the end of a 100-Mbit full-duplex connection, and others who are still using 10-Mbit half-duplex, then the 10-Mbit users will always tell you that the system is slow. However, you might have to wait for a serious application overload or resource crunch before the 100-Mbit users complain. There are also copious logfiles and measurable kernel statistics to facilitate system-level monitoring. Some sites also make use of tools such as CA UniCentre TNG, HP OpenView, or Sun’s SunMC to monitor via snmp MIBs. However, these are tools that must be used by competent systems and application administrators and should not be used alone.&lt;BR&gt;
&lt;BR&gt;
The desired level of performance is somewhat different. Benchmarks are sometimes less than useful, but if you are using an application or system from a large vendor, they should have a specific benchmarking group that will replicate your environment and allow you to test realistic loads. You can trust a benchmark done in this manner because it is specifically tailored to your company’s requirements. If you don’t have the time or resources to organize a tailored benchmark, you’ll have to spend extra time doing it yourself. Before you get started, determine what measurements will be valid for your environment and how to obtain them. Also, work with your users in regard to when you can test tuning and monitoring. Keep the users informed of what you are doing so that they can recognize changes and appreciate the value that you provide to them.&lt;BR&gt;
&lt;BR&gt;
How to Measure before and after Performance Differences&lt;BR&gt;
&lt;BR&gt;
To tune effectively, you must first decide what you want to achieve. Here are some tips to consider:&lt;BR&gt;
&lt;BR&gt;
    * Determine your criteria for success.&lt;BR&gt;
    * Log everything, and run Sun Explorer data gatherer every time you make changes in order to keep a snapshot of your system configuration at each point.&lt;BR&gt;
    * Analyze the logs carefully.&lt;BR&gt;
    * Measure the changed performance against what you wish to achieve.&lt;BR&gt;
    * Be methodical.&lt;BR&gt;
&lt;BR&gt;
If you do not already keep a record of system and resource loads, and have no method of monitoring the applications on your system, start simply. You can measure cpu/memory/swap utilization, disk utilization (specifically your application filesystems), and network utilization using standard system tools. Solaris 8 allows you to use the kstat(1M) utility to view various system properties in a variety of output formats. df -k is also useful. You can write scripts to dump these statistics to a file on a periodic basis or use tools such as apache and mrtg1 to give you a regularly refreshed view. A little bit of shell, awk, sed, or Perl will give you lots of numbers to graph.&lt;BR&gt;
&lt;BR&gt;
The most useful monitoring of performance requires frequent and regular snapshots of your system for a period of time that you, your application admins, and users decide is long enough. My rule of thumb is to accrue not less than eight days of monitoring data (preferably including a peak load period) so that you have obvious peaks and troughs to look at. Another aspect of measurement is to survey the users both before and after to determine how they believe performance has changed in the course of the monitoring period. If your performance tuning has resulted in differences that the users cannot perceive, then I would say the performance hasn’t really been tuned. Useful questions to ask include:&lt;BR&gt;
&lt;BR&gt;
    * How long did it take to perform a standard task (measured in seconds) at 9am, 12noon, 2pm, 5pm before you started tuning?&lt;BR&gt;
    * How long does this task take now?&lt;BR&gt;
    * Do you think that the performance has (improved, stayed the same, become worse) over the past (X) days? (At least a seven-point scale is recommended for this question).&lt;BR&gt;
&lt;BR&gt;
You, the sys admin, also need to measure these standard tasks yourself so that you have a frame of reference for your measurements.&lt;BR&gt;
&lt;BR&gt;
What to Tune and When to Tune It&lt;BR&gt;
&lt;BR&gt;
I/O and Buffers (Including VxVM and VxFS)&lt;BR&gt;
&lt;BR&gt;
The most common target of performance tuning is obviously I/O, and in Solaris there are several buffers and tunables that we can work on. You are probably aware of the relative speeds of disks versus ram, and how this difference in speed has changed dramatically over the past 20 years. This is particularly important when configuring “virtual memory” for your server because of the way Solaris implements paging2. A primary concern here is to avoid paging data to your slow disk (even a 10000-rpm fcal disk is still slow) and ensure that the data stays in ram until it is sent down the SCSI or tcp stack to the next appropriate point.&lt;BR&gt;
&lt;BR&gt;
How does one prevent paging? This question requires an appreciation of “good” and “bad” paging. So-called “good” paging happens when the system allocates or reclaims pages from a process, whereas “bad” paging is when this allocation relies upon a disk device and the system incurs a penalty for access. So, we don’t particularly care about the “good” paging, because the intelligence built into the kernel’s paging algorithms ensure that it happens as infrequently as possible. The priority_paging setting is necessary for Solaris 2.6 and Solaris 7. Neither Solaris 8 or 9 require this, because a modified version of priority_paging, called the cyclic page cache, was integrated into the new kernel. “Bad” paging is also known as swapping, and in extreme circumstances can result in such a high I/O load that your I/O subsystem is said to be thrashing.&lt;BR&gt;
&lt;BR&gt;
You must specifically be aware of two tunables: ncsize and lotsfree from the Solaris side. If you are running Veritas Volume Manager (vxvm), then you need to be aware of volkio and friends. If you are running Veritas FileSystem (vxfs), you must carefully tune vxfs:vxfs_ninode and vxfs:vx_bc_bufhwm. I will address each of these variables in turn.&lt;BR&gt;
&lt;BR&gt;
ncsize&lt;BR&gt;
&lt;BR&gt;
The “nc” in ncsize refers to the Name Cache, and is used to set the size of the Directory Name Lookup Cache, or dnlc for short. This is an optimization to give you better performance from your filesystems because inodes are cached in memory and only flushed out of the cache to disk if they have been idle for quite a while. The default setting for ncsize depends on two other variables, max_nprocs and maxusers with the following relationship:&lt;BR&gt;
&lt;BR&gt;
ncsize      =  (4 * (max_nprocs+maxusers)) + 320&lt;BR&gt;
max_nprocs  =  10 + (16 * maxusers)&lt;BR&gt;
maxusers    =  physmem - 2&lt;BR&gt;
&lt;BR&gt;
Setting maxusers to less than the maximum possible value of 2048 used to be a required configuration task going back to SunOS 4.x. However, Solaris 2.x does not require maxusers to be set, and you can actually decrease the performance of your system by doing so. If maxusers is set to the system default, you might not have a very large dnlc. The recommendation is first to set maxusers to 2048, reboot, and after about a week of average usage, examine the kernel statistics on the dnlc (scroll forward to the line starting with dnlcstat). Under both Solaris 8 and 9, you can use the kstat(1M) utility. When looking at these statistics, note the value of misses/hits and see how close that ratio is to 0. The closer it is to 0, the less you need to worry about tuning ncsize. For example, my workstation (an Ultra80) has been up for about 36.5 days, and has this output from kstat -m unix -n dnlcstats:&lt;BR&gt;
&lt;BR&gt;
module: unix                        instance: 0&lt;BR&gt;
name:   dnlcstats                   class:    misc&lt;BR&gt;
        crtime                      63.090334184&lt;BR&gt;
        ...&lt;BR&gt;
        hits                        141141001&lt;BR&gt;
        misses                      1953220&lt;BR&gt;
        negative_cache_hits         2070966&lt;BR&gt;
        pick_free                   802468&lt;BR&gt;
        pick_heuristic              1102434&lt;BR&gt;
        pick_last                   257563&lt;BR&gt;
        ...&lt;BR&gt;
        snaptime                    3162130.15322328 (ends here)&lt;BR&gt;
&lt;BR&gt;
In my case, this works out to be 0.01383, meaning that my dnlc efficiency is very good. On a major fileserver that I use, the values are considerably different:&lt;BR&gt;
&lt;BR&gt;
module: unix                        instance: 0&lt;BR&gt;
name:   dnlcstats                   class:    misc&lt;BR&gt;
        crtime                      180.496237386&lt;BR&gt;
        ...&lt;BR&gt;
        hits                        313301011&lt;BR&gt;
        misses                      77458379&lt;BR&gt;
        negative_cache_hits         14429400&lt;BR&gt;
        pick_free                   3664314&lt;BR&gt;
        pick_heuristic              51820181&lt;BR&gt;
        pick_last                   24067557&lt;BR&gt;
        snaptime                    6143454.64953917 (ends here)&lt;BR&gt;
&lt;BR&gt;
Here, the ratio works out to be 0.2472, indicating that there is only about a 75% efficiency of the dnlc for this server, so ncsize should be tuned upwards. For the system above, I would recommend that the dnlc size be doubled. It is currently set to the system-calculated default of 139488, which for this E420R running in 64-bit mode takes up slightly more than 8.7mb of kernel memory 3. The system can easily afford double this amount of kernel memory for dnlc, given its workload.&lt;BR&gt;
&lt;BR&gt;
lotsfree&lt;BR&gt;
&lt;BR&gt;
This variable is used as the boundary condition for when to invoke the page scanner and make it look for pages to free. Typically, this is set to 1/64th the number of physical pages in your system, which works reasonably well. However, as the Kernel Tunable Parameters Manual indicates, if your system load is such that it cannot cope with sudden sharp increases in demand for memory, then you should seriously consider increasing this value. A general rule I’ve seen recommended is to set lotsfree to be 1/16th of the physmem value, rather than the default 1/64th. This allows the page scanner to activate in a more timely manner. When combined with priority paging or the cyclic page cache of Solaris 8, you should see that the memory load curve of your system is much smoother than before.&lt;BR&gt;
&lt;BR&gt;
Veritas FileSystem Variables — vxfs:vxfs_ninode and vxfs:vx_bc_bufhwm&lt;BR&gt;
&lt;BR&gt;
These two variables are particularly important to tune. These have an interdependency on ncsize that is related to their usage of kernel memory. When you use Veritas FileSystem (VxFS), you must tune ncsize to be within 50% and 80% of the value of vxfs:vxfs_ninode in order to achieve good performance. Good performance in this context means that the performance curve of CPU cycles and memory used stays relatively close to the performance curve algorithm that Veritas builds into the product.&lt;BR&gt;
&lt;BR&gt;
The upper limit on the amount of kernel memory that VxFS will allocate for its cache is set with vxfs:vx_bc_bufhwm — the Buffer Cache’s Buffer High Water Mark. Once the allocated amount reaches this limit, VxFS inodes are flushed from the cache. The vxfs:vxfs_ninode variable is the limit on the number of VxFS inode structures held in memory. This number is usually determined to be 125% of the value of ncsize for reasons of CPU cycle efficiency, and if you have your dnlc set by way of setting maxusers to 2048, then ncsize/vxfs:vxfs_ninode is approximately 0.78. This is very close to the 80% figure mentioned in the VxFS installation guide.&lt;BR&gt;
&lt;BR&gt;
Veritas Volume Manager Variables&lt;BR&gt;
&lt;BR&gt;
Many sites use Veritas Volume Manager (VxVM) to provide data protection and enhance their systems’ performance. Mirrored filesystems, striped data filesystems, and RAID-5 filesystems are all features that VxVM provides. If you use VxVM as well as VxFS, then you should look at vxio:vol_maxio. This variable controls the maximum size of io requests that are sent down the SCSI chain without breaking the request up. Veritas recommends that this tunable not exceed 20% of kernel memory or physical memory (whichever is smaller), and that you match this tunable to the size of your widest stripe. Apart from this tunable, there are no others that must be tuned, and you should only really look at tuning the variables specified in the Veritas Volume Manager Administrator Guide if you are directed to by an appropriate technical contact within Veritas or a Veritas partner. This is because Veritas, like Sun with Solaris, has spent a lot of time and effort in making sure that the self-tuning algorithms work well for the vast majority of systems. If you are fortunate enough to have the sort of large installation where serious VxVM tuning is necessary, then you should engage Veritas or Sun Professional Services to analyze and tune your configuration.&lt;BR&gt;
&lt;BR&gt;
Shared memory, Semaphores, Message Queues&lt;BR&gt;
&lt;BR&gt;
Applications such as rdbms engines (Oracle, Sybase, Informix, DB2, etc.), middleware like MQ-Series and Tuxedo, and some backup packages (Veritas NetBackup) make heavy use of shared memory, semaphore sets, and message queues in order to maximise their performance. For configuring these settings, you should always start with the application vendor’s recommendations, and find out from the vendor how they log a deficiency in these settings. Veritas NetBackup, for example, will dump messages in logfiles like:&lt;BR&gt;
&lt;BR&gt;
waited for empty buffer X times or&lt;BR&gt;
waited for full buffer Y times&lt;BR&gt;
&lt;BR&gt;
which in conjunction with the NetBackup Troubleshooting guide will indicate whether you need more semaphores or message queues.&lt;BR&gt;
&lt;BR&gt;
Remember that the kernel will not allow more than 25% of the dedicated kernel space (segkp) to be allocated for the shared memory, message queue, and semaphore structures. So, if you experiment with large values on a machine without much physical memory, you may see different values when you check with the sysdef(1M) utility after rebooting. For my workstation (see the “System Specification File” sidebar), the kernel memory usage under Solaris 8 (64-bit mode) for the example semaphore settings is approximately 15898 Kb, for the message queues approximately 1038 Kb, and for the shared memory itself, approximately 18 Kb. You might be wondering why the overhead for shared memory (shmsys) settings is so small compared with the semaphore (semsys) and message queue (msgsys). That is because the only variable used for administrative purposes with shmsys is shminfo_shmmni. This is the maximum number of shmid_ds structures in the system, each of which is 88 bytes.&lt;BR&gt;
&lt;BR&gt;
The rule of thumb for shared memory, semaphores, and message queues is to tune these in conjunction with your application vendor, because the vendor will have concrete customer data and can advise you appropriately.&lt;BR&gt;
&lt;BR&gt;
SCSI tunables&lt;BR&gt;
&lt;BR&gt;
sd_max_throttle and sd_io_time&lt;BR&gt;
&lt;BR&gt;
Two very common tuning targets are those that relate to the SCSI disk (sd) driver module: sd_max_throttle and sd_io_time. You commonly see these set (or need to set them) if you are using EMC, IBM, or Hitachi storage attached to your Solaris system. The sd_io_time variable is the limiter on how long an I/O can be outstanding before an error condition is returned. The Solaris default is 60 seconds (0x3c), but this is often set to 31 seconds (0x1f). The variable sd_max_throttle provides the limit on how many outstanding I/Os the system can handle at any one time and is commonly referred to as the “queue depth.” A common setting for this (the default is 256 or 0x100) is 25, which is the mandated setting from JNI Corporation for use with their fcaw driver4 and EMC5 or Hitachi storage6.&lt;BR&gt;
&lt;BR&gt;
The general recommendation for both these variables, however, is that if you are not required to set them by your storage vendor, then leave them unset in your /etc/system file and let Solaris handle the settings for you. This is because these variables cannot be set on a per-LUN or per-instance basis: any change made to these two variables affects the entire SCSI subsystem. If you set them to values greater than or much less than your storage subsystem can handle, you run a very real risk of having a badly performing system for disk, tape, and memory operations. Another important aspect to tuning the sd driver is that Sun’s disk storage attaches using either the sd or, if attached using the Fibre Channel (FC) protocol, the ssd drivers. This allows for separate tuning of those stacks, but could well change in a later version of Solaris.&lt;BR&gt;
&lt;BR&gt;
maxphys&lt;BR&gt;
&lt;BR&gt;
The maxphys setting, often seen in conjunction with JNI and Emulex HBAs, is the upper limit on the largest chunk of data that can be sent down the SCSI path for any single request. There are no real issues with increasing the value of this variable to 8 Mb (in /etc/system, set maxphys=8388608), as long as your IO subsystem can handle it. All current Fibre Channel adapters are capable of supporting this, as are most ultra/wide SCSI HBAs, such as those from Sun, Adaptec, QLogic, and Tekram. It is possible (although I have not yet tested it) to set this variable in an (E)IDE-based system, such as a PC running Solaris for Intel, a Sun Ultra 5/10/Blade 100, or the lower end Netra systems. With the current range of (E)IDE disks and at least an ATA-66 interface, the system should be able to support this value for maxphys.&lt;BR&gt;
&lt;BR&gt;
Networking Tunables&lt;BR&gt;
&lt;BR&gt;
At a former employer, I worked closely with the DBAs on a particular system running a financial management application. After monitoring the system for several weeks, the first step in tuning was to get a 100-Mbit switched interface activated. When this 100FDX interface was connected, we noticed an immediate improvement in system performance: less swap in use due to less buffering of data, fewer “wasted” cpu cycles, and a much happier group of users. The change was so significant that we put off implementing the rest of the tuning while we analyzed whether our plan was still relevant. We did not need to do any specific configuration on our server because the switch handled it.&lt;BR&gt;
&lt;BR&gt;
If you need to force your interface, there are several simple ways to do this. To begin, you must be absolutely certain that your Ethernet interface is cabled to plug into a 100-Mbit Ethernet switch, otherwise you will not get any response from your network connection. Let’s look at the two most common methods: an rc script and editing /etc/system.&lt;BR&gt;
&lt;BR&gt;
The boot-time rc script allows you to specify which instance of the interface you want to change the settings for. In the example below, I am setting the properties for my qfe3 interface:&lt;BR&gt;
&lt;BR&gt;
#!/bin/sh&lt;BR&gt;
#&lt;BR&gt;
# script to force the interface properties for qfe3&lt;BR&gt;
# script name is /etc/rc2.d/S50ndd_qfe3&lt;BR&gt;
#&lt;BR&gt;
ndd -set /dev/qfe instance 3&lt;BR&gt;
# force OFF 100Mb half duplex&lt;BR&gt;
ndd -set /dev/qfe adv_100hdx_cap 0         &lt;BR&gt;
# force OFF 100Mb T4&lt;BR&gt;
ndd -set /dev/qfe adv_100T4_cap 0          &lt;BR&gt;
# force ON 100Mb full duplex&lt;BR&gt;
ndd -set /dev/qfe adv_100fdx_cap 1         &lt;BR&gt;
# force OFF autonegotiation (FORCE mode)&lt;BR&gt;
ndd -set /dev/qfe adv_autoneg_cap 0        &lt;BR&gt;
# end of script&lt;BR&gt;
&lt;BR&gt;
Here’s the /etc/system modification method:&lt;BR&gt;
&lt;BR&gt;
set qfe:adv_100hdx_cap=0&lt;BR&gt;
set qfe:adv_100T4_cap=0&lt;BR&gt;
set qfe:adv_100fdx_cap=1&lt;BR&gt;
set qfe:adv_autoneg_cap=0&lt;BR&gt;
set qfe:adv_10hdx_cap=0&lt;BR&gt;
&lt;BR&gt;
This method sets all of your qfe interfaces to operate at 100FDX, and if that’s what your switch is configured to do, then you are ready to reboot and enjoy the benefits.&lt;BR&gt;
&lt;BR&gt;
Of the two methods, I recommend using a boot-time rc script. It’s easier to maintain if you write it correctly (because it uses the Bourne shell), and you don’t have to worry about testing by way of a reboot because a quick unplumb/plumb followed by ndd(1m) allows you to make changes while your system is up and running. The /etc/system method is also useful, but given that you cannot really tune each instance separately using this method, it may not be appropriate for every site. &lt;BR&gt;
&lt;BR&gt;
</description>
<dc:creator>James C. McPherson</dc:creator>
<dc:date>2008-08-05</dc:date>
</item>
<item> 
<title>用 ntfs-3g 读写方式挂接 USB 移动硬盘上的 NTFS 分区</title> 
<link>http://archive.freelamp.com/1216454273</link> 
<description>宝乙论坛 真是高人云集的地方。这个&lt;a target=&quot;_blank&quot; href=&quot;http://bbs.baoyinet.com/viewthread.php?tid=648&amp;pid=5919&amp;page=1&amp;extra=page%3D1#pid5919&quot;&gt;帖子&lt;/a&gt;的思路不仅能用于 MSS 盒子，对于普通的 Linux 发行版本，也很有借鉴价值。&lt;p&gt;&lt;br&gt;步骤：&lt;p&gt;

&lt;li&gt;在 MSS 上要用宝乙自己修改过的内核，通过浏览器升级到 fuse 补丁。
&lt;li&gt;insmod fuse.o
&lt;li&gt;安装 ntfs-3g
&lt;li&gt;插上移动硬盘，如果系统自动挂接，先 &lt;br&gt;
  umount /foreign_shares/NTFS
然后用 &lt;a target=&quot;_blank&quot; href=&quot;http://ntfs-3g.org/support.html#fuse26&quot;&gt;ntfs-3g&lt;/a&gt; 挂接 移动硬盘:&lt;br&gt;
 # ntfs-3g /dev/scsi/host1/bus0/target0/lun0/part1 /foreign_shares/NTFS


&lt;p&gt;
程序版本：&lt;br&gt;
fuse kernel 2.5.3 &lt;br&gt;
ntfs-3g 1.2531 &lt;p&gt;

通过这种方式挂接后，不仅分区可写，而且原来中文文件名的问题也迎刃而解。</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2008-07-21</dc:date>
</item>
<item> 
<title>用 loop filesystem 挂接 ext3 格式文件系统到 reiserfs 下</title> 
<link>http://archive.freelamp.com/1215943999</link> 
<description>Maxtor Shared Storage (MSS) 是一个板载 Linux 的盒子。挂接 IDE 硬盘后，默认格式为  reiserfs 。&lt;p&gt;

但是 rtorrent 软件下载大于 4GB 的文件时，不能正确处理，需要使用 ext3 来解决。 
然而盒子不能识别一个额外的分区。解决办法是在当前的 reiserfs 下通过 loop filesystem 来挂接。&lt;p&gt;

这个思路，在虚拟化的方案中很有用，用在这里可以说是匠心独运。&lt;p&gt; 

具体步骤如下：&lt;p&gt;&lt;p&gt;&lt;br&gt;准备工作：&lt;p&gt;

用 insmod 命令插入需要使用到的几个模块到内核： loop64.o ext2.o ext3.o jbd.o
安装程序： e2fsprogs&lt;p&gt;

1.  检查文件系统： /sbin/reiserfsck /dev/ide/host2/bus0/target0/lun0/part3&lt;p&gt;
2.  修改文件系统大小为 1GB：/sbin/resize_reiserfs -s 1G /dev/ide/host2/bus0/target0/lun0/part3&lt;p&gt;
3.  设置需要的 ext3 文件系统： /opt/sbin/losetup -o 1084227584 /dev/loop/0 /dev/ide/host2/bus0/target0/lun0/part3&lt;p&gt;
    1084227584 大概是 1GB 加 10MB。&lt;p&gt;
4.  创建 ext3：/opt/sbin/mkfs.ext2 -b 4096 -j -r 0 /dev/loop/0 &lt;p&gt;
    如果以上命令出错，可去掉 -j ，然后运行：/opt/sbin/tune2fs -j /dev/loop/0 转化为 ext3  &lt;p&gt;
5.  测试：mount -t ext3 /dev/loop/0 /mnt&lt;p&gt;
 &lt;p&gt;&lt;p&gt;
思路来自： &lt;a target=&quot;_blank&quot; href=&quot;http://bbs.baoyinet.com/viewthread.php?tid=590&amp;amp;page=4&amp;amp;extra=page%3D1#pid5529&quot;&gt;宝乙论坛&lt;/a&gt;&lt;p&gt;</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2008-07-13</dc:date>
</item>
<item> 
<title>在 Fedora 9 上为 Lighttpd  安装  mod_geoip  </title> 
<link>http://archive.freelamp.com/1214619119</link> 
<description>GEOIP 是一组客户 IP 和地理位置对应关系的数据库。用在 Web Server 上可以屏蔽来自某些国家的访问。 当然用浏览器所使用的语言来判断也是一个更加简单的办法，这里暂且不表。&lt;br&gt;安装的过程其实十分简单，&lt;BR&gt;
这篇短文也只有寥寥几行。 &lt;BR&gt;
&lt;BR&gt;
http://www.howtoforge.com/installing-mod_geoip-for-lighttpd-on-fedora9&lt;BR&gt;
&lt;BR&gt;
但是思路还是可以借鉴的。 &lt;BR&gt;
&lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2008-06-28</dc:date>
</item>
<item> 
<title>在 Linux 上安装 Socks Server 5 </title> 
<link>http://archive.freelamp.com/1213462994</link> 
<description>需要代理服务器的地方很多，有个自己的代理服务器当然好。 Apache 或者 Squid 都可以当代理服务器，但是都不是“专业”的。 &lt;BR&gt;
&lt;br&gt;原来有个 socks5 的程序， 被 NEC 购买，现在在 sf.net 上有这个专业的 ss5 可以下载。 &lt;BR&gt;
默认 ./configure;make;make install 后，在 /etc/opt/ss5 下有  ss5.conf 文件可以参考。 &lt;BR&gt;
&lt;BR&gt;
# grep -v ^# /etc/opt/ss5/ss5.conf&lt;BR&gt;
注意下面的两个 u ，必须加。否则变成 Open Proxy 的话，就麻烦了。 &lt;BR&gt;
&lt;BR&gt;
auth    0.0.0.0/0               -              u&lt;BR&gt;
permit u        0.0.0.0/0       -       0.0.0.0/0       -       -       -       -       -&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
如果不清楚的话，man ss5.conf 也可以学习。&lt;BR&gt;
可以把 tarball 文件编译目录下的 conf 里的 ss5.passwd 拷贝到 /etc/opt/ss5 下，作为认证文件。 每行一个用户名 + 空格 + 口令，例如：　&lt;BR&gt;
billgates password&lt;BR&gt;
&lt;BR&gt;
启动： &lt;BR&gt;
/usr/sbin/ss5 -b ipaddress:port &lt;BR&gt;
&lt;BR&gt;
很好用的 ss5. &lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2008-06-15</dc:date>
</item>
<item> 
<title>升级 Zope 到 2.7.7 ，OS 升级到 RHEL 5 上</title> 
<link>http://archive.freelamp.com/1213437272</link> 
<description>很长时间没有操作 Zope 了。 中间的过程也是很有意思的。 &lt;BR&gt;
&lt;BR&gt;
&lt;br&gt;RHEL 的 SELinux 特色，很有意思。 &lt;BR&gt;
Zope 的升级都需要特定的 Python 版本配套。&lt;BR&gt;
配置 Zope 的过程是 &lt;BR&gt;
./configure --prefix=/opt/Zope2.7.7&lt;BR&gt;
make&lt;BR&gt;
make install&lt;BR&gt;
mkzopeinstance.py&lt;BR&gt;
&lt;BR&gt;
根据自己的需要修改 $INSTANCE_HOME/etc 下的 zope.conf &lt;BR&gt;
启动 Zope: &lt;BR&gt;
&lt;BR&gt;
su - Zope -c &amp;quot;$INSTANCE_HOME/bin/zopectl start&amp;quot; &lt;BR&gt;
&lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2008-06-15</dc:date>
</item>
<item> 
<title>ps -Zef 截短 Zonename 的解决办法</title> 
<link>http://archive.freelamp.com/1192720410</link> 
<description>Solaris 10 的 ZONE 虚拟计算技术日渐走向应用。本技巧解决 ps -Zef 不能显示长 ZONE Name 的办法。&lt;br&gt;ps -Zef 只能显示 8 个字符的 zonename ， 只能用 ps -o 来定制显示的办法解决显示完整 zonename 的问题。 &lt;BR&gt;
&lt;BR&gt;
 # ps -ef -o user,zone,nlwp,stime,args&lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2007-10-18</dc:date>
</item>
<item> 
<title>优化 PHP 代码的 40 个小窍门</title> 
<link>http://archive.freelamp.com/1192497823</link> 
<description>摘自： http://reinholdweber.com/?p=3 &lt;br&gt;&lt;BR&gt;
40 Tips for optimizing your php Code&lt;BR&gt;
&lt;BR&gt;
   1. If a method can be static, declare it static. Speed improvement is by a factor of 4.&lt;BR&gt;
   2. echo is faster than print.&lt;BR&gt;
   3. Set the maxvalue for your for-loops before and not in the loop.&lt;BR&gt;
   4. Unset your variables to free memory, especially large arrays.&lt;BR&gt;
   5. Avoid magic like __get, __set, __autoload&lt;BR&gt;
   6. require_once() is expensive&lt;BR&gt;
   7. Use full paths in includes and requires, less time spent on resolving the OS paths.&lt;BR&gt;
   8. If you need to find out the time when the script started executing, $_SERVER[’REQUEST_TIME’] is preferred to time()&lt;BR&gt;
   9. See if you can use strncasecmp, strpbrk and stripos instead of regex&lt;BR&gt;
  10. str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4&lt;BR&gt;
  11. If the function, such as string replacement function, accepts both arrays and single characters as arguments, and if your argument list is not too long, consider writing a few redundant replacement statements, passing one character at a time, instead of one line of code that accepts arrays as search and replace arguments.&lt;BR&gt;
  12. Error suppression with @ is very slow.&lt;BR&gt;
  13. $row[’id’] is 7 times faster than $row[id]&lt;BR&gt;
  14. Error messages are expensive&lt;BR&gt;
  15. Do not use functions inside of for loop, such as for ($x=0; $x &amp;lt; count($array); $x) The count() function gets called each time.&lt;BR&gt;
  16. Incrementing a local variable in a method is the fastest. Nearly the same as calling a local variable in a function.&lt;BR&gt;
  17. Incrementing a global variable is 2 times slow than a local var.&lt;BR&gt;
  18. Incrementing a object property (eg. $this-&amp;gt;prop++) is 3 times slower than a local variable.&lt;BR&gt;
  19. Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one.&lt;BR&gt;
  20. Just declaring a global variable without using it in a function also slows things down (by about the same amount as incrementing a local var). PHP probably does a check to see if the global exists.&lt;BR&gt;
  21. Method invocation appears to be independent of the number of methods defined in the class because I added 10 more methods to the test class (before and after the test method) with no change in performance.&lt;BR&gt;
  22. Methods in derived classes run faster than ones defined in the base class.&lt;BR&gt;
  23. A function call with one parameter and an empty function body takes about the same time as doing 7-8 $localvar++ operations. A similar method call is of course about 15 $localvar++ operations.&lt;BR&gt;
  24. Surrounding your string by ' instead of &amp;quot; will make things interpret a little faster since php looks for variables inside &amp;quot;...&amp;quot; but not inside '...'. Of course you can only do this when you don't need to have variables in the string.&lt;BR&gt;
  25. When echoing strings it's faster to separate them by comma instead of dot. Note: This only works with echo, which is a function that can take several strings as arguments.&lt;BR&gt;
  26. A PHP script will be served at least 2-10 times slower than a static HTML page by Apache. Try to use more static HTML pages and fewer scripts.&lt;BR&gt;
  27. Your PHP scripts are recompiled every time unless the scripts are cached. Install a PHP caching product to typically increase performance by 25-100% by removing compile times.&lt;BR&gt;
  28. Use memcached - memcached is a high-performance memory object caching system intended to speed up dynamic web applications by alleviating database load&lt;BR&gt;
  29. Use ip2long() and long2ip() to store IP addresses as integers instead of strings in a database. This will reduce the storage space by almost a factor of four (15 bytes for char(15) vs. 4 bytes for the integer), make it easier to calculate whether a certain address falls within a range, and speed-up searches and sorts (sometimes by quite a bit).&lt;BR&gt;
  30. Partially validate email addresses by checking that the domain name exists with checkdnsrr(). This built-in function checks to ensure that a specified domain name resolves to an IP address. A simple user-defined function that builds on checkdnsrr() to partially valid email addresses can be found in the user comments section in the PHP docs. This is handy for catching those occasional folks who think their email address is ‘joeuser@wwwphp.net’ instead of ‘joeuser@php.net’.&lt;BR&gt;
  31. If you’re using PHP 5 with MySQL 4.1 or above, consider ditching the mysql_* functions for the improved mysqli_* functions. One nice feature is that you can use prepared statements, which may speed up queries if you maintain a database-intensive website. Some benchmarks.&lt;BR&gt;
  32. Learn to love the ternary operator.&lt;BR&gt;
  33. If you get the feeling that you might be reinventing the wheel during a project, check PEAR before you write another line. PEAR is a great resource that many PHP developers are aware of, yet many more are not. It’s an online repository containing over 400 reusable snippets that can be dropped right into your PHP application. Unless your project is trully unique, you ought to be able to find a PEAR package that saves at least a little time. (Also see PECL)&lt;BR&gt;
  34. Automatically print a nicely formatted copy of a page’s source code with highlight_file().This function is handy for when you need to ask for some assistance with a script in a messageboard, IRC, etc. Obviously, some care must be taken not to accidently show your source when it contains DB connection information, passwords, etc.&lt;BR&gt;
  35. Prevent potentially sensitive error messages from being shown to users with the error_reporting(0) function. Ideally error reporting should be completely disabled on a production server from within php.ini. However if you’re on a shared webhost and you aren’t given your own php.ini, then your best bet is to add error_reporting(0); as the first line in each of your scripts (or use it with require_once().) This will prevent potentially sensitive SQL queries and path names from being displayed if things go awry.&lt;BR&gt;
  36. Use gzcompress() and gzuncompress() to transparently compress/decompress large strings before storing them in a database. These built-in functions use the gzip algorithm and can compress plaintext up to 90%. I use these functions almost everytime I read/write to a BLOB field within PHP. The only exception is when I need full text indexing capabilities.&lt;BR&gt;
  37. Return multiple values from a function with “by reference” parameters. Like the ternary operator, most PHP developers who come from a more formalized programming background already know this one. However, those who’s background is more HTML than Pascal, probably have wondered at one time “how do I get multiple values back from a function I wrote, even though I can only use one return value?” The answer is that you precede a variable with “&amp;amp;” and use it “by reference” instead of “by value”.&lt;BR&gt;
  38. Fully understand “magic quotes” and the dangers of SQL injection. I’m hoping that most developers reading this are already familiar with SQL injection. However, I list it here because it’s absolutely critical to understand. If you’ve never heard the term before, spend the entire rest of the day googling and reading.&lt;BR&gt;
  39. When working with strings and you need to check that the string is either of a certain length you'd understandably would want to use the strlen() function. This function is pretty quick since it's operation does not perform any calculation but merely return the already known length of a string available in the zval structure (internal C struct used to store variables in PHP). However because strlen() is a function it is still somewhat slow because the function call requires several operations such as lowercase &amp;amp; hashtable lookup followed by the execution of said function. In some instance you can improve the speed of your code by using a isset() trick.&lt;BR&gt;
&lt;BR&gt;
      Ex.&lt;BR&gt;
      if (strlen($foo) &amp;lt; 5) { echo &amp;quot;Foo is too short&amp;quot;; }&lt;BR&gt;
      vs.&lt;BR&gt;
      if (!isset($foo{5})) { echo &amp;quot;Foo is too short&amp;quot;; }&lt;BR&gt;
&lt;BR&gt;
      Calling isset() happens to be faster then strlen() because unlike strlen(), isset() is a language construct and not a function meaning that it's execution does not require function lookups and lowercase. This means you have virtually no overhead on top of the actual code that determines the string's length.&lt;BR&gt;
  40. When incrementing or decrementing the value of the variable $i++ happens to be a tad slower then ++$i. This is something PHP specific and does not apply to other languages, so don't go modifying your C or Java code thinking it'll suddenly become faster, it won't. ++$i happens to be faster in PHP because instead of 4 opcodes used for $i++ you only need 3. Post incrementation actually causes in the creation of a temporary var that is then incremented. While pre-incrementation increases the original value directly. This is one of the optimization that opcode optimized like Zend's PHP optimizer. It is a still a good idea to keep in mind since not all opcode optimizers perform this optimization and there are plenty of ISPs and servers running without an opcode optimizer.&lt;BR&gt;
  41. Excellent Article about optimizing php by John Lim&lt;BR&gt;
&lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2007-10-16</dc:date>
</item>
<item> 
<title>低版本 Client 连接 MySQL 4.1 以上版本的口令问题 </title> 
<link>http://archive.freelamp.com/1187616916</link> 
<description>一般都用 tarball 编译的方式来安装 LAMP。一个 RHES 4.1 的 Red Hat 上安装的 MySQL 不完整，删除老的 4.1.20 版本后，安装了 MySQL 网站上的 &lt;br&gt;&lt;BR&gt;
MySQL-server-standard-4.1.22-0.rhel4.i386.rpm&lt;BR&gt;
MySQL-client-standard-4.1.22-0.rhel4.i386.rpm&lt;BR&gt;
MySQL-devel-standard-4.1.22-0.rhel4.i386.rpm&lt;BR&gt;
&lt;BR&gt;
MySQL 工作了， 可是原来的 php-mysql 却不支持 PHP 了。 &lt;BR&gt;
只好通过 rpmfind ， 下载 &lt;BR&gt;
&lt;BR&gt;
php-mysql-4.3.11-2.8&lt;BR&gt;
php-pear-4.3.11-2.8&lt;BR&gt;
php-4.3.11-2.8&lt;BR&gt;
&lt;BR&gt;
PHP 上有了 MySQL 支持，可是出现了如下错误：&lt;BR&gt;
&lt;BR&gt;
Client does not support authentication protocol requested by server; consider upgrading MySQL client&lt;BR&gt;
&lt;BR&gt;
解决的办法就是：&lt;BR&gt;
&lt;BR&gt;
 mysql&amp;gt; set PASSWORD  FOR 'miska'@'localhost' = OLD_PASSWORD('muska');&lt;BR&gt;
&lt;BR&gt;
看来， Binary 或者 rpm  安装这些 这些 LAMP 包还确实麻烦。 &lt;BR&gt;
&lt;BR&gt;
====  需要用到的一些 rpm 命令：&lt;BR&gt;
检查已经安装的 PHP 包：&lt;BR&gt;
&lt;BR&gt;
#rpm -qa|grep -i php&lt;BR&gt;
php-mysql-4.3.11-2.8&lt;BR&gt;
php-pear-4.3.11-2.8&lt;BR&gt;
php-4.3.11-2.8&lt;BR&gt;
&lt;BR&gt;
强制删除软件包： rpm -e --nodeps php-4.3.11-2.8&lt;BR&gt;
安装包：  rpm -ivh php-mysql-4.3.11-2.8.i386.rpm&lt;BR&gt;
&lt;BR&gt;
检查软件包包含的文件：&lt;BR&gt;
rpm -qil php-4.3.11-2.8&lt;BR&gt;
&lt;BR&gt;
/etc/httpd/conf.d/php.conf&lt;BR&gt;
/etc/pear.conf&lt;BR&gt;
/etc/php.d&lt;BR&gt;
/etc/php.ini&lt;BR&gt;
/usr/bin/php&lt;BR&gt;
/usr/lib/httpd/modules/libphp4.so&lt;BR&gt;
/usr/lib/php4&lt;BR&gt;
/usr/share/doc/php-4.3.11&lt;BR&gt;
/var/lib/php&lt;BR&gt;
/var/lib/php/session&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2007-08-20</dc:date>
</item>
<item> 
<title>sendmail 几个常见的配置问题</title> 
<link>http://archive.freelamp.com/1182514225</link> 
<description>一个默认安装以后的操作系统其 sendmail 并不一定能如愿运行，这里介绍几个常用的需要修改的参数。&lt;br&gt;1. DaemonPortOptions 修改 sendmail 侦听的 地址和端口，并可以修改 HELO 的名字。&lt;BR&gt;
&lt;BR&gt;
http://www.sendmail.org/~gshapiro/8.10.Training/DaemonPortOptions.html&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
2.MX list for hostname points back to hostname&lt;BR&gt;
&lt;BR&gt;
http://www.sendmail.org/faq/section4.html#4.5&lt;BR&gt;
&lt;BR&gt;
3. /etc/aliases 必须定义的三个名字&lt;BR&gt;
 &lt;BR&gt;
MAILER-DAEMON: root&lt;BR&gt;
postmaster: root&lt;BR&gt;
nobody: /dev/null&lt;BR&gt;
&lt;BR&gt;
http://www.unet.univie.ac.at/aix/aixbman/commadmn/ml_alias.htm</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2007-06-22</dc:date>
</item>
<item> 
<title>取消PHP代码中的 short_open_tag</title> 
<link>http://archive.freelamp.com/1181526502</link> 
<description>一些老的 PHP 程序，采用了 short_open_tag ， 即类似 &lt;BR&gt;
&amp;lt;? &lt;BR&gt;
  这样开头的  PHP 程序， 而不是 &lt;BR&gt;
&amp;lt;?php &lt;BR&gt;
&lt;BR&gt;
本办法采用 Perl 的 pie 语句，一行代码修改所有的 short_open_tag 为标准 tag. &lt;br&gt;&lt;BR&gt;
# find . -name &amp;quot;*.php&amp;quot; |xargs perl -pi -e 's/\&amp;lt;\?$/\&amp;lt;\?php/g'&lt;BR&gt;
&lt;BR&gt;
修改完成后，不要忘记修改 php.ini 的 &lt;BR&gt;
&lt;BR&gt;
short_open_tag = Off&lt;BR&gt;
&lt;BR&gt;
然后重新启动 Apache &lt;BR&gt;
&lt;BR&gt;
# bin/apachectl graceful&lt;BR&gt;
&lt;BR&gt;
可以验证修改是否正确。 &lt;BR&gt;
&lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2007-06-11</dc:date>
</item>
<item> 
<title>用 Sun 的 AMP 组合(Cool Stack) 搭建自己的 Blog 服务器</title> 
<link>http://archive.freelamp.com/1180538558</link> 
<description>对于那些和我一样，喜欢马上自己动手的人来说，甚至不需要知道它到底是干什么的，最想知道的就是下载地址了。&lt;BR&gt;
&lt;BR&gt;
Sun 的 Cool Stack 组合可以从下面的连接下载： &lt;BR&gt;
http://cooltools.sunsource.net/coolstack/&lt;BR&gt;
&lt;br&gt;&lt;BR&gt;
&lt;BR&gt;
&lt;BR&gt;
Cool Stack 是 经过 Sun 优化以后的一套开放源代码软件组合，最新版本 1.1 包含&lt;BR&gt;
&lt;BR&gt;
    * CSKamp. 加入了  Apache2, MySQL5 和 PHP5 &lt;BR&gt;
    * CSKmysql.  如果需要运行 64 位的 MySQL，请安装本包&lt;BR&gt;
    * CSKperl.  包含了很多 Perl 的扩展 &lt;BR&gt;
    * CSKphplibsBundle. 如果需要 PHP 其他扩展的话，就要安装该包&lt;BR&gt;
    * CSKmemcached.   memcached, 分布式对象缓冲系统&lt;BR&gt;
    * CSKruby. 包含 ruby, rubygems and rails.&lt;BR&gt;
    * CSKsquid. 包含 Squid Web Proxy Cache.&lt;BR&gt;
    * CSKtomcat. 包含 Apache Tomcat  &lt;BR&gt;
    &lt;BR&gt;
本文将通过介绍安装 WordPress 2.0 的过程以对 Cool Stack 有比较详细的了解。&lt;BR&gt;
 &lt;BR&gt;
 本文介绍的软件需要 Solaris 10 操作系统的支持。&lt;BR&gt;
    &lt;BR&gt;
    1、下载：&lt;BR&gt;
           # mkdir /var/tmp/CoolStack&lt;BR&gt;
           # cd /var/tmp/CoolStack&lt;BR&gt;
           # ftp ftp.sunfreeware.com&lt;BR&gt;
            user:ftp&lt;BR&gt;
            password:youremail@yourcompany.com&lt;BR&gt;
            cd /pub/freeware/CSK/&lt;BR&gt;
            bin&lt;BR&gt;
            get CSKamp_x86.pkg.bz2&lt;BR&gt;
            get CSKmysql_x86.pkg.bz2&lt;BR&gt;
            bye&lt;BR&gt;
          &lt;BR&gt;
    2、安装：&lt;BR&gt;
           # bunzip2 CSKamp_x86.pkg.bz2 CSKmysql_x86.pkg.bz2&lt;BR&gt;
           # pkgadd -d CSKamp_x86.pkg.bz2&lt;BR&gt;
           # pkgadd -d CSKmysql_x86.pkg&lt;BR&gt;
&lt;BR&gt;
    3、配置 Apache &lt;BR&gt;
          # vi /opt/coolstack/apache2/conf/httpd.conf &lt;BR&gt;
          &lt;BR&gt;
          修改运行 Web Server 的用户名和组&lt;BR&gt;
          修改 ServerName &lt;BR&gt;
          修改 ServerAdmin&lt;BR&gt;
          修改 DirectoryIndex 为&lt;BR&gt;
                       DirectoryIndex index.html index.php&lt;BR&gt;
          启动： # /opt/coolstack/apache2/bin/apachectl start &lt;BR&gt;
          如果启动有错误，查看 ErrorLog: &lt;BR&gt;
          # tail -100f /opt/coolstack/apache2/logs/error_log&lt;BR&gt;
          &lt;BR&gt;
          如果原先安装有 Sun 的 Apache 包，建议禁用 &lt;BR&gt;
           # svcadm disable apache2&lt;BR&gt;
           # svcadm refresh apache2&lt;BR&gt;
           &lt;BR&gt;
         然后再移除下面的包（选作）： &lt;BR&gt;
          SUNWapchd&lt;BR&gt;
          SUNWapchu&lt;BR&gt;
          SUNWapchr&lt;BR&gt;
          SUNWapch2d&lt;BR&gt;
          SUNWapch2u&lt;BR&gt;
          SUNWapch2r&lt;BR&gt;
          SUNWaclg&lt;BR&gt;
&lt;BR&gt;
     4、测试 PHP     &lt;BR&gt;
           在 Web 目录下建立一个 test.php&lt;BR&gt;
           &amp;lt;?php&lt;BR&gt;
              phpinfo()?&lt;BR&gt;
            ?&amp;gt;&lt;BR&gt;
           本文假设 Web Server Name 为 freelamp.com，&lt;BR&gt;
          在浏览器输入： http://freelamp.com/test.php 应该会显示 PHP 的编译参数等。&lt;BR&gt;
          &lt;BR&gt;
      5、配置 MySQL &lt;BR&gt;
           用 # isainfo -b 检查服务器是否 64 位 &lt;BR&gt;
          如果是64 则 MySQL 目录为 /opt/coolstack/mysql，32的话则为： /opt/coolstack/mysql_32bit&lt;BR&gt;
          &lt;BR&gt;
          添加 mysql 用户：&lt;BR&gt;
          #groupadd mysql;useradd -g mysql mysql&lt;BR&gt;
          &lt;BR&gt;
          安装初始数据库：&lt;BR&gt;
          # $MYSQL_DIR/bin/mysql_install_db&lt;BR&gt;
          # chown -R mysql $MYSQL_DIR/var&lt;BR&gt;
          启动： &lt;BR&gt;
          # $MYSQL_DIR/bin/mysqld_safe &amp;amp;&lt;BR&gt;
          &lt;BR&gt;
          如果启动失败，请检查 $MYSQL_DIR/var 目录下的 `hostname`.err 文件&lt;BR&gt;
          # tail -100f `hostname`.err&lt;BR&gt;
          &lt;BR&gt;
      6、下载并安装  WordPress&lt;BR&gt;
             下载：&lt;BR&gt;
             # cd /var/tmp&lt;BR&gt;
             # wget http://wordpress.org/latest.tar.gz&lt;BR&gt;
             &lt;BR&gt;
             解压：&lt;BR&gt;
             # cd /opt/coolstack/apache2/htdocs&lt;BR&gt;
             # gzcat /var/tmp/latest.tar.gz|tar xf -&lt;BR&gt;
             &lt;BR&gt;
             建立配置文件：&lt;BR&gt;
             # cd wordpress&lt;BR&gt;
             # mv wp-config-sample.php wp-config.php&lt;BR&gt;
             # vi wp-config.php&lt;BR&gt;
                define('DB_NAME', 'wordpress');    // The name of the database&lt;BR&gt;
                define('DB_USER', 'wordpress');     // Your MySQL username&lt;BR&gt;
                define('DB_PASSWORD', 'wordpress'); // ...and password&lt;BR&gt;
&lt;BR&gt;
            建立数据库：&lt;BR&gt;
            进入 MySQL 命令行：&lt;BR&gt;
            # /opt/coolstack/mysql/bin/mysql -uroot &lt;BR&gt;
             mysql&amp;gt; create database wordpress&lt;BR&gt;
             mysql&amp;gt; grant all on wordpress.* to wordpress@localhost identified by 'wordpress';&lt;BR&gt;
             &lt;BR&gt;
             进入 Web 界面配置：&lt;BR&gt;
                           http://freelamp.com/wordpress/&lt;BR&gt;
             如果数据库配置没有错误的话，系统会提示进入 install.php 安装数据，          &lt;BR&gt;
             安装成功后，记录 admin 的密码登录即可管理自己的 Blog 了。 &lt;BR&gt;
             &lt;BR&gt;
     Sun 的这套 Cool Stack 最为抢眼的应该是经过优化后的 MySQL 64 位版本。美中不足的是 &lt;BR&gt;
     &lt;BR&gt;
     Apache 提供的不是 worker 模块，而是老的 prefork.c 模块。&lt;BR&gt;
     PHP 没有提供 Zend Optimizer&lt;BR&gt;
 &lt;BR&gt;
             &lt;BR&gt;
&lt;BR&gt;
附录： &lt;BR&gt;
&lt;BR&gt;
A. 检查数据库程序的版本(32 还是 64)：&lt;BR&gt;
         &lt;BR&gt;
         bash-3.00# file bin/mysqld&lt;BR&gt;
         bin/mysqld:     ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, not stripped, no debugging information available&lt;BR&gt;
         bash-3.00# file ../mysql_32bit/bin/mysqld&lt;BR&gt;
         ../mysql_32bit/bin/mysqld:      ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped, no debugging information available&lt;BR&gt;
 &lt;BR&gt;
&lt;BR&gt;
B.查看数据库支持的引擎：&lt;BR&gt;
            &lt;BR&gt;
                mysql&amp;gt; show engines;&lt;BR&gt;
         +------------+---------+----------------------------------------------------------------+&lt;BR&gt;
         | Engine     | Support | Comment                                                        |&lt;BR&gt;
         +------------+---------+----------------------------------------------------------------+&lt;BR&gt;
         | MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         |&lt;BR&gt;
         | MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      |&lt;BR&gt;
         | InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     |&lt;BR&gt;
         | BerkeleyDB | NO      | Supports transactions and page-level locking                   |&lt;BR&gt;
         | BLACKHOLE  | NO      | /dev/null storage engine (anything you write to it disappears) |&lt;BR&gt;
         | EXAMPLE    | NO      | Example storage engine                                         |&lt;BR&gt;
         | ARCHIVE    | YES     | Archive storage engine                                         |&lt;BR&gt;
         | CSV        | NO      | CSV storage engine                                             |&lt;BR&gt;
         | ndbcluster | NO      | Clustered, fault-tolerant, memory-based tables                 |&lt;BR&gt;
         | FEDERATED  | NO      | Federated MySQL storage engine                                 |&lt;BR&gt;
         | MRG_MYISAM | YES     | Collection of identical MyISAM tables                          |&lt;BR&gt;
         | ISAM       | NO      | Obsolete storage engine                                        |&lt;BR&gt;
         +------------+---------+----------------------------------------------------------------+&lt;BR&gt;
            &lt;BR&gt;
&lt;BR&gt;
C.查看 Apache 编译的模块：&lt;BR&gt;
 &lt;BR&gt;
          bash-3.00# /opt/coolstack/apache2/bin/httpd -l&lt;BR&gt;
          Compiled in modules:&lt;BR&gt;
            core.c&lt;BR&gt;
            prefork.c&lt;BR&gt;
            http_core.c&lt;BR&gt;
            mod_so.c&lt;BR&gt;
           &lt;BR&gt;
本文也发表于 http://samp.nalai.net/57600&lt;BR&gt;
&lt;BR&gt;
更多有关 Solaris 上的 AMP 文章，见于：&lt;BR&gt;
&lt;BR&gt;
 http://samp.nalai.net/&lt;BR&gt;
&lt;BR&gt;
</description>
<dc:creator>徐永久</dc:creator>
<dc:date>2007-05-31</dc:date>
</item>
</channel> 
</rss> 
