2007/05 5
常常忘记后缀。比如apache.org, mysql.com, php.net,以及其他的一些怪异的网址。
将google的手气不错植入到firefox地址栏中,可以起到很方便的作用:
比如输入:simpletest, 会自动跳转到http://www.lastcraft.com/simple_test.php,精度还是很准的。我也没有研究,google的手气不错是否会因为个人信息而有不同的结果。如果那样就更好了。
植入方法:
1. 使用浏览器打开about:config
2. 找到keyword.URL, 把值改为:http://www.google.com/search?btnI=I%27m+Feeling+Lucky&q= 保存
搞定!直接敲入一些词试一下吧:)
直接敲rollenc + Enter就可以找到我了哦:)
Defined tags for this entry: ,

Posted by rollenc

Last modified on 2007-05-13 10:15
2007/05 4
我被要求在不能理解需求的情况下重构和修改功能。。。。。。。。

Posted by rollenc

Last modified on 2007-05-05 08:22
2007/05 2
最近比较迷茫了。
在职业上来讲,自己并不知道自己要做什么了。架构师的目标好像离我远了很多。现在对团队的一种失望,使我对团队的寻找产生了极大的茫然。但编码工的工作并不是我追求的工作,任务一个接一个的来,像掉进了潘多拉的魔盒,没完没了。所以我也理解了为什么没有文档,也对我自己在情急之下使用的ctrl+C和ctrl+V的操作感到非常的鄙视。
一天8小时以上的编码,没有学习时间,没有培训机会。我想,这不是我追求的生活。
单干,没有勇气和对能耐上的怀疑。
团队,我渐渐的在失望。。
谁? 能给我信心!
Defined tags for this entry:

Posted by rollenc

Last modified on 2007-05-05 09:08
2007/05 2
一个目标必须满足SMART标准:
Specific——具体;
Measurable——可以衡量;
Achievable——可以实现;
Realistic——比较现实;
Time-bound——有时间限制。


Posted by rollenc

Last modified on 2007-05-05 17:56
2007/05 2
一直在追寻团队,但未果。目前加入的公司虽然在规模上很大,但是,本组项目都是自给自足型的。需求自己定,任务自己完成,其中在文档上很弱,基本上不能形成一个成文的文档。文档的格式也要命,word或者excel,等到需求变化了,想比较一下两者区别那是不可能的。而且,两个对同一个文件的修改是肯定冲突的。
团队,应该可以不成熟的,成熟的和发展中的。我都不知道自己自己要追求的,到底应该是一个什么样的团队。不成熟的肯定不是,发展中的,由于把速度看在了第一位,如果没有一个很好很强的管理,在开发流程上的成熟度可谓相当地不成熟。成熟的团队?什么是成熟的团队?存在么?
不明白了,从团队的角度来讲,现在的状态我对自己不能做一个很好的解释,在自己的团队学习上,现在在混日子。

Posted by rollenc

Not modified
2007/05 2
以前简单的看过CMM,也被其文档的烦琐而吓到了。还记得一个简单的比方:
CMM1:没有文档
CMM2:有文档
CMM3:有文档的文档
CMM4:有文档的文档的文档
CMM5:有文档的文档的文档的文档

我也只想着去实现一个CMM3的规模。有需求文档(2),这个需求文档由谁提出,谁在何时做了什么样的变更,在什么样的情况下什么地方可能做什么样的变化(3)。实现阶段的设计文档和开发编码文档。考虑到文档的变更,维护多套文档(包括程序)是本麻烦的。本人也常常在编码阶段觉得自己的设计有瑕疵,于是在编码阶段的实现方法就与以前的设计文档有所不同,但一般的,我都没有重视到或者说以结果为主导任务,于是把设计文档这一过程性的文档放在了末位。于是,出现的情况是设计文档和实现并不一致。这也是很多团队不做文档的理由。
需求-》设计-》伪代码-》编码。使用伪代码应该可以很好的保持设计和编码之间的联系,而所有的伪代码全部使用注释的方式写在开发的程序代码中。具体伪代码的实现可以参考《代码大全2》P218。伪代码可以作为一个设计,也可以作为一个子程序或功能的需求。把文档放在程序中,保证文档只有一份。但另外的,以任务为目的的去看别人的源代码是一大头痛的事情,以学习的目的去看优秀的简短的代码才可能是一种享受。所以,文档的撰写可以全部在程序中,但程序文档的分发却需要多种的形式,以达到不同人的需要。因此,这就要求了程序中的使用的文档必须能够被某中工具提取出来,并形成可读性文档。这类的工具包括 javadoc, phpdoc等。在需求或者设计变更,以及其他有需要时生成一次文档,文档以html格式保存,如果每次使用工具时使用的配置相同,那么,两次生成的文档是有可比性的。通过版本管理,很容易追溯文档的变更历史。这就可以形成文档(需求或设计文档)的文档(文档的变更文档)
Defined tags for this entry: ,

Posted by rollenc

Not modified
2007/04 25
Mark 一下。
整理 描述
armscii8 (ARMSCII-8 Armenian)
armscii8_bin 亚美尼亚语, 二进制
armscii8_general_ci 亚美尼亚语, 不区分大小写
ascii (US ASCII)
ascii_bin 西欧 (多语言), 二进制
ascii_general_ci 西欧 (多语言), 不区分大小写
big5 (Big5 Traditional Chinese)
big5_bin 繁体中文, 二进制
big5_chinese_ci 繁体中文, 不区分大小写
binary (Binary pseudo charset)
binary 二进制
cp1250 (Windows Central European)
cp1250_bin 中欧 (多语言), 二进制
cp1250_croatian_ci 克罗地亚语, 不区分大小写
cp1250_czech_cs 捷克语, 区分大小写
cp1250_general_ci 中欧 (多语言), 不区分大小写
cp1251 (Windows Cyrillic)
cp1251_bin 西里尔语 (多语言), 二进制
cp1251_bulgarian_ci 保加利亚语, 不区分大小写
cp1251_general_ci 西里尔语 (多语言), 不区分大小写
cp1251_general_cs 西里尔语 (多语言), 区分大小写
cp1251_ukrainian_ci 乌克兰语, 不区分大小写
cp1256 (Windows Arabic)
cp1256_bin 阿拉伯语, 二进制
cp1256_general_ci 阿拉伯语, 不区分大小写
cp1257 (Windows Baltic)
cp1257_bin 巴拉克语 (多语言), 二进制
cp1257_general_ci 巴拉克语 (多语言), 不区分大小写
cp1257_lithuanian_ci 立陶宛语, 不区分大小写
cp850 (DOS West European)
cp850_bin 西欧 (多语言), 二进制
cp850_general_ci 西欧 (多语言), 不区分大小写
cp852 (DOS Central European)
cp852_bin 中欧 (多语言), 二进制
cp852_general_ci 中欧 (多语言), 不区分大小写
cp866 (DOS Russian)
cp866_bin 俄语, 二进制
cp866_general_ci 俄语, 不区分大小写
cp932 (SJIS for Windows Japanese)
cp932_bin 日语, 二进制
cp932_japanese_ci 日语, 不区分大小写
dec8 (DEC West European)
dec8_bin 西欧 (多语言), 二进制
dec8_swedish_ci 瑞典语, 不区分大小写
eucjpms (UJIS for Windows Japanese)
eucjpms_bin 日语, 二进制
eucjpms_japanese_ci 日语, 不区分大小写
euckr (EUC-KR Korean)
euckr_bin 朝鲜语, 二进制
euckr_korean_ci 朝鲜语, 不区分大小写
gb2312 (GB2312 Simplified Chinese)
gb2312_bin 简体中文, 二进制
gb2312_chinese_ci 简体中文, 不区分大小写
gbk (GBK Simplified Chinese)
gbk_bin 简体中文, 二进制
gbk_chinese_ci 简体中文, 不区分大小写
geostd8 (GEOSTD8 Georgian)
geostd8_bin 乔治亚语, 二进制
geostd8_general_ci 乔治亚语, 不区分大小写
greek (ISO 8859-7 Greek)
greek_bin 希腊语, 二进制
greek_general_ci 希腊语, 不区分大小写
hebrew (ISO 8859-8 Hebrew)
hebrew_bin 希伯来语, 二进制
hebrew_general_ci 希伯来语, 不区分大小写
hp8 (HP West European)
hp8_bin 西欧 (多语言), 二进制
hp8_english_ci 英语, 不区分大小写
keybcs2 (DOS Kamenicky Czech-Slovak)
keybcs2_bin 捷克斯洛伐克语, 二进制
keybcs2_general_ci 捷克斯洛伐克语, 不区分大小写
koi8r (KOI8-R Relcom Russian)
koi8r_bin 俄语, 二进制
koi8r_general_ci 俄语, 不区分大小写
koi8u (KOI8-U Ukrainian)
koi8u_bin 乌克兰语, 二进制
koi8u_general_ci 乌克兰语, 不区分大小写
latin1 (cp1252 West European)
latin1_bin 西欧 (多语言), 二进制
latin1_danish_ci 丹麦语, 不区分大小写
latin1_general_ci 西欧 (多语言), 不区分大小写
latin1_general_cs 西欧 (多语言), 区分大小写
latin1_german1_ci 德语 (字典), 不区分大小写
latin1_german2_ci 德语 (电话本), 不区分大小写
latin1_spanish_ci 西班牙语, 不区分大小写
latin1_swedish_ci 瑞典语, 不区分大小写

整理 描述
latin2 (ISO 8859-2 Central European)
latin2_bin 中欧 (多语言), 二进制
latin2_croatian_ci 克罗地亚语, 不区分大小写
latin2_czech_cs 捷克语, 区分大小写
latin2_general_ci 中欧 (多语言), 不区分大小写
latin2_hungarian_ci 匈牙利语, 不区分大小写
latin5 (ISO 8859-9 Turkish)
latin5_bin 土耳其语, 二进制
latin5_turkish_ci 土耳其语, 不区分大小写
latin7 (ISO 8859-13 Baltic)
latin7_bin 巴拉克语 (多语言), 二进制
latin7_estonian_cs 爱沙尼亚语, 区分大小写
latin7_general_ci 巴拉克语 (多语言), 不区分大小写
latin7_general_cs 巴拉克语 (多语言), 区分大小写
macce (Mac Central European)
macce_bin 中欧 (多语言), 二进制
macce_general_ci 中欧 (多语言), 不区分大小写
macroman (Mac West European)
macroman_bin 西欧 (多语言), 二进制
macroman_general_ci 西欧 (多语言), 不区分大小写
sjis (Shift-JIS Japanese)
sjis_bin 日语, 二进制
sjis_japanese_ci 日语, 不区分大小写
swe7 (7bit Swedish)
swe7_bin 瑞典语, 二进制
swe7_swedish_ci 瑞典语, 不区分大小写
tis620 (TIS620 Thai)
tis620_bin 泰语, 二进制
tis620_thai_ci 泰语, 不区分大小写
ucs2 (UCS-2 Unicode)
ucs2_bin Unicode (多语言), 二进制
ucs2_czech_ci 捷克语, 不区分大小写
ucs2_danish_ci 丹麦语, 不区分大小写
ucs2_esperanto_ci Esperanto, 不区分大小写
ucs2_estonian_ci 爱沙尼亚语, 不区分大小写
ucs2_general_ci Unicode (多语言), 不区分大小写
ucs2_hungarian_ci 匈牙利语, 不区分大小写
ucs2_icelandic_ci 冰岛语, 不区分大小写
ucs2_latvian_ci 拉脱维亚语, 不区分大小写
ucs2_lithuanian_ci 立陶宛语, 不区分大小写
ucs2_persian_ci 波斯语, 不区分大小写
ucs2_polish_ci 波兰语, 不区分大小写
ucs2_roman_ci 西欧, 不区分大小写
ucs2_romanian_ci 罗马尼亚语, 不区分大小写
ucs2_slovak_ci 斯洛伐克语, 不区分大小写
ucs2_slovenian_ci 斯洛文尼亚语, 不区分大小写
ucs2_spanish2_ci 传统西班牙语, 不区分大小写
ucs2_spanish_ci 西班牙语, 不区分大小写
ucs2_swedish_ci 瑞典语, 不区分大小写
ucs2_turkish_ci 土耳其语, 不区分大小写
ucs2_unicode_ci Unicode (多语言), 不区分大小写
ujis (EUC-JP Japanese)
ujis_bin 日语, 二进制
ujis_japanese_ci 日语, 不区分大小写
utf8 (UTF-8 Unicode)
utf8_bin Unicode (多语言), 二进制
utf8_czech_ci 捷克语, 不区分大小写
utf8_danish_ci 丹麦语, 不区分大小写
utf8_esperanto_ci Esperanto, 不区分大小写
utf8_estonian_ci 爱沙尼亚语, 不区分大小写
utf8_general_ci Unicode (多语言), 不区分大小写
utf8_hungarian_ci 匈牙利语, 不区分大小写
utf8_icelandic_ci 冰岛语, 不区分大小写
utf8_latvian_ci 拉脱维亚语, 不区分大小写
utf8_lithuanian_ci 立陶宛语, 不区分大小写
utf8_persian_ci 波斯语, 不区分大小写
utf8_polish_ci 波兰语, 不区分大小写
utf8_roman_ci 西欧, 不区分大小写
utf8_romanian_ci 罗马尼亚语, 不区分大小写
utf8_slovak_ci 斯洛伐克语, 不区分大小写
utf8_slovenian_ci 斯洛文尼亚语, 不区分大小写
utf8_spanish2_ci 传统西班牙语, 不区分大小写
utf8_spanish_ci 西班牙语, 不区分大小写
utf8_swedish_ci 瑞典语, 不区分大小写
utf8_turkish_ci 土耳其语, 不区分大小写
utf8_unicode_ci Unicode (多语言), 不区分大小写
Defined tags for this entry: ,

Posted by rollenc

Last modified on 2007-04-25 14:04
2007/04 24
这篇文章是mysql的交互式文章。目前并不足1000条,将来也不止1000条。需要大家努力。
原文见:http://forge.mysql.com/wiki/Top10SQLPerformanceTips

Specific Query Performance Tips (see also database design tips for tips on indexes):

1. Use EXPLAIN to profile the query execution plan
2. Use Slow Query Log (always have it on!)
3. Don't use DISTINCT when you have or could use GROUP BY
4. Insert performance
1. Batch INSERT and REPLACE
2. Use LOAD DATA instead of INSERT
5. LIMIT m,n may not be as fast as it sounds
6. Don't use ORDER BY RAND() if you have > ~2K records
7. Use SQL_NO_CACHE when you are SELECTing frequently updated data or large sets of data
8. Avoid wildcards at the start of LIKE queries
9. Avoid correlated subqueries and in select and where clause (try to avoid in)
10. No calculated comparisons -- isolate indexed columns
11. ORDER BY and LIMIT work best with equalities and covered indexes
12. Separate text/blobs from metadata, don't put text/blobs in results if you don't need them
13. Derived tables (subqueries in the FROM clause) can be useful for retrieving BLOBs without sorting them. (Self-join can speed up a query if 1st part finds the IDs and uses then to fetch the rest)
14. ALTER TABLE...ORDER BY can take data sorted chronologically and re-order it by a different field -- this can make queries on that field run faster (maybe this goes in indexing?)
15. Know when to split a complex query and join smaller ones
16. Delete small amounts at a time if you can
17. Make similar queries consistent so cache is used
18. Have good SQL query standards
19. Don't use deprecated features
20. Turning OR on multiple index fields (<5.0) into UNION may speed things up (with LIMIT), after 5.0 the index_merge should pick stuff up.
21. Don't use COUNT * on Innodb tables for every search, do it a few times and/or summary tables, or if you need it for the total # of rows, use SQL_CALC_FOUND_ROWS and SELECT FOUND_ROWS()
22. Use INSERT ... ON DUPLICATE KEY update (INSERT IGNORE) to avoid having to SELECT
23. use groupwise maximum instead of subqueries


Scaling Performance Tips:

1. Use benchmarking
2. isolate workloads don't let administrative work interfere with customer performance. (ie backups)
3. Debugging sucks, testing rocks!
4. As your data grows, indexing may change (cardinality and selectivity change). Structuring may want to change. Make your schema as modular as your code. Make your code able to scale. Plan and embrace change, and get developers to do the same.

Network Performance Tips:

1. Minimize traffic by fetching only what you need.
1. Paging/chunked data retrieval to limit
2. Don't use SELECT *
3. Be wary of lots of small quick queries if a longer query can be more efficient
2. Use multi_query if appropriate to reduce round-trips

OS Performance Tips:

1. Use proper data partitions
1. For Cluster. Start thinking about Cluster *before* you need them
2. Keep the database host as clean as possible. Do you really need a windowing system on that server?
3. Utilize the strengths of the OS
4. pare down cron scripts
5. create a test environment
6. source control schema and config files
7. for LVM innodb backups, restore to a different instance of MySQL so Innodb can roll forward
8. partition appropriately
9. partition your database when you have real data -- do not assume you know your dataset until you have real data

MySQL Server Overall Tips:

1. innodb_flush_commit=0 can help slave lag
2. Optimize for data types, use consistent data types. Use PROCEDURE ANALYSE() to help determine the smallest data type for your needs.
3. use optimistic locking, not pessimistic locking. try to use shared lock, not exclusive lock. share mode vs. FOR UPDATE
4. if you can, compress text/blobs
5. compress static data
6. don't back up static data as often
7. enable and increase the query and buffer caches if appropriate
8. config params -- http://docs.cellblue.nl/2007/03/17/easy-mysql-performance-tweaks/ is a good reference
9. Config variables & tips:
1. use one of the supplied config files
2. key_buffer, unix cache (leave some RAM free), per-connection variables, innodb memory variables
3. be aware of global vs. per-connection variables
4. check SHOW STATUS and SHOW VARIABLES (GLOBAL|SESSION in 5.0 and up)
5. be aware of swapping esp. with Linux, "swappiness" (bypass OS filecache for innodb data files, innodb_flush_method=O_DIRECT if possible (this is also OS specific))
6. defragment tables, rebuild indexes, do table maintenance
7. If you use innodb_flush_txn_commit=1, use a battery-backed hardware cache write controller
8. more RAM is good so faster disk speed
9. use 64-bit architectures
10. --skip-name-resolve
11. increase myisam_sort_buffer_size to optimize large inserts (this is a per-connection variable)
12. look up memory tuning parameter for on-insert caching
13. increase temp table size in a data warehousing environment (default is 32Mb) so it doesn't write to disk (also constrained by max_heap_table_size, default 16Mb)
14. Run in SQL_MODE=STRICT to help identify warnings
15. /tmp dir on battery-backed write cache
16. consider battery-backed RAM for innodb logfiles
17. use --safe-updates for client
18. Redundant data is redundant

Storage Engine Performance Tips:

1. InnoDB ALWAYS keeps the primary key as part of each index, so do not make the primary key very large
2. Utilize different storage engines on master/slave ie, if you need fulltext indexing on a table.
3. BLACKHOLE engine and replication is much faster than FEDERATED tables for things like logs.
4. Know your storage engines and what performs best for your needs, know that different ones exist.
1. ie, use MERGE tables ARCHIVE tables for logs
2. Archive old data -- don't be a pack-rat! 2 common engines for this are ARCHIVE tables and MERGE tables
5. use row-level instead of table-level locking for OLTP workloads
6. try out a few schemas and storage engines in your test environment before picking one.

Database Design Performance Tips:

1. Design sane query schemas. don't be afraid of table joins, often they are faster than denormalization
2. Don't use boolean flags
3. Use Indexes
4. Don't Index Everything
5. Do not duplicate indexes
6. Do not use large columns in indexes if the ratio of SELECTs:INSERTs is low.
7. be careful of redundant columns in an index or across indexes
8. Use a clever key and ORDER BY instead of MAX
9. Normalize first, and denormalize where appropriate.
10. Databases are not spreadsheets, even though Access really really looks like one. Then again, Access isn't a real database
11. use INET_ATON and INET_NTOA for IP addresses, not char or varchar
12. make it a habit to REVERSE() email addresses, so you can easily search domains (this will help avoid wildcards at the start of LIKE queries if you want to find everyone whose e-mail is in a certain domain)
13. A NULL data type can take more room to store than NOT NULL
14. Choose appropriate character sets & collations -- UTF16 will store each character in 2 bytes, whether it needs it or not, latin1 is faster than UTF8.
15. Use Triggers wisely
16. use min_rows and max_rows to specify approximate data size so space can be pre-allocated and reference points can be calculated.
17. Use HASH indexing for indexing across columns with similar data prefixes
18. Use myisam_pack_keys for int data
19. be able to change your schema without ruining functionality of your code
20. segregate tables/databases that benefit from different configuration variables

Other:

1. Hire a MySQL (tm) Certified DBA
2. Know that there are many consulting companies out there that can help, as well as MySQL's Professional Services.
3. Read and post to MySQL Planet at http://www.mysqlplanet.org
4. Attend the yearly MySQL Conference and Expo or other conferences with MySQL tracks (link to the conference here)
5. Support your local User Group (link to forge page w/user groups here)
Defined tags for this entry:

Posted by rollenc

Last modified on 2007-04-24 20:36
2007/04 23
1.昨天中午11点,去火车南站的公交114,半路抛锚。等下一趟继续。。
2.昨天晚上19点,坐超市班车,开出后1分钟,抛锚。和女友提着大包小包,慢慢的走回去。还好不远。
3.今早自行车,压到玻璃了。抛锚。推着车一路走,一路找修车点。终于,在公司门口给找到了一个。还好,有半小时的弹性时间,不算迟到。。。
Defined tags for this entry:

Posted by rollenc

Last modified on 2007-04-23 12:16
2007/04 21
前几天点击了一下自动升级,出现了不少的问题。烦心咯。
一是装了一个cache系统,我不需要cache,因为我一直在随意的改动我的blog。另外就是这个cache也不能定制,太呆板。卸载掉之后也很流氓,已生成cache的内容仍然在使用cache。知道我把数据库内的cache下来的内容全部删掉,才恢复。
二是反垃圾评论系统,给评论自动加上了本人最讨厌的,可用性设计极差的认证码机制。而且对于我这种一直以管理员登录用户来说,不显示。所以我一直没有发现,知道今天一个朋友告诉我,blog上的评论不能用,要认证码,还无效。我当时无语了,问:什么网站,竟然要验证码!
重新改了配置,也检查了一下现在是有的所有插件及其配置,好像已没什么问题了。
把自动升级关掉!
阿门!
Defined tags for this entry:

Posted by rollenc

Not modified
2007/04 20
一直以来,就以为收音机是被淘汰了的事物了。今天晚上无意拿出耳机,用手机听了一下收音机,倒有了别样的心情和惊喜。
曾看过这样的一段话,在美国的调查中,问,年轻人,什么时候你会感觉到快乐?很多的答案的,偶然遇到故友,在收音机中听到了自己喜欢的歌。。《如何快乐》的第十条:心情不好时,打开车上的收音机,调到较大音量,跟着里面播放的旋律大声歌唱。不过,我觉得根号的方式是静静的聆听,直到触动自己的那个音符出现。。。
收音机给我的魅力也就在与此。你不会知道,下一个台词是什么。刚才也听到了燕子的声音,我会微笑。停下手头的事情来,静静的听完。因为,这首音乐过去,很难在这样的环境中再次听到。
大学时期,经常听收音机,晚自习时间去马路上散步,听“罗丹音乐剧场”,把思绪完全交给耳朵,追随那种非常随意的感动。晚上入睡,听完11点钟的“非常可乐”,在笑声中入睡。11点之后绝对不是听收音机的时间。理由,不讲了。
随意的语言,不经意的幸福触动。收音机是轻松下来的工具。而我,常常使用MP3来塞耳朵,学习也好,封闭自己隔离外界环境也罢。即便是在寂寞时放大了音量嘴巴大声吼,也赶不上收音机中那非常恰好的一个音符。
追随,在最随意时
Defined tags for this entry: ,

Posted by rollenc

Last modified on 2007-04-20 22:33
2007/04 20
两域名分别为:
phpapp.cn
phpapplication.cn
这是为php系列的第三个重要域名了。
整个一条php社区线形成了:
function(phpfunction.cn) -> library(phplibrary.cn) -> application(phpapplication.cn)
目前我会重点做一下library。网址:http://www.phplibrary.cn
三马说的,等解决了吃饭的问题,我们要好好做些事情出来!
Defined tags for this entry:

Posted by rollenc

Last modified on 2007-04-20 22:34
2007/04 19
当然,梦寐中的Google 20%工作时间是不可能的啦,但是,我已经快无法忍受目前近乎100%的工作时间了。
眼睛好疼。现在电脑很刺眼!

Posted by rollenc

Last modified on 2007-04-23 17:29
2007/04 18
一般开发会使用localhost或者127.0.0.1来访问本机的apache。从apache2的某个版本开始,支持如127.*.*.*的地址如127.0.0.2来访问本机,当然,如果没有配置,得到的结果和localhost是一样的。
比如解析127.0.0.2的配置文件如下:

ServerAdmin webmaster@localhost

DocumentRoot E:/htdocs/phplibrary

Options FollowSymLinks
AllowOverride None


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/


ErrorLog D:\Apache2.2\logs\phplibrary.cn_error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog D:\Apache2.2\logs\phplibrary.cn_access.log combined
ServerSignature On


把它加到你的apache配置中,重启apache就可以访问127.0.0.2.指向是跟127.0.0.1不同了。

但是这样的配置只能供你个人机访问,如果需要在局域网中其他人也访问到你的其他域,那就按照下面的来吧:
两种方式:
1.端口实现:
Listen 8080

DocumentRoot E:/htdocs/phplibrary
ErrorLog D:\Apache2.2\logs\phplibrary.cn_error.log
CustomLog D:\Apache2.2\logs\phplibrary.cn_access.log combined


其他人就可以通过你的ip,比如:192.168.0.106:8080来访问phplibrary站了。
同样,你还可以增加8081等等等等。。。

2.hosts文件实现
添加hosts文件行。windows中hosts文件位于:C:\WINDOWS\system32\drivers\etc
127.0.0.1       localhost
127.0.0.1	www.phplibrary.dev
127.0.0.1       www.phpfunction.dev
192.168.1.106	rollenc.www.phplibrary.dev
192.168.1.106	rollenc.www.phpfunction.dev
192.168.1.17	yourname.www.phplibrary.dev
192.168.1.17	yourname.www.phpfunction.dev

然后,添加apache配置:

ServerName www.phplibrary.dev
ServerAlias rollenc.2007.phplibrary.dev yourname.2007.phplibrary.dev  #这一行需要与hosts中的同步,单独修改hosts是无效的。
DocumentRoot E:/htdocs/phplibrary
ErrorLog D:\Apache2.2\logs\phplibrary.cn_error.log
CustomLog D:\Apache2.2\logs\phplibrary.cn_access.log combined


再加一站点:

ServerName www.phpfunction.dev
ServerAlias rollenc.2007.phpfunction.dev yourname.2007.phpfunction.dev  #这一行需要与hosts中的同步,单独修改hosts是无效的。
DocumentRoot E:/htdocs/phpfunction
ErrorLog D:\Apache2.2\logs\phpfunction.cn_error.log
CustomLog D:\Apache2.2\logs\phpfunction.cn_access.log combined


OK,把hosts文件分发给你局域网内的成员。他们就可以通过rollenc.www.phplibrary.dev来访问rollenc机器上的www.phplibrary.dev域了。
Defined tags for this entry:

Posted by rollenc

Last modified on 2007-04-18 11:45
2007/04 18
18
Hacking Ubuntu to Improve Performance

Defined tags for this entry:

Posted by rollenc

Last modified on 2007-04-18 09:24

(Page 18 of 34, totaling 505 entries)