Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2002 07:49 PM
09-02-2002 07:49 PM
I have a CGI perl script sample.pl in apache server . This script has to be used as index
page for the webserver. This script is put in
third subdirector under /cgi-bin/. What i want
is that users should not give the complete path to this perl script, But when they give
the website url like www.sample.com this script
should be called. ( like index.html )how can be
this achieved ?.
regards,
U.SivaKumar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2002 08:54 PM
09-02-2002 08:54 PM
Re: perl
modify your httpd.conf file and make a change to the "DirectoryIndex" setting.
for this example, I set it to:
DirectoryIndex index.html index.pl
then create a symbolic link to your script.
ln -s /webdir/cgi-bin/script.pl /webdir/htdocs/index.pl
if there's an existing index.html file, move it aside.
Now when the address is pulled up, the index.pl file will be read and execute your script. (don't forget you have to restart apache 1st)
Hope this helps,
-denver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2002 12:23 AM
09-03-2002 12:23 AM
Re: perl
I have tried it already , But it displays the contents of the script. that's it.
I gave ExecCGI option to html root also. Still
problem persists.
Any ideas ?
regards,
U.SivaKumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2002 10:30 AM
09-03-2002 10:30 AM
Re: perl
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
DirectoryIndex index.html index.php
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2002 10:37 AM
09-03-2002 10:37 AM
Solution____
## added +ExecCGI to options ##
Options Indexes FollowSymLinks +ExecCGI
## added .pl to AddHandler for cgi-script ##
AddHandler cgi-script .cgi .pl
____
Rather than add the .pl to AddHandler for cgi-script, I could've just made the link index.cgi and it would've executed the same... as long as I change the "DirectoryIndex" to contain whatever the link is named.
Since you're just getting the text of the script, check the "AddHandler cgi-script" then stop/start apache.
Hope this helps,
-denver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 12:17 AM
09-05-2002 12:17 AM
Re: perl
That worked , But the perl script gave error
that "can't locate perl.pl @INC" because perl.pl is located in original directory not
under www root directory.
Any ideas ?
regards,
U.SivaKumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 10:03 AM
09-05-2002 10:03 AM
Re: perl
____
SCRIPT_FILENAME="/opt/hpapache2/cgi-bin/your_path/perl.pl"
SCRIPT_NAME="/cgi-bin/your_path/perl.pl"
____
I think this maybe getting more complicated than neccessary... was your intent to keep the path of this script from your users or simplify the way they access it (without havig to type full url?)
If your intent wasn't to hide the path of the script from your users and just simplify the way they access your site... create your index.html file with the following...
<meta http-equiv="Refresh" content="0;URL=http://www.yoursite.com/cgi-bin/yourpath/perl.pl" />
Hope this helps,
-denver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 11:43 AM
09-05-2002 11:43 AM
Re: perl
I did EXACTLY what you are talking about.
Stop your apache server, and edit your conf file. Modify the line:
From -
DirectoryIndex index.htm
To -
DirectoryIndex cgi-bin/myScript.pl
You can also set the shebang in the first line of your script:
#!/usr/bin/perl
or whereever your perl binary sits.
- Allan