LittleCloud's Java World

Live and learn.
posts - 18, comments - 29, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

运行环境:
Windows XP, ActivePerl-5.8.8.817-MSWin32-x86-257965.msi

安装完毕,
用记事本打开apache的httpd.conf文件,
1.搜索cgi-bin,找到ScriptAlias /cgi-bin/
改成
 ScriptAlias /cgi-bin/ "F:/Apache2/cgi-bin/"
,这是存放cgi文件的路径
2. 搜索AddHandler  找到AddHandler  cgi-script .cgi ,这是定义可执行cgi文件扩展名,可以把.cgi 改为 .pl 或加上”, .pl” ,成为“AddHandler cgi-script .pl ,.cgi“这样两个后缀都可以用了。
3.更改Options、Allow Override的参数为All。
改完之后象这样:
#
"F:/Apache2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists
, if you have that configured.
#
<Directory 
"F:/Apache2/cgi-bin">
    AllowOverride All
    Options All
    Order allow
,deny
    Allow from all
</Directory>
 4.建立文件 test.pl , 内容如下:

#!d:/Perl/bin/perl 
#
#   写成!d:/Perl/bin/perl.exe也可以
#
# 注意,如果没有第一行或写错,apache找不到perl解释器
#
# ,会出现500 Internal Server
 
print "Content-type:text/html\n\n";
print "CGI执行成功!";

在F:\phpweb目录下,建立一个html文件,内容如下:
<a http://168.68.73.97/cgi-bin/test.pl" > CGI</a>
5. 重新启动apache server,然后在浏览器打开这个文件,提示 “CGI执行成功!”

posted @ 2008-02-29 17:57 walkingpig 阅读(711) | 评论 (0)编辑 收藏

上一篇windowsxp 下安装php是为了安装TestLink而配的,
TestLink的安装有两种方式,一是自动安装,二是手工安装的方式。
我用的是自动安装

在上篇配置好的php环境下,按如下步骤安装TestLink

1.将TestLink文件夹拷贝到F:\phpweb目录下。
2.在浏览器输入访问地址http://168.68.73.97/testlink/
若没有安装就会自动跳到http://168.68.73.97/testlink/install/index.php安装页
3.选择new install,在进入的页面中,输入登录MySQL的用户名和密码,如root,如果没有为TestLink新建一个专用的用户,也可以输入初始用户root。但是因为root权限过多,所以,建议为TestLink新建专用的用户,并为该用户赋予ALTER、SELECT、INSERT、UPDATE、INDEX、CREATE、DELETE和DROP权限。
3.提示安装成功。系统为testlink创建一个默认管理员账号,用户名和密码为:admin/admin。你可以使用这个账号访问TestLink

在自动安装过程中,安装程序主要做了以下事情:
1.检查web server的参数、php配置、数据库版本
2.创建数据库和表,并导入初始数据
3.完成安装

posted @ 2008-02-29 17:17 walkingpig 阅读(783) | 评论 (0)编辑 收藏

我是第一次在xp下配置php
在网上找了很多资料,按照上面的一步步配,总会在半路出现一些问题,
以下是我综合几个网友的资料配置成功的步骤:

操作系统:windows xp
apache_2.2.6-win32-x86-no_ssl.msi  
http://apache.mirror.phpchina.com/httpd/binaries/win32/apache_2.2.6-win32-x86-openssl-0.9.8e.msi
php-5.2.5-win32-installer.msi 
http://cn2.php.net/distributions/php-5.2.5-win32-installer.msi
PHP 5.2.5 zip package
http://cn.php.net/get/php-5.2.5-Win32.zip/from/cn2.php.net/mirror(这里面有需要的dll文件)
mysql-5.0.22-win32_Setup.exe
http://www.mysql.com/

开始安装

一、安装Apache2.2.6

1 运行安装程序 图1

 

 

2 下一步,图2 安装协议

 


3 下一步,图3 Apache HTTP Server的一些说明

 


4 下一步,图4 填写服务信息

Network Domain 域名 ,这里填写 localhostServer Name 服务器名,这里填写 localhost

Administrator‘s Email Address 管理员邮箱

 

 

 

5 安装类型

选择自定义安装 Custom,图5

 

 

6 自定义安装设置,图6

 

 

修改安装目录,这里我把目录修改到F:\Apache2\图7

 

 

7 安装确认,图8

 

 

8 开始安装,图9

 

 

安装最后会出现几个命令行窗口。

9 安装完毕,图10

 

 

10 右下角出现图标,图11

 

 

11 双击显示服务器监控信息,图12

 

 

12 测试,图13

在浏览器地址栏输入 http://localhost,回车显示 “It works!”。

如图,表示安装成功了!

 

 

这样 Apache就安装完毕了。

二、安装PHP5.2.5

1 拷贝需要的组件

解压php-5.2.5-Win32.zip到“G:/PHPTemp”。这里主要是拷贝一些以后需要的组件。

2 运行安装程序php-5.2.5-win32-installer.msi

 

 

3 接受 安装协议

 

 

4 选择安装目录,

选定目录.我设置的是F:\php\

 

 

5 选择服务器设置

 

 

6 选择Apache配置文件目录,按我之前的配置,这里我选的是F:\Apache2\

 

 

7 安装设置

 

 

8 准备安装

 

 

9 安装完毕

 

 

10 从G:/PHPTemp拷贝libmysql.dll及ext文件夹到F:/PHP
并在F:/PHP/php.ini中修改成
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;  extension=msql.dll
   extension=php_mysql.dll
   extension=php_mysqli.dll
;
; ... or under UNIX:

将F:/PHP/php.ini文件拷贝到C:\WINDOWS目录下
将F:/PHP/libmysql.dll文件拷贝到 C:\WINDOWS\system32目录下
将F:/PHP/ext/php_mysql.dll 文件拷贝到 C:\WINDOWS\system32目录下
将F:/PHP/ext/php_mysqli.dll文件拷贝到 C:\WINDOWS\system32目录下

11 对Apache进行设置

 在F:\下建立phpweb子目录,即“F:/phpweb”目录。

修改目录F:\Apache2\conf下的文件“ httpd.conf”。

搜索DocumentRoot "F:/Apache2/htdocs"把冒号中的F:/Apache2/htdocs,替换成“F:/phpweb";

搜索<Directory "F:/Apache2/htdocs"> 把冒号中的F:/Apache2/htdocs,替换成“F:/phpweb";

上面这两行可以不改,那么以后添加的论坛程序就要放在f:/Apache2/htdocs下面,就是以这个目录作为根目录。改的目的就是不想把所有网站程序都放在Apache的目录下面。

搜索DirectoryIndex index.html 增加为DirectoryIndex index.html index.php

上面这句为了能够运行缺省的页面,这里增加了 index.php作为缺省页面。

修改完毕,保存,并重新启动Apache服务器,也许会启动不成功,这时要不按Ctrl+Alt+Del删除Apache相关程序,要不重新启动计算机。

12 测试

在“f:/phpweb”目录中,创建文件 test.php

 

<html>
<
head
>
  <
title>PHP Tes</title
>
</
head
>
<
body
>
<?
php echo "<p>Hello World</p>"; 
?>
</
body
>
</
html>

 在浏览器地址栏中输入 http://localhost/test.php,显示如下,

 

显示:
Hello World

那么你安装Apache和PHP成功了。

posted @ 2008-02-29 16:54 walkingpig 阅读(485) | 评论 (0)编辑 收藏

最近网站总是打开太慢,到后来干脆就不能打开了,

进到服务器重启tomcat服务时,竟然报了jvm内存设置太大

ps一看,发现了很多mysqld进程,

占内存,也占了很多CPU,

我是用的二进制包安装的mysql,网上一查,有很多朋友说,这属正常,

可我担心过几天服务器还会出现同样的问题,怎么办

posted @ 2008-02-28 17:21 walkingpig 阅读(362) | 评论 (0)编辑 收藏

看了apache+iis+tomcat可以让asp,jsp同时跑,
不知道再加个.net,php,cgi的项目站点,
又该怎么配置呢?

posted @ 2008-02-27 09:26 walkingpig 阅读(624) | 评论 (1)编辑 收藏

${sessionScope.user}

这是我在<sturts2权威指南>里看见的语法

说是jsp2.0的语法, 我用jsp这么久怎么不知道有这样的语法?
难道jsp1升级到jsp2后,语法也有改变吗?
sturts1升级到struts2后就有很大不同,
版本升级这么快,感觉自己要是不勤加学习,真的太容易被淘汰掉了.

posted @ 2008-02-22 11:26 walkingpig 阅读(365) | 评论 (4)编辑 收藏

现在还处于自学struts2阶段,所以很多文章都是从网上转了网友的, 呵呵,
看见好的文章就想自己收藏一份,以备忘.

原文出处:http://bbs.8isp.cn/simple/index.php?t1002.html

struts.action.extension
      The URL extension to use to determine if the request is meant for a Struts action
      用URL扩展名来确定是否这个请求是被用作Struts action,其实也就是设置 action的后缀,例如login.do的'do'字。

struts.configuration
      The org.apache.struts2.config.Configuration implementation class
        org.apache.struts2.config.Configuration接口名

struts.configuration.files
      A list of configuration files automatically loaded by Struts
      struts自动加载的一个配置文件列表

struts.configuration.xml.reload
      Whether to reload the XML configuration or not
      是否加载xml配置(true,false)

struts.continuations.package
      The package containing actions that use Rife continuations
      含有actions的完整连续的package名称

struts.custom.i18n.resources
      Location of additional localization properties files to load
      加载附加的国际化属性文件(不包含.properties后缀)

struts.custom.properties
      Location of additional configuration properties files to load
      加载附加的配置文件的位置


struts.devMode
      Whether Struts is in development mode or not
      是否为struts开发模式

struts.dispatcher.parametersWorkaround
      Whether to use a Servlet request parameter workaround necessary for some versions of WebLogic
        (某些版本的weblogic专用)是否使用一个servlet请求参数工作区(PARAMETERSWORKAROUND)

struts.enable.DynamicMethodInvocation
      Allows one to disable dynamic method invocation from the URL
        允许动态方法调用

struts.freemarker.manager.classname
      The org.apache.struts2.views.freemarker.FreemarkerManager implementation class
      org.apache.struts2.views.freemarker.FreemarkerManager接口名

struts.i18n.encoding
      The encoding to use for localization messages
      国际化信息内码

struts.i18n.reload
      Whether the localization messages should automatically be reloaded
      是否国际化信息自动加载

struts.locale
      The default locale for the Struts application
      默认的国际化地区信息

struts.mapper.class
      The org.apache.struts2.dispatcher.mapper.ActionMapper implementation class
        org.apache.struts2.dispatcher.mapper.ActionMapper接口

struts.multipart.maxSize
      The maximize size of a multipart request (file upload)
      multipart请求信息的最大尺寸(文件上传用)

struts.multipart.parser
      The org.apache.struts2.dispatcher.multipart.
      MultiPartRequest parser implementation for a multipart request (file upload)
      专为multipart请求信息使用的org.apache.struts2.dispatcher.multipart.MultiPartRequest解析器接口(文件上传用)


struts.multipart.saveDir
      The directory to use for storing uploaded files
      设置存储上传文件的目录夹

struts.objectFactory
      The com.opensymphony.xwork2.ObjectFactory implementation class
      com.opensymphony.xwork2.ObjectFactory接口(spring)

struts.objectFactory.spring.autoWire
      Whether Spring should autoWire or not
      是否自动绑定Spring

struts.objectFactory.spring.useClassCache
      Whether Spring should use its class cache or not
      是否spring应该使用自身的cache

struts.objectTypeDeterminer
      The com.opensymphony.xwork2.util.ObjectTypeDeterminer implementation class
        com.opensymphony.xwork2.util.ObjectTypeDeterminer接口

struts.serve.static.browserCache
If static content served by the Struts filter should set browser caching header properties or not
      是否struts过滤器中提供的静态内容应该被浏览器缓存在头部属性中

struts.serve.static
      Whether the Struts filter should serve static content or not
      是否struts过滤器应该提供静态内容

struts.tag.altSyntax
      Whether to use the alterative syntax for the tags or not
      是否可以用替代的语法替代tags

struts.ui.templateDir
      The directory containing UI templates
      UI templates的目录夹

struts.ui.theme
      The default UI template theme
      默认的UI template主题

struts.url.http.port
      The HTTP port used by Struts URLs
      设置http端口

struts.url.https.port
      The HTTPS port used by Struts URLs
      设置https端口

struts.url.includeParams
      The default includeParams method to generate Struts URLs
      在url中产生 默认的includeParams


struts.velocity.configfile
      The Velocity configuration file path
      velocity配置文件路径

struts.velocity.contexts
      List of Velocity context names
      velocity的context列表


struts.velocity.manager.classname
      org.apache.struts2.views.velocity.VelocityManager implementation class
      org.apache.struts2.views.velocity.VelocityManager接口名

struts.velocity.toolboxlocation
      The location of the Velocity toolbox
      velocity工具盒的位置
struts.xslt.nocache
      Whether or not XSLT templates should not be cached
      是否XSLT模版应该被缓存

posted @ 2008-02-22 10:33 walkingpig 阅读(343) | 评论 (0)编辑 收藏

     摘要: 这篇文章是从网友http://www.blogjava.net/sterning/archive/2007/09/30/149775.html转来的, 他真是一位大好人,虽然在别的网站有很多转走的这篇文章,但我也想在自己的BLOG上再转一次, 理由很简单,想自己收藏一份,感谢原创sterning Struts作为MVC 2的Web框架,自推出以来不断受到开发者的追捧,得到广泛的应用。作为...  阅读全文

posted @ 2008-02-21 15:59 walkingpig 阅读(3023) | 评论 (4)编辑 收藏

从前一直用的jsp+javabean,这种模式写东西
开发工具方面通常jsp用dreamweaver, java源程序就用eclipse3.2
服务器,像tomcat,apache也是单独配置,数据库mysql也是一样,单独配置的.
感觉很容易,就是要配置的东西比较多.但却很少出错,
就算出了错,也会知道是哪个环节出错了,这样就容易解决得多.

现在即将有一个大点的项目,要求最好用struts做,
之前也做过struts1的例子, 就单独struts不加spring,hibernate等,布置起来也觉得容易,
于是想着要配置一个struts+spring+hinernate环境来做开发,一开始想到的是将版本升级,
没想到后来看了struts1与struts2还不是同一个东西,并非版本上的升级.
这些天翻了很多struts1与struts2,主要是struts2的资料看,看起来,这是一个很不错的东西,
于是便下定心用struts2+spring2+hibernate3来做这个项目,
立马在网上搜取这方面资料,还有实例,边看边配置,

没想到,让人头痛的是,重配了N次实例,我配出来的工程,最后一发布,总是404错误,
用的myeclipse6,就是不知道哪出错了,所有东西都集成在一起,不知道往哪查错.
现在脑袋快冒烟了, 不知道有没有朋友,有好的学习struts2的好办法?
请指点一下吧

posted @ 2008-02-20 14:34 walkingpig 阅读(396) | 评论 (2)编辑 收藏

仅列出标题
共2页: 上一页 1 2