LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-10-2004, 03:28 PM   #1
m3kgt
Member
 
Registered: Oct 2003
Location: WA
Distribution: Redhat 3.0ES & Slackware 8.1
Posts: 44

Rep: Reputation: 15
Question Perl script works with Apache1 but not Apache2, why?


I tried searching through the forums here and didnt see anything that helped me out. So if somebody could maybe offer some suggestions or helpful insite, please do!

THE PROBLEM: I am moving all my websites from an old server to a new server. The old server is running Apache1, the new server is running Apache2. My Perl scripts (counter.cgi for example) work fine on the server with Apache1 but they do not work on the server with Apache2.

THINGS TO NOTE: When I am coping the files from one server to the other server, I am using scp from the command line. Also something to note, when I run the cgi from the command line, it does work, it just doesnt work when loading from a website. Also, I have changed permission on the files to nobody.users and 777 just to see if that had anything to do with it and I still get nothing. The area where the cgi should be included on the webpage is just blank. No error message, no nothing. Just a blank spot.

Does anybody know of any differences involving CGI/Perl from Apache1 to Apache2?

Thanks in advance for any help. And if you need more information to help me, just let me know and I am sure I can provide it for you.

Thanks again,
Joe
 
Old 03-10-2004, 03:41 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Are you for certain the cgi module was compiled or enabled for the new apache2 server? And you have the correct configuration in httpd.conf? And perl isn't located in a different location on the new server as well?
 
Old 03-10-2004, 03:52 PM   #3
m3kgt
Member
 
Registered: Oct 2003
Location: WA
Distribution: Redhat 3.0ES & Slackware 8.1
Posts: 44

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by trickykid
Are you for certain the cgi module was compiled or enabled for the new apache2 server? And you have the correct configuration in httpd.conf? And perl isn't located in a different location on the new server as well?
Here are a couple of snipits from my httpd.conf file... I am certain perl is installed, apears to be in the same place, and it is setup in Apache2...

----- Start Snipits -----

LoadModule cgi_module modules/mod_cgi.so

DirectoryIndex index.html index.html.var index.cgi

AddHandler cgi-script .cgi

AddOutputFilter INCLUDES .html .shtml .cgi

Options Indexes ExecCGI FollowSymLinks Includes #in every virtual domain

------ End Snipits -----

All looks to be the same as on the old server with Apache1 running.
 
Old 03-10-2004, 04:15 PM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Can you run the perl scripts on the server to see what kind of output you get to confirm they are working?
 
Old 03-10-2004, 04:19 PM   #5
m3kgt
Member
 
Registered: Oct 2003
Location: WA
Distribution: Redhat 3.0ES & Slackware 8.1
Posts: 44

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by trickykid
Can you run the perl scripts on the server to see what kind of output you get to confirm they are working?
Yes. I am able to run the perl script from the command line, and it is indeed working correctly. So it looks to be something involving the way apache handles it or something. The most basic script, just opens a file, adds 1 to the number in the file, then closes the file and prints the new number (basically a hit counter). When I run it from the command line, it does update the file with a number increased by 1 and then displays the number. Just wont work when I use it as an include in the index.html file for the site.
 
Old 03-10-2004, 04:35 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Is the include being run or does it just appear as a comment when you view the source of the page sent back to the browser?
 
Old 03-10-2004, 04:53 PM   #7
m3kgt
Member
 
Registered: Oct 2003
Location: WA
Distribution: Redhat 3.0ES & Slackware 8.1
Posts: 44

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by david_ross
Is the include being run or does it just appear as a comment when you view the source of the page sent back to the browser?
Nothing show up at all. When I view the source of the website after it has loaded i IE, I see nothing but a blank space where it should be presenting me with information printed by the cgi script.

Keep in mind the CGI script works perfectly on the old server, but not the new one. So the script is good... its something else...
 
Old 03-11-2004, 12:36 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Is there anything in the error log?

Perhaps you can post a copy of your shtml document and perl script.

I assume you restarted apache after changing the config file?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache1. or apache2 merlin23 Linux - Networking 1 12-01-2004 11:58 AM
Apache1 & Apache2 - How do I get them both working on the same box? neocookie Linux - Software 3 09-24-2004 02:58 AM
Perl shell-out to script dunna work. Works on command line. Why? jlangelier Linux - Software 1 08-28-2004 02:00 AM
Why use Apache1.3 - What can't Apache2 do? davee Linux - Software 2 11-12-2003 11:42 AM
Slackware8: upgrade Apache1 to Apache2 m3kgt Linux - Software 3 10-27-2003 03:33 PM


All times are GMT -5. The time now is 05:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration