Configuring the Apache Web Server to Run Perl 在Apache中运行Perl

Categories: Development Notes; Tagged with: ; @ May 5th, 2012 16:22

1. Install Perl

2. Install Apache & config httpd:

Options Indexes FollowSymLinks
Add ExecCGI to this line. The line should now look like the following:
Options Indexes FollowSymLinks ExecCGI
Next, search for the following:
#AddHandler cgi-script .cgi
Uncomment this line by removing the # in front of the line, and add a .pl to the end of the line. The new line should look like this:
AddHandler cgi-script .cgi .pl

3. Start the server, and check the server environment:

http://localhost:8080/cgi-bin/printenv.pl

There should be some  environment variables like  DOCUMENT_ROOT/PATH/SCRIPT_FILENAME….

4. Drop a Perl(hello.pl) into the server:

#!D:/perl/bin/perl.exe
print "Content-type: text/html; charset=utf-8\n\n";
print "<phtml><head><title>Learning Perl</title></head><body>";
print "<h1>PerlPage</h1>";
print "<form action='upload.pl' method='post'>";
print "<input type=file name=='file'>";
print "<input type=text name='comment' size=20 value=''>";
print "<input type=submit name=enter value='Upload'>";
print "<form>";
print "</body></html>";

you can just drop this file in your ApacheHome/cgi-bin or your site if you have configured the httpd.conf;

5. check the Perl page:

http://localhost:8080/cgi-bin/hello.pl

 

Ref:http://www.editrocket.com/articles/perl_apache_windows.html

Luntbuild: config build schedule using Quartz 使用Quartz配置build安排

Categories: Development Notes; Tagged with: ; @ March 24th, 2012 21:20

Quartz is a full-featured, open source job scheduling service that can be integrated with, or used along side
virtually any Java EE or Java SE application – from the smallest stand-alone application to the largest
e-commerce system. Quartz can be used to create simple or complex schedules for executing tens, hundreds,
or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components that are
programmed to fulfill the requirements of your application. The Quartz Scheduler includes many
enterprise-class features, such as JTA transactions and clustering.

Many organization and frameworks are using Quartz, Jboss, Spring, and Luntbuild, Quartz Scheduler is licensed under the Apache License, Version 2.0 http://www.quartz-scheduler.org/overview/license-and-copyright

And here is a introduction of CronTrigger: http://www.quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/crontrigger

 

How to set the cron expression in Luntbuild: http://luntbuild.javaforge.com/manual/guide/ch14s02.html


 

Here are some full examples:

**Expression**

**Meaning**

0 0 12 * * ?

Fire at 12pm (noon) every day

0 15 10 ? * *

Fire at 10:15am every day

0 15 10 * * ?

Fire at 10:15am every day

0 15 10 * * ? *

Fire at 10:15am every day

0 15 10 * * ? 2005

Fire at 10:15am every day during the year 2005

0 * 14 * * ?

Fire every minute starting at 2pm and ending at 2:59pm, every day

0 0/5 14 * * ?

Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day

0 0/5 14,18 * * ?

Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day

0 0-5 14 * * ?

Fire every minute starting at 2pm and ending at 2:05pm, every day

0 10,44 14 ? 3 WED

Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.

0 15 10 ? * MON-FRI

Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday

0 15 10 15 * ?

Fire at 10:15am on the 15th day of every month

0 15 10 L * ?

Fire at 10:15am on the last day of every month

0 15 10 L-2 * ?

Fire at 10:15am on the 2nd-to-last last day of every month

0 15 10 ? * 6L

Fire at 10:15am on the last Friday of every month

0 15 10 ? * 6L

Fire at 10:15am on the last Friday of every month

0 15 10 ? * 6L 2002-2005

Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005

0 15 10 ? * 6#3

Fire at 10:15am on the third Friday of every month

0 0 12 1/5 * ?

Fire at 12pm (noon) every 5 days every month, starting on the first day of the month.

0 11 11 11 11 ?

Fire every November 11th at 11:11am.

Pay attention to the effects of ‘?’ and ‘*’ in the day-of-week and day-of-month fields!

Using Date and Time in Ant 在Ant中使用日期及时间

Categories: Development Notes; Tagged with: ; @ March 22nd, 2012 23:08

Example:

<tstamp>
            <format property="today" pattern="yyyy_MM_dd_HH_mm"/>
        </tstamp>
<echo message="${today}"></echo>

 

[echo] 2012_03_22_23_00

 

Tstamp in Ant manual:

http://ant.apache.org/manual/Tasks/tstamp.html

MediaWiki: “Save as” pop up when click “Create” or “Edit”

Categories: Development Notes; Tagged with: ; @ September 27th, 2011 22:45

It’s really tough for me to use the default editor, so I install a plug-in: FCKEditor.

but as a user, when click “Edit” or “Create”, “Save as” window will pop up, but a guest can create/edit page using the Editor.

After post a discussion on the support desk of MediaWiki: http://www.mediawiki.org/wiki/Project:Support_desk;

the solution is:

Disable “use external editor” in your preferences.

by Max Semenik

Perforce: Can’t clobber writable file Perforce

Categories: Development Notes; Tagged with: ; @ August 29th, 2011 21:08

We are using Perforce for version control, I never use it before, and I got my perforce account those days. When I want update form the dept, perforce gave the following error:

Can’t clobber writable file Perforce

Here is the solution:

“A workaround is to stop perforce from making the files read-only on submit. This can be accomplished by changing the Client Specification and setting the “allwrite” flag. This way the files never go to readonly mode and you should be able to write to it always.”

>>See more<<

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.