-
Setting up virtualhost in Apache on Windows XP
Posted on April 27th, 2010 Add comments1.Configuring Apache
The first file need to edit is the Apache httpd.conf file. Usually, it’s under the root folder where the Apache was installed.
If IIS is also used on Windows, IIS will use 80 port first, so need to change the port number of Apache server, e.g. change port 80 to 808012345#Listen 0.0.0.0:80#Listen [::]:80Listen 8080#after several linesServerName localhost:8080Then, add new virtualhost
1234567891011NameVirtualHost *:8080<VirtualHost *:8080>DocumentRoot "C:/www"ServerName localhost</VirtualHost><VirtualHost *:8080>DocumentRoot "C:\sub_www"ServerName sub.localhost</VirtualHost>In the end, need to define the permissions of the virtualhost directory:
123456<Directory "C:\sub_www">Options Indexes FollowSymLinks Includes ExecCGIAllowOverride AllOrder allow,denyAllow from all</Directory>
2.Resolving the DNS issue
Obviously, if typed “http://sub.localhost” in your browser, it would not be found by your Internet provider’s DNS server, and still need modify the files called “hosts”. It’s under “C:\Windows\system32\drivers\etc\”, and just add the new sub domain to the file:12127.0.0.1 localhost127.0.0.1 sub.localhost
829 views -
PHP None-Thread Safe & Thread Safe区别(非线程安全与线程安全)
Posted on April 22nd, 2010 1 comment由于PHP是在Linux/Unix系统下开发的,而又由于Linux/Unix系统是采用多进程(process)的工作方式而Windows系统是采用多线程(thread)的工作方式。如果在IIS下以CGI方式运行PHP会非常慢,这是由于CGI模式是建立在多进程的基础之上的,而非多线程。一般我们会把PHP配置成以ISAPI的方式来运行,ISAPI是多线程的方式,这样就快多了。但存在一个问题,很多常用的PHP扩展是以Linux/Unix的多进程思想来开发的,这些扩展在ISAPI的方式运行时就会出错搞垮IIS。因此在IIS下CGI模式才是 PHP运行的最安全方式,但CGI模式对于每个HTTP请求都需要重新加载和卸载整个PHP环境,其消耗是巨大的。
为了兼顾IIS下PHP的效率和安全,微软给出了FastCGI的解决方案。FastCGI可以让PHP的进程重复利用而不是每一个新的请求就重开一个进程。同时FastCGI也可以允许几个进程同时执行。这样既解决了CGI进程模式消耗太大的问题,又利用上了CGI进程模式不存在线程安全问题的优势。
因此,如果是使用ISAPI的方式来运行PHP就必须用Thread Safe(线程安全)的版本;而用FastCGI模式运行PHP的话就没有必要用线程安全检查了,用None Thread Safe(NTS,非线程安全)的版本能够更好的提高效率。
5,523 views -
如何卸载Windows Live Messenger
Posted on April 18th, 2010 Add comments最近想卸载MSN,但发现控制面板里得添加删除程序无法卸载MSN2009。下面介绍微软隐藏的方法来卸载:
- 打开注册表,搜索“Windows Live Messenger”
- 大概会在“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\(一堆数字)\InstallProperties”下,找到一个叫做“ModifyPath”的项,并拷贝该项的键值,大致像“MsiExec.exe /X{A9D94100-37D6-4D7B-A795-BD050BA9602B}”
- 使用win键+R,粘贴刚才拷贝的键值,运行
- 按照提示,就能完全卸载MSN
796 views -
Earthquake Emergency Kit
Posted on April 15th, 2010 Add commentsWATER. This is your most important item. You will need water to drink, for first aid, and to take medicine. Be sure to stock one gallon per person per day at home. In your kit, have at least one gallon of water. It should be sealed in container in a box or dark bag to protect it from sunlight. You could purchase a box of foil packets or cans of water at a camping store.
FOOD. Food is important for psychological reasons and to keep your blood sugar level up to avoid dizzy or shaky feelings. People with diabetes, heart disease, or other health problems should consult their physicians for advice about the food for their kits. The healthy general public should select foods like crackers, peanut butter, snack packs of fruit, pudding, granola bars, dried fruit, and single serving cans of juice. Plan on four light meals per day. Avoid high sugar foods like candy and soft drinks, as they make you very thirsty. Avoid alcoholic beverages.
LIGHT SOURCE. A chemical light stick provides long shelf life and a sparkless source of light. A flashlight with a special long-life battery, or a long-burning candle may be used after you have checked the area to be sure that there is no leaking gas or petroleum in the area. Do not rely on a regular flashlight as ordinary batteries lose their power quickly in the heat of a car. You might consider an electric light with an attachment to your cigarette lighter available at camping stores.
RADIO. Your car radio is your source for emergency broadcast information. Get a list of EBS/EAS stations for the areas where you live, work, and areas you drive to or through. Keep this list in your glove compartment and in your emergency kit. You should also keep a small battery operated radio at work. Be sure to change the batteries every six months, even if the radio is not used.
EMERGENCY BLANKET. Mylar emergency blankets are available at camping good stores. A thermal blanket may be substituted.
FIRST AID SUPPLIES. Include band-aids in a variety of sizes, anti-bacterial ointment (Neosporin, Bacetracin, etc.), burn cream, rolls of gauze, large gauze pads, rolls of first aid tape, scissors, at large cloth square for a sling or tourniquet, safety pins, needles and heavy thread, matches, eye wash, aspirin, and a chemical ice pack. Also, carry with you at all times a minimum three-day supply of any prescription medications you MUST take. Keep this supply fresh by rotating it every week. Also include any special medications you often use: nose drops, antihistamine, allergy remedies, diarrhea medication, indigestion medication.
PERSONAL CARE AND HYGIENE ITEMS. Container of Handi-Wipes or similar product, small plastic bottle of pine oil or other disinfectant, six large garbage bags with ties for sanitation and waste disposal, box of tissues, roll of toilet paper, plastic bucket to use as a toilet. (Your smaller kit items can be stored in your bucket inside a sealed trash bag.)
ADDITIONAL ITEMS TO CONSIDER. Sturdy shoes (especially if your work shoes are not good for walking), sweater or jacket, hut/sun visor, mouthwash, feminine hygiene supplies, whistle (to attract attention and call for help), rope or string, pencil and tablet.
DON’T LET YOUR GAS TANK FALL BELOW HALF FULL. The radio and heater in your car may save your life, but you can’t run the car’s accessories long without the gas to start the engine and re-charge the battery. If you travel in isolated areas, on the freeway, or far from home, an adequate gasoline supply is crucial. Fill up often. After the quake the gas pumps may not work for several days while electrical power is restored and once the pumps work, the supplies will quickly be depleted through panic buying. NEVER CARRY CANS OF GAS IN YOUR TRUNK! A can of gas is a bomb!
319 views -
地震来临
Posted on April 14th, 2010 Add comments早上来到办公室,大家都还在讨论昨晚的青海大地震。虽然对三木同志的2010说不太赞成,但貌似为了以防万一,确实需要对地震做些准备。
据说加州的房子采用木质结构的方式,就是由于加州处于太平洋地震带,经常会发生时大时小的地震所缘。
晚上下班决定去趟Walmart采购一下。
(全球地震带分布图)
9,024 views






Recent Comments