How to Enable PERL on Java System Web Sever 7.0 Preview 2

How to Enable PERL on java System web server 7 Preview 2?

My OS is Solaris10

Release: 5.10

Kernel architecture: sun4u

Application architecture: sparc

Hardware provider: Sun_Microsystems

Kernel version: SunOS 5.10 Generic_118833-17

#

# more mime.types |grep =pl

type=application/x-perlexts=pl

# more mime.types |grep =cgi

type=magnus-internal/cgiexts=cgi,exe,bat

#

# more magnus.conf

#

# Copyright 2006 Sun Microsystems, Inc. All rights reserved.

# Use is subject to license terms.

#

Init fn="load-modules" shlib="libj2eeplugin.so" shlib_flags="(global|now)"

# more obj.conf

#

# Copyright 2006 Sun Microsystems, Inc. All rights reserved.

# Use is subject to license terms.

#

<Object name="default">

AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"

NameTrans fn="ntrans-j2ee" name="j2ee"

NameTrans fn=pfx2dir from=/mc-icons dir="/sun/webserver7/lib/icons" name="es-int

ernal"

PathCheck fn=unix-uri-clean

PathCheck fn="check-acl" acl="default"

PathCheck fn=find-pathinfo

PathCheck fn="find-index-j2ee"

PathCheck fn=find-index index-names="index.html,home.html,index.jsp"

ObjectType fn=type-j2ee

ObjectType fn=type-by-extension

ObjectType fn=force-type type=text/plain

Service method=(GET|HEAD) type=magnus-internal/imagemap fn=imagemap

Service method=(GET|HEAD) type=magnus-internal/directory fn=index-common

Service method=(GET|HEAD) type=*~magnus-internal/* fn=send-file

Service method=TRACE fn=service-trace

Error fn="error-j2ee"

AddLog fn=flex-log

</Object>

<Object name="j2ee">

Service fn="service-j2ee" method="*"

</Object>

<Object name="es-internal">

PathCheck fn="check-acl" acl="es-internal"

</Object>

<Object name="cgi">

ObjectType fn="force-type" type="magnus-internal/cgi"

Service fn="send-cgi"

</Object>

<Object name="send-precompressed">

PathCheck fn="find-compressed"

</Object>

<Object name="compress-on-demand">

Output fn="insert-filter" filter="http-compression"

</Object>

I want to docs Path can run PERL program.

# pwd

/sun/webserver7/https-mail.bnuzh.cn/docs

root@mail # ls

ChangeLog.txt Readme.htmblahdocsdocs.tarindex.htmlkyc

License.txtaa.pl cgi-binimgindex.plkyc.zip

[2587 byte] By [xieliangcheng] at [2007-11-26 10:22:19]
# 1

I'm not sure why your mime.types file has a reference to application/x-perl. Did you add this yourself? You should remove it. Instead, you want to map the pl extension to the magnus-internal/cgi type.

You can use the admin console to enable CGI as a file type. After logging in, click CGI Directories, check the CGI as file type checkbox, click Save. Click Deployment Pending to restart the server and make the configuration changes take effect.

elving at 2007-7-7 2:22:30 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

Thanks elving!

When I installed Web server 7.0 mime.types file have this reference

type=application/x-perlexts=pl

type=magnus-internal/cgiexts=cgi,exe,bat

My program files extension is pl ( index.pl ...etc ), So I should enable perl on web server .

I done as you said , But can't work.

xieliangcheng at 2007-7-7 2:22:30 > top of Java-index,Web & Directory Servers,Web Servers...
# 3

Sorry, I guess application/x-perl is the default MIME type association for pl after all.

Did you change the MIME type for pl to magnus-internal/cgi? You can do that by editing the mime.types file, using the admin console, or using wadm. If you changed the MIME file type for pl to magnus-internal/cgi and enabled CGI as a file type and things still don't work, please share your mime.types file, obj.conf file, errors log file, and Perl script file.

elving at 2007-7-7 2:22:30 > top of Java-index,Web & Directory Servers,Web Servers...
# 4

more mime.types

#--Sun Microsystems Inc. MIME Information

# Do not delete the above line. It is used to identify the file type.

#

# Copyright 2006 Sun Microsystems, Inc. All rights reserved.

# Use is subject to license terms.

#

type=application/octet-streamexts=bin

type=application/astound exts=asd,asn

type=application/fastman exts=lcc

type=application/java-archiveexts=jar

type=application/java-serialized-object exts=ser

type=application/java-vm exts=class

type=application/mac-binhex40exts=hqx

type=application/x-stuffitexts=sit

type=application/mbedlet exts=mbd

type=application/msword exts=doc,dot,wiz,rtf

type=application/odaexts=oda

type=application/pdfexts=pdf

type=application/postscript exts=ai,eps,ps

type=application/studiom exts=smp

type=application/timbuktuexts=tbt

type=application/vnd.ms-excelexts=xls,xlw,xla,xlc,xlm,xlt

type=application/vnd.ms-powerpointexts=ppt,pps,pot

type=application/vnd.ms-projectexts=mpp

type=application/winhlp exts=hlp

type=application/x-javascriptexts=js

type=application/x-javascript;charset=UTF-8exts=jsu

type=application/x-java-jnlp-fileexts=jnlp

type=application/x-aimexts=aim

type=application/x-asap exts=asp

type=application/x-cshexts=csh

type=application/x-dviexts=dvi

type=application/x-earthtime exts=etc

type=application/x-envoy exts=evy

type=application/x-gtar exts=gtar

type=application/x-cpio exts=cpio

type=application/x-hdfexts=hdf

type=application/x-latex exts=latex

type=application/x-javascript-config exts=jsc

type=application/x-maker exts=fm

type=application/x-mifexts=mif,mi

type=application/x-mocha exts=mocha,moc

type=application/x-msaccess exts=mdb

type=application/x-mscardfileexts=crd

type=application/x-msclipexts=clp

type=application/x-msmediaviewexts=m13,m14

type=application/x-msmetafileexts=wmf

type=application/x-msmoneyexts=mny

type=application/x-mspublisherexts=pub

type=application/x-msscheduleexts=scd

type=application/x-msterminalexts=trm

type=application/x-mswriteexts=wri

type=application/x-NET-Installexts=ins

type=application/x-netcdfexts=nc,cdf

type=application/x-ns-proxy-autoconfigexts=proxy

type=application/x-salsa exts=slc

type=application/x-shexts=sh

type=application/x-shar exts=shar

type=application/x-spriteexts=spr,sprite

type=application/x-tarexts=tar

type=application/x-tclexts=tcl

#type=application/x-perl exts=pl

type=application/x-texexts=tex

type=application/x-texinfoexts=texinfo,texi

type=application/x-timbuktu exts=tbp

type=application/x-tkinedexts=tki,tkined

type=application/x-troff-man exts=man

type=application/x-troff-me exts=me

type=application/x-troff-ms exts=ms

type=application/x-troff exts=t,tr,roff

type=application/x-wais-sourceexts=src

type=application/zipexts=zip

type=application/pre-encryptedexts=enc

type=application/x-pkcs7-crl exts=crl

type=application/x-fortezza-cklexts=ckl

type=application/xml-dtd exts=dtd

type=audio/basic exts=au,snd

type=audio/echospeechexts=es,esl

type=audio/midi exts=midi,mid

type=audio/x-aiffexts=aif,aiff,aifc

type=audio/x-wav exts=wav

type=audio/x-pn-realaudioexts=ra,ram

type=audio/x-pac exts=pac

type=audio/x-epacexts=pae

type=audio/x-liveaudioexts=lam

type=drawing/x-dwfexts=dwf

type=image/fifexts=fif

type=image/x-iconexts=ico

type=image/gifexts=gif

type=image/iefexts=ief

type=image/ifsexts=ifs

type=image/jpeg exts=jpeg,jpg,jpe,jfif,pjpeg,pjp

type=image/pngexts=png

type=image/tiff exts=tiff,tif

type=image/vndexts=dwg,svf

type=image/waveletexts=wi

type=image/bmpexts=bmp

type=image/x-photo-cdexts=pcd

type=image/x-cmu-raster exts=ras

type=image/x-portable-anymap exts=pnm

type=image/x-portable-bitmap exts=pbm

type=image/x-portable-graymapexts=pgm

type=image/x-portable-pixmap exts=ppm

type=image/x-rgb exts=rgb

type=image/x-xbitmapexts=xbm

type=image/x-xpixmapexts=xpm

type=image/x-xwindowdump exts=xwd

type=text/cssexts=css

type=text/htmlexts=htm,html

type=text/plain exts=txt

type=text/richtextexts=rtx

type=text/tab-separated-valuesexts=tsv

type=text/x-setextexts=etx

type=text/x-speechexts=talk

type=text/xmlexts=xml

type=text/xulexts=xul

type=video/isivideoexts=fvi

type=video/mpeg exts=mpeg,mpg,mpe,mpv,vbs,mpegv

type=video/x-mpeg2exts=mpv2,mp2v

type=video/msvideoexts=avi

type=video/quicktimeexts=qt,mov,moov

type=video/vivo exts=viv,vivo

type=video/waveletexts=wv

type=video/x-sgi-movieexts=movie

type=x-world/x-svrexts=svr

type=x-world/x-vrmlexts=wrl

type=x-world/x-vrtexts=vrt

type=x-conference/x-cooltalk exts=ice

enc=x-gzipexts=gz

enc=x-compressexts=z

enc=x-uuencodeexts=uu,uue

type=magnus-internal/imagemapexts=map

type=magnus-internal/parsed-htmlexts=shtml

type=magnus-internal/cgi exts=pl,cgi,exe,bat

type=application/x-x509-ca-certexts=cacert

type=application/x-x509-server-cert exts=scert

type=application/x-x509-user-certexts=ucert

type=application/x-x509-email-certexts=ecert

type=application/vnd.sun.xml.writer exts=sxw

type=application/vnd.sun.xml.writer.templateexts=stw

type=application/vnd.sun.xml.calcexts=sxc

type=application/vnd.sun.xml.calc.templateexts=stc

type=application/vnd.sun.xml.drawexts=sxd

type=application/vnd.sun.xml.draw.templateexts=std

type=application/vnd.sun.xml.impress exts=sxi

type=application/vnd.sun.xml.impress.templateexts=sti

type=application/vnd.sun.xml.writer.globalexts=sxg

type=application/vnd.sun.xml.mathexts=sxm

type=application/vnd.stardivision.writer exts=sdw

type=application/vnd.stardivision.writer-global exts=sgl

type=application/vnd.stardivision.calcexts=sdc

type=application/vnd.stardivision.drawexts=sda

type=application/vnd.stardivision.impressexts=sdd

type=application/vnd.stardivision.impress-packed exts=sdp

type=application/vnd.stardivision.mathexts=smf,sdf

type=application/vnd.stardivision.chart exts=sds

type=application/vnd.stardivision.mailexts=sdm

#

# more obj.conf

#

# Copyright 2006 Sun Microsystems, Inc. All rights reserved.

# Use is subject to license terms.

#

# You can edit this file, but comments and formatting changes

# might be lost when you use the administration GUI or CLI.

<Object name="default">

AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"

NameTrans fn="ntrans-j2ee" name="j2ee"

NameTrans fn="pfx2dir" from="/mc-icons" dir="/sun/webserver7/lib/icons" name="es-internal"

PathCheck fn="unix-uri-clean"

PathCheck fn="check-acl" acl="default"

PathCheck fn="find-pathinfo"

PathCheck fn="find-index-j2ee"

PathCheck fn="find-index" index-names="index.html,home.html,index.jsp"

ObjectType fn="type-j2ee"

ObjectType fn="type-by-extension"

ObjectType fn="force-type" type="text/plain"

Service method="(GET|HEAD)" type="magnus-internal/imagemap" fn="imagemap"

Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"

Service fn="send-cgi" type="magnus-internal/cgi" user="$user" group="$group" chroot="$chroot" nice="$nice" dir="$dir"

Service method="(GET|HEAD)" type="*~magnus-internal/*" fn="send-file"

Service method="TRACE" fn="service-trace"

Error fn="error-j2ee"

AddLog fn="flex-log"

</Object>

<Object name="j2ee">

Service fn="service-j2ee" method="*"

</Object>

<Object name="es-internal">

PathCheck fn="check-acl" acl="es-internal"

</Object>

<Object name="cgi">

ObjectType fn="force-type" type="magnus-internal/cgi"

Service fn="send-cgi"

</Object>

<Object name="send-precompressed">

PathCheck fn="find-compressed"

</Object>

<Object name="compress-on-demand">

Output fn="insert-filter" filter="http-compression"

</Object>

#

root@mail # tail errors

[27/Sep/2006:12:25:41] info (22351): CORE3274: successful server startup

[27/Sep/2006:12:25:49] failure (22351): for host 172.16.5.88 trying to GET /index.cgi, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

[27/Sep/2006:12:27:17] failure (22351): for host 172.16.5.88 trying to GET /index.cgi, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

[27/Sep/2006:12:27:18] failure (22351): for host 172.16.5.88 trying to GET /index.cgi, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

[27/Sep/2006:12:27:18] failure (22351): for host 172.16.5.88 trying to GET /index.cgi, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

[27/Sep/2006:12:27:18] failure (22351): for host 172.16.5.88 trying to GET /index.cgi, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

[27/Sep/2006:12:27:21] failure (22351): for host 172.16.5.88 trying to GET /index.pl, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

[27/Sep/2006:12:27:23] failure (22351): for host 172.16.5.88 trying to GET /index.pl, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

[27/Sep/2006:12:27:23] failure (22351): for host 172.16.5.88 trying to GET /index.pl, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

[27/Sep/2006:12:27:23] failure (22351): for host 172.16.5.88 trying to GET /index.pl, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

root@mail #

Perl also can't work, But when I delete dir="$dir"

in obj.conffile , In /sun/webserver7/https-mail.bnuzh.cn/docs Path perl file can work.

Service fn="send-cgi" type="magnus-internal/cgi" user="$user" group="$group" chroot="$chroot" nice="$nice" dir="$dir"

to

Service fn="send-cgi" type="magnus-internal/cgi" user="$user" group="$group" chroot="$chroot" nice="$nice"

But when I login admin interface to manager my web server, obj.conf file dir="$dir" I changed turn back. The perl program can't work.

Service fn="send-cgi" type="magnus-internal/cgi" user="$user" group="$group" chroot="$chroot" nice="$nice" dir="$dir"

error log:

27/Sep/2006:12:50:05] info (22420): CORE1116: Sun Java System Web Server 7.0-Technology-Preview-2 B06/19/2006 17:16

[27/Sep/2006:12:50:05] info (22421): CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.5.0_06] from [Sun Microsystems Inc.]

[27/Sep/2006:12:50:11] info (22421): HTTP3072: http-listener-1: http://mail.bnuzh.cn:81 ready to accept requests

[27/Sep/2006:12:50:11] info (22421): CORE3274: successful server startup

[27/Sep/2006:12:50:20] failure (22421): for host 172.16.5.88 trying to GET /cgi-bin/forum/Setup.pl, handle-processed reports: HTTP2298: Error interpolating parameters for send-cgi (Reference to undefined variable $dir)

xieliangcheng at 2007-7-7 2:22:30 > top of Java-index,Web & Directory Servers,Web Servers...
# 5

Sorry it took you so long to get things working!

The fact the admin server outputs those dir="$dir", etc. parameters is a bug in the Technology Preview that should be fixed before the final 7.0 release. However, it should be possible to keep your obj.conf file changes. After editing your obj.conf file, log into the admin console and click Edit Configuration. Click Deployment Pending and choose the "Pull and deploy configuration" option.

elving at 2007-7-7 2:22:30 > top of Java-index,Web & Directory Servers,Web Servers...
# 6

Today I installed System Web Server 7 Technology Preview 3 to try

1.Changed mime.types :

# more mime.types |grep =pl

#type=application/x-perl exts=pl

type=magnus-internal/cgiexts=pl,cgi,exe,bat

root@mail #

2.Enable CGI Directories

Use the admin console to enable CGI as a file type. After logging in, click CGI Directories, check the CGI as file type checkbox, click Save. Click Deployment Pending to restart the server and make the configuration changes take effect.

3.Pull and deploy configuration

log into the admin console and click Edit Configuration. Click Deployment Pending and choose the "Pull and deploy configuration" option.

4.Restart Web server

The perl program can work!

But I have a little problem when I Post a topic(article) I receive an HTTP 408 or 409 error message . Said the server is busy, too many people visited the page. In fact the topic(article) is posted succeed and only I visited.

I'm not should is the web server's problem or perl program's problem.

This perl program can run Apache web server well.

xieliangcheng at 2007-7-7 2:22:30 > top of Java-index,Web & Directory Servers,Web Servers...