Link to home
Start Free TrialLog in
Avatar of manuel2002m
manuel2002m

asked on

How to locate and give access to a Perl Interpreter?

Hello,, I'm giving my first steps into Solaris 10
I have a T1000 server here, first one in the company.
There is one developer that wrote some Perl script and wants to run it on my server.
She's asking for this:

"An externally accessible place where I can put Perl & CGI scripts. I'd prefer a Unix account somewhere that I can get to via telnet.
It needs to have
1) access to a Perl interpreter e.g., /usr/local/bin/perl
2) be accessible from the Internet
"
The first part, I can create an username for her, that she can access from outside using SSH.
I don't know how she can copy her files from her computer (she is remote user and has a VPN connection to my office).
ABout the PERL interpreter, I used the pkginfo command and it gave me this:
root@SunT1000 # pkginfo SUNWperl584core
system      SUNWperl584core Perl 5.8.4 (core)
root@SunT1000 # pkginfo -l SUNWperl584core
   PKGINST:  SUNWperl584core
      NAME:  Perl 5.8.4 (core)
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  11.10.0,REV=2005.01.21.15.53
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Perl 5.8.4 programming language (core)
    PSTAMP:  on10-patch20050727164038
  INSTDATE:  Jan 04 2006 08:46
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:      559 installed pathnames
                  18 shared pathnames
                   1 linked files
                 113 directories
                  36 executables
               10080 blocks used (approx)

So I assume PERL is already installed on the server, but I don't know how to give access to her username to the interpreter, and how to test when it already has access to it.

About "accesible from the INternet", the T1000 has an internal IP address, I can do NAT through a Public IP, no problem, but, do I need a web server on that server so her scripts can be ran from outside?
Thanks so much for the help.
MM


ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of manuel2002m
manuel2002m

ASKER

Well, that sounds simple.
I already figured out the Perl was on the server and that I need Apache.
I didnt know how to run the apache with Perl on the server. Thanks
And,,, how can I test the Perl interpreter is working fine?
Thanks

MM
Perl will be working fine.  You probably want to test that CGI is configured correctly.

There are two sample CGI scripts in /var/apache/cgi-bin that you can call, eg:

http://127.0.0.1/cgi-bin/printenv

Tintin,,
on http://127.0.0.1/cgi-bin/printenv
I got this:

DOCUMENT_ROOT="/var/apache/htdocs"
GATEWAY_INTERFACE="CGI/1.1"
HTTP_ACCEPT="image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"
HTTP_ACCEPT_ENCODING="gzip, deflate"
HTTP_ACCEPT_LANGUAGE="en-us"
HTTP_CONNECTION="Keep-Alive"
HTTP_HOST="192.168.1.233"
HTTP_USER_AGENT="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"
PATH="/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/platform/SUNW,Sun-Fire-T1000/sbin:/opt/sun/bin:/opt/SUNWvts/bin"
QUERY_STRING=""
REMOTE_ADDR="192.168.1.200"
REMOTE_PORT="4807"
REQUEST_METHOD="GET"
REQUEST_URI="/cgi-bin/printenv"
SCRIPT_FILENAME="/var/apache/cgi-bin/printenv"
SCRIPT_NAME="/cgi-bin/printenv"
SERVER_ADDR="192.168.1.233"
SERVER_ADMIN="you@yourhost.com"
SERVER_NAME="127.0.0.1"
SERVER_PORT="80"
SERVER_PROTOCOL="HTTP/1.1"
SERVER_SIGNATURE="<ADDRESS>Apache/1.3.33 Server at 127.0.0.1 Port 80</ADDRESS>\n"
SERVER_SOFTWARE="Apache/1.3.33 (Unix) mod_perl/1.29"
TZ="US/Eastern"
UNIQUE_ID="RQXeGcCoAekAAAPyD2I"


Does it means that is working?
Can anybody put CGI Files on the /var/apache/cgi-bin?
What's the best way to give permissions on this?
I can open another question for what's follow.
So far you have helped me a lot.

Thanks

MM
Indeed it does mean it is working.

By default, only root can add files to /var/apache/cgi-bin.  You can either change the ownership on the directory, or probably better to change the group and add group write permission, ie:

chmod g+w /var/apache/cgi-bin

or

chmod 775 /var/apache/cgi-bin

You may want to create a new group for this purpose.  For example 'cgi', then simply add any users who need to add CGI scripts in the cgi group (defined in /etc/group).

Alternatively, you can configure Apache to allow users to have there web documents and CGI scripts under their own home directory.

I really depends on what the requirements are.
I'm setting the permissions now,, based on group.
A final question:
How can I configure Apache to allow different users to have different scripts on their own directory?
Thanks

MM
Sorry, I asked whithout trying first.
I just created another folder inside /var/apache/cgi-bin/
Put the "printenv" file there and it worked.

I suppose I just have to set persmissions on that folder.

Thanks,,
I'll test some more and I will set this question as completed.

MM
You can create subdirectories under /var/apache/cgi-bin or allow users to have a cgi-bin directory in under there HOME.
Thanks for the answers to my questions.
I'm waiting for my developer to test the connection and then I will grant the points and close this question.

Thanks

MM