笔头。。
实践启示
posts - 14,comments - 3,trackbacks - 0
安装apache服务器指南http://www.knowsky.com/2989.html

安装apache服务器出现的问题

winxp 下 apache2 安装 问题及解决
安装apache 2 出现的问题:

“(OS 10048)通常每个套接字地址 (协议/网络地址/端口) 只允许使用一次:
make_sock: could not bind to address 0.0.0.0:80...”

一般是IIS或其他程序占用了80端口引起的
分析:
netstat -a
查看相应端口,是否有程序占用
netstat -ab
查看具体占用程序

两种解决方法:
1、打开 控制面板->服务 找到 IIS admin 等相应服务 关闭并禁用
2、如果不想关闭IIS服务 可将apache使用的端口改成其它端口
将apache2/conf/httpd.conf 中的
Listen 80 改为 Listen (你要使用的端口) 如 Listen 8080
不过这时在你访问你的apache 下的Web服务时 在域名后要加上端口号
如: http://localhost:8080

然后用CMD进入命令行模式 进入你安装apache的目录 /apache2/bin
输入
apache -k install
apache -k start
cgwin的安装http://anying.spaces.live.com/Blog/cns!1pBetjxyWRhAf0VYS0IjiD_g!711.entry

连接http://twiki.org/cgi-bin/view/TWiki/WindowsInstallCookbookForTWiki04x01,for window 的安装

设置LocalSite.cfg

# Local site settings for TWiki. This file is managed by the 'configure'
# CGI script, though you can also make (careful!) manual changes with a
# text editor.
$TWiki::cfg{DefaultUrlHost} = 'http://localhost:8060';
$TWiki::cfg{ScriptUrlPath} = '/twiki/bin';
$TWiki::cfg{PubUrlPath} = '/twiki/pub';
$TWiki::cfg{PubDir} = 'c:/PROGRA~1/TWiki/twiki/pub';
$TWiki::cfg{TemplateDir} = 'c:/PROGRA~1/TWiki/twiki/templates';
$TWiki::cfg{DataDir} = 'c:/PROGRA~1/TWiki/twiki/data';
$TWiki::cfg{LocalesDir} = 'c:/PROGRA~1/TWiki/twiki/locale';
$TWiki::cfg{WorkingDir} = 'c:/PROGRA~1/TWiki/twiki/working';
$TWiki::cfg{ScriptSuffix} = '';
$TWiki::cfg{Password} = 'OmNauFZ7U.p3Y';
$TWiki::cfg{UseClientSessions} = 1;
$TWiki::cfg{Sessions}{ExpireAfter} = 21600;
$TWiki::cfg{Sessions}{ExpireCookiesAfter} = 0;
$TWiki::cfg{Sessions}{IDsInURLs} = 0;
$TWiki::cfg{Sessions}{UseIPMatching} = 1;
$TWiki::cfg{Sessions}{MapIP2SID} = 0;
$TWiki::cfg{LoginManager} = 'TWiki::LoginManager::TemplateLogin';
$TWiki::cfg{LoginNameFilterIn} = '^[^\\s\\*?~^\\$@%`"\'&;|<>\\x00-\\x1f]+$';
$TWiki::cfg{DefaultUserLogin} = 'guest';
$TWiki::cfg{DefaultUserWikiName} = 'TWikiGuest';
$TWiki::cfg{AdminUserWikiName} = 'TWikiAdminGroup';
$TWiki::cfg{AdminUserLogin} = 'admin';
$TWiki::cfg{SuperAdminGroup} = 'TWikiAdminGroup';
$TWiki::cfg{UsersTopicName} = 'TWikiUsers';
$TWiki::cfg{AuthScripts} = 'attach,edit,manage,rename,save,upload,viewauth,rdiffauth';
$TWiki::cfg{AuthRealm} = 'Enter your TWiki.LoginName. (Typically First name and last name, no space, no dots, capitalized, e.g. !JohnSmith, unless you chose otherwise). Visit TWiki.TWikiRegistration if you do not have one.';
$TWiki::cfg{UserMappingManager} = 'TWiki::Users::TWikiUserMapping';
$TWiki::cfg{Register}{EnableNewUserRegistration} = 1;
$TWiki::cfg{Register}{HidePasswd} = 1;
$TWiki::cfg{Register}{NeedVerification} = 1;
$TWiki::cfg{PasswordManager} = 'TWiki::Users::HtPasswdUser';
$TWiki::cfg{MinPasswordLength} = 1;
$TWiki::cfg{Htpasswd}{FileName} = 'c:\\PROGRA~1\\TWiki\\twiki\\data\\.htpasswd.txt';
$TWiki::cfg{Htpasswd}{Encoding} = 'plain';
$TWiki::cfg{SafeEnvPath} = '';
$TWiki::cfg{OS} = 'WINDOWS';
$TWiki::cfg{DetailedOS} = 'MSWin32';
$TWiki::cfg{DenyDotDotInclude} = 1;
$TWiki::cfg{AllowInlineScript} = 1;
$TWiki::cfg{UploadFilter} = '^(\\.htaccess|.*\\.(?i)(?:php[0-9s]?(\\..*)?|[sp]htm[l]?(\\..*)?|pl|py|cgi))$';
$TWiki::cfg{NameFilter} = '[\\s\\*?^\\$@%`"\'&;|<>\\x00-\\x1f]';
$TWiki::cfg{AccessibleENV} = '^(HTTP_\\w+|REMOTE_\\w+|SERVER_\\w+|REQUEST_\\w+|MOD_PERL)$';
$TWiki::cfg{AntiSpam}{EmailPadding} = '';
$TWiki::cfg{AntiSpam}{HideUserDetails} = 1;
$TWiki::cfg{AntiSpam}{RobotsAreWelcome} = 1;
$TWiki::cfg{Log}{view} = 1;
$TWiki::cfg{Log}{search} = 1;
$TWiki::cfg{Log}{changes} = 1;
$TWiki::cfg{Log}{rdiff} = 1;
$TWiki::cfg{Log}{edit} = 1;
$TWiki::cfg{Log}{save} = 1;
$TWiki::cfg{Log}{upload} = 1;
$TWiki::cfg{Log}{attach} = 1;
$TWiki::cfg{Log}{rename} = 1;
$TWiki::cfg{Log}{register} = 1;
$TWiki::cfg{ConfigurationLogName} = 'c:/PROGRA~1/TWiki/twiki/data/configurationlog.txt';
$TWiki::cfg{DebugFileName} = 'c:/PROGRA~1/TWiki/twiki/data/debug.txt';
$TWiki::cfg{WarningFileName} = 'c:/PROGRA~1/TWiki/twiki/data/warn%DATE%.txt';
$TWiki::cfg{LogFileName} = 'c:/PROGRA~1/TWiki/twiki/data/log%DATE%.txt';
$TWiki::cfg{Languages}{cs}{Enabled} = 1;
$TWiki::cfg{Languages}{da}{Enabled} = 1;
$TWiki::cfg{Languages}{de}{Enabled} = 1;
$TWiki::cfg{Languages}{es}{Enabled} = 1;
$TWiki::cfg{Languages}{fr}{Enabled} = 1;
$TWiki::cfg{Languages}{it}{Enabled} = 1;
$TWiki::cfg{Languages}{nl}{Enabled} = 1;
$TWiki::cfg{Languages}{pl}{Enabled} = 1;
$TWiki::cfg{Languages}{pt}{Enabled} = 1;
$TWiki::cfg{Languages}{ru}{Enabled} = 1;
$TWiki::cfg{Languages}{sv}{Enabled} = 1;
$TWiki::cfg{Languages}{'zh-cn'}{Enabled} = 1;
$TWiki::cfg{Languages}{'zh-tw'}{Enabled} = 1;
$TWiki::cfg{DisplayTimeValues} = 'servertime';
$TWiki::cfg{DefaultDateFormat} = '$day $month $year';
$TWiki::cfg{Site}{Locale} = 'zh_CN.UTF-8';
$TWiki::cfg{Site}{LocaleRegexes} = 1;
$TWiki::cfg{UpperNational} = '';
$TWiki::cfg{LowerNational} = '';
$TWiki::cfg{PluralToSingular} = 1;
$TWiki::cfg{StoreImpl} = 'RcsLite';
$TWiki::cfg{RCS}{ExtOption} = '-x,v';
$TWiki::cfg{RCS}{dirPermission} = 493;
$TWiki::cfg{RCS}{filePermission} = 420;
$TWiki::cfg{Store}{RememberChangesFor} = 2678400;
$TWiki::cfg{RCS}{asciiFileSuffixes} = '\\.(txt|html|xml|pl)$';
$TWiki::cfg{RCS}{initBinaryCmd} = '/usr/bin/rcs  -i -t-none -kb %FILENAME|F%';
$TWiki::cfg{RCS}{initTextCmd} = '/usr/bin/rcs  -i -t-none -ko %FILENAME|F%';
$TWiki::cfg{RCS}{tmpBinaryCmd} = '/usr/bin/rcs  -kb %FILENAME|F%';
$TWiki::cfg{RCS}{ciCmd} = '/usr/bin/ci  -m%COMMENT|U% -t-none -w%USERNAME|S% -u %FILENAME|F%';
$TWiki::cfg{RCS}{ciDateCmd} = '/usr/bin/ci  -m%COMMENT|U% -t-none -d%DATE|D% -u -w%USERNAME|S% %FILENAME|F%';
$TWiki::cfg{RCS}{coCmd} = '/usr/bin/co  -p%REVISION|N% -ko %FILENAME|F%';
$TWiki::cfg{RCS}{histCmd} = '/usr/bin/rlog  -h %FILENAME|F%';
$TWiki::cfg{RCS}{infoCmd} = '/usr/bin/rlog  -r%REVISION|N% %FILENAME|F%';
$TWiki::cfg{RCS}{rlogDateCmd} = '/usr/bin/rlog  -d%DATE|D% %FILENAME|F%';
$TWiki::cfg{RCS}{diffCmd} = '/usr/bin/rcsdiff  -q -w -B -r%REVISION1|N% -r%REVISION2|N% -ko --unified=%CONTEXT|N% %FILENAME|F%';
$TWiki::cfg{RCS}{lockCmd} = '/usr/bin/rcs  -l %FILENAME|F%';
$TWiki::cfg{RCS}{unlockCmd} = '/usr/bin/rcs  -u %FILENAME|F%';
$TWiki::cfg{RCS}{breaklockCmd} = '/usr/bin/rcs  -u -M %FILENAME|F%';
$TWiki::cfg{RCS}{delRevCmd} = '/usr/bin/rcs  -o%REVISION|N% %FILENAME|F%';
$TWiki::cfg{RCS}{SearchAlgorithm} = 'TWiki::Store::SearchAlgorithms::Forking';
$TWiki::cfg{RCS}{EgrepCmd} = 'c:/PROGRA~1/GnuWin32/bin/grep -E %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
$TWiki::cfg{RCS}{FgrepCmd} = 'c:/PROGRA~1/GnuWin32/bin/grep -F %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
$TWiki::cfg{EnableHierarchicalWebs} = 0;
$TWiki::cfg{SystemWebName} = 'TWiki';
$TWiki::cfg{TrashWebName} = 'Trash';
$TWiki::cfg{UsersWebName} = 'Main';
$TWiki::cfg{WebMasterEmail} = 'zhanghui026@gmail.com';
$TWiki::cfg{WebMasterName} = 'TWiki Administrator';
$TWiki::cfg{MailProgram} = '';
$TWiki::cfg{SMTP}{MAILHOST} = 'smtp.sina.com.cn';
$TWiki::cfg{SMTP}{SENDERHOST} = '';
$TWiki::cfg{SMTP}{Username} = '';
$TWiki::cfg{SMTP}{Password} = '';
$TWiki::cfg{RemoveImgInMailnotify} = 1;
$TWiki::cfg{NotifyTopicName} = 'WebNotify';
$TWiki::cfg{SMTP}{Debug} = 0;
$TWiki::cfg{PROXY}{HOST} = '';
$TWiki::cfg{PROXY}{PORT} = '';
$TWiki::cfg{Stats}{TopViews} = 10;
$TWiki::cfg{Stats}{TopContrib} = 10;
$TWiki::cfg{Stats}{TopicName} = 'WebStatistics';
$TWiki::cfg{TemplatePath} = 'c:/PROGRA~1/TWiki/twiki/templates/$web/$name.$skin.tmpl, c:/PROGRA~1/TWiki/twiki/templates/$name.$skin.tmpl, c:/PROGRA~1/TWiki/twiki/templates/$web/$name.tmpl, c:/PROGRA~1/TWiki/twiki/templates/$name.tmpl, $web.$skinSkin$nameTemplate, TWiki.$skinSkin$nameTemplate, $web.$nameTemplate, TWiki.$nameTemplate';
$TWiki::cfg{LinkProtocolPattern} = '(file|ftp|gopher|https|http|irc|mailto|news|nntp|telnet)';
$TWiki::cfg{SiteWebTopicName} = '';
$TWiki::cfg{SitePrefsTopicName} = 'TWikiPreferences';
$TWiki::cfg{LocalSitePreferences} = 'Main.TWikiPreferences';
$TWiki::cfg{HomeTopicName} = 'WebHome';
$TWiki::cfg{WebPrefsTopicName} = 'WebPreferences';
$TWiki::cfg{NumberOfRevisions} = 4;
$TWiki::cfg{ReplaceIfEditedAgainWithin} = 3600;
$TWiki::cfg{LeaseLength} = 3600;
$TWiki::cfg{LeaseLengthLessForceful} = 3600;
$TWiki::cfg{MimeTypesFileName} = 'c:/PROGRA~1/TWiki/twiki/data/mime.types';
$TWiki::cfg{Plugins}{CommentPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{EditTablePlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{InterwikiPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{PreferencesPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{SlideShowPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{SmiliesPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{SpreadSheetPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{TablePlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{TwistyPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{TinyMCEPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{WysiwygPlugin}{Enabled} = 0;
$TWiki::cfg{PluginsOrder} = 'SpreadSheetPlugin';
$TWiki::cfg{MailerContrib}{EmailFilterIn} = '';
$TWiki::cfg{Languages}{bg}{Enabled} = 0;
$TWiki::cfg{Languages}{jp}{Enabled} = 0;
$TWiki::cfg{Site}{CharSet} = 'UTF-8';
$TWiki::cfg{Site}{Lang} = 'zh';
$TWiki::cfg{Site}{FullLang} = 'zh-cn';
$TWiki::cfg{PermittedRedirectHostUrls} = 'http://localhost';
$TWiki::cfg{EnableEmail} = 1;
$TWiki::cfg{UserInterfaceInternationalisation} = 1;
$TWiki::cfg{UseLocale} = 1;
$TWiki::cfg{RCS}{QueryAlgorithm} = 'TWiki::Store::QueryAlgorithms::BruteForce';
$TWiki::cfg{ExtensionsRepositories} = 'TWiki.org=(http://twiki.org/cgi-bin/view/Plugins/,http://twiki.org/p/pub/Plugins/)';
$TWiki::cfg{Register}{AllowLoginName} = 1;
1;
posted @ 2008-04-16 22:45 如果有一天de 阅读(3283) | 评论 (0)编辑 收藏
     摘要: My Oracle Cook Book-来自oralce菜鸟的学习笔记
准备
用到的是oracle自带的用户和表
用户为scott/tiger
步骤是:连接数据库  阅读全文
posted @ 2008-03-28 09:26 如果有一天de 阅读(560) | 评论 (0)编辑 收藏
     摘要: Try not to take this personally, but Tracy McGrady hates you.
Sunday, March 09, 2008

All right, maybe not you specifically, but what you think. He knows you never thought much of him as a leader, even though it's pretty clear it was never really in his serene(adj.宁静的、安静的) personality. He knows you think he is soft(软蛋), a critique(n.批评) left over from those nights you begged him to drive the ball and take the hit with a bulging disk(灌篮). And he knows you think he is -- for lack o  阅读全文
posted @ 2008-03-10 22:31 如果有一天de 阅读(422) | 评论 (0)编辑 收藏
    最近在修改组里的TMonitor程序头疼坏了,程序的好多类在设计之初没有考虑线程安全性,现在在源程序上加功能,怎一个痛苦了的。。。
    杨哥(我刚到公司时接手他的程序)是个大牛,他在地图的方面开始设计的很好,但是都是静态数据,没有数据的动态变化的麻烦,然而后来在
JMapEdit上实现模拟动态飞行以及动态监控上实现起来是个头疼的问题,可能会多个线程访问共享变量,而且有线程对共享变量的write操作,在程序中尽量调整原接口以及实现方式。杨哥走了,目前在组里只有我一个人了解地图类编程,昨天跟方sir商量新来的同事是否也能接触我的程序,方sir的回答:TMonitor还是比较难的,估计新来的同事(是个女的)不成,下次招个男的让他接。。。不爽中,俺还是希望带个女滴。。。
   
    PS:经验总结。
    在没有正确同步的情况下,如果多线程访问同一个变量,你的程序就存在隐患。有3种方法修复它:
  • 不要多线程共享变量
  • 使状态变量为不可变的;或者
  • 在任何访问状态变量的时候使用同步
    设计线程安全的类时,使用封装、不可变性以及明确的不便约束等面向对象技术可以使你在解决同步方面的问题时思路清晰
posted @ 2008-03-05 15:50 如果有一天de 阅读(235) | 评论 (0)编辑 收藏