LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-06-2013, 10:13 AM   #1
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 291

Rep: Reputation: Disabled
Web page not able to find CGI program file


I was trying to invoke a CGI program via an html file.
But got stuck for the error "file not found".

I am trying the same program as in the following site:
Please find below the html file:
Code:
<html> <head>
<title>The Employee Database</title>
Appears on title bar
</head>
<body>
<h1> Employee Form </h1>
Appears in a large bold font
<hr>
Adds a horizontal rule
<form action=”http://localhost/~ravbholua/emp_add.pl” method=get>
Emp-id: <input type=”text” name=”empid” size=4> <br>
Name: <input type=”text” name=”ename” size=30> <br>
Designation: <input type=”text” name=”desig” size=15> <br>
Department: <input type=”text” name=”dept” size=15> <br>
Dateoffuse: <input type=”text” name=”dtbirth” size=10> <br>
noSalary: <input type=”text” name=”salary” size=10> <br> <br>
<center>
<input type=submit value=”Add”>
The Add button is centered
</center>
</form>
</body>
</html>
To work in my system, I changed (changed than what is mentioned
in the link above) the path of the CGI program
file. The path is now: http://localhost/~ravbholua/emp_add.pl

When I click on Add button, I get error that 'file not found'. Please see
attachment.
Please have a look at the form (attachment).

Why it is not finding the file which is in the home directory of username
"ravbholua"?
These 2 attachments w'd help you to catch the issue.
Attached Thumbnails
Click image for larger version

Name:	error.png
Views:	20
Size:	135.2 KB
ID:	13351   Click image for larger version

Name:	form.png
Views:	18
Size:	168.0 KB
ID:	13352  

Last edited by ravisingh1; 09-06-2013 at 10:15 AM.
 
Old 09-06-2013, 10:44 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
file:// in your address bar would indicate your browser is opening the files from your local file system and not through a web server.

You'll need to have all this on a web server instance otherwise you'll find it won't work.
 
1 members found this post helpful.
Old 09-06-2013, 10:07 PM   #3
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 291

Original Poster
Rep: Reputation: Disabled
@TenTenths
Thank you.
It too striked me that as the address bar mentions file:// but the link I sent mentions http://localhost, so I sent you the attachment thinking if that is a problem, one w'd catch.
 
Old 09-12-2013, 09:38 AM   #4
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 291

Original Poster
Rep: Reputation: Disabled
Wink

Quote:
Originally Posted by TenTenths View Post
file:// in your address bar would indicate your browser is opening the files from your local file system and not through a web server.

You'll need to have all this on a web server instance otherwise you'll find it won't work.
Yes TenTenths I am back to give you feedback of the above html program as I have run in my server (VPS).
The domain of my server is ravi.com

I ran the same html there but I am getting the same output.
When I opened emp_form.html, the url showed:
Code:
file:///home/ravbholua/emp_form.html
And when I clicked "add " button, then it gave the same error as earlier: file not found with the similar error as shown in my previous screen shot named "error.png"

All files are there on server. if you say, I w'd give you IP address and credentials so that you can login and assist me to resolve.

Also one thing, it's my VPS and you had told that it w'd work on web server. I am not very clear regarding this.
 
Old 09-12-2013, 09:46 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by ravisingh1;5026504When I opened emp_form.html, the url showed:
[CODE
file:///home/ravbholua/emp_form.html[/CODE]
Check both your html and your perl script very carefully. Especially anywhere you've changed them as you mention you've changed paths.

Quote:
Originally Posted by ravisingh1 View Post
All files are there on server. if you say, I w'd give you IP address and credentials so that you can login and assist me to resolve.
Sure, assuming you'll pay my normal rate, $100 an hour, up front.
 
Old 09-12-2013, 10:24 AM   #6
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 291

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
Check both your html and your perl script very carefully. Especially anywhere you've changed them as you mention you've changed paths.
Please always refer to the link I sent in my 1st post. From that document only I am doing.

that doc has the line:
Code:
<form action=”http://localhost/~sumit/cgi-bin/emp_add.pl” method=get>
I changed it to
Code:
<form action=”http://localhost/~ravbholua/emp_add.pl” method=get>
Also I changed in emp_add.pl:
The link says:
Code:
open (OUTFILE, “>>/home/sumit/public_html/emp_out.lst”) ;
I change to
Code:
open (OUTFILE, “>>/home/ravbholua/emp_out.lst”) ;
Quote:
Originally Posted by TenTenths View Post
Sure, assuming you'll pay my normal rate, $100 an hour, up front.
HaHaHaHa!!!
I like your joke.
<moderated>

You have sudo powers.

Last edited by colucix; 09-12-2013 at 10:34 AM. Reason: Removed account details.
 
Old 09-12-2013, 10:29 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by ravisingh1 View Post
Quote:
Originally Posted by TenTenths View Post
Sure, assuming you'll pay my normal rate, $100 an hour, up front.
HaHaHaHa!!!
I like your joke.
I wasn't joking.

I have no intention of accessing ANY server and I take no responsibility for your server being exploited because you've posted login details here.
 
Old 09-13-2013, 11:03 AM   #8
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 291

Original Poster
Rep: Reputation: Disabled
Wink

Quote:
Originally Posted by TenTenths View Post
I wasn't joking.

I have no intention of accessing ANY server and I take no responsibility for your server being exploited because you've posted login details here.
Good Joke again.
HaHaHaHa!!!

(This time I am joking)
Don't worry my friend. Nothing happened. No one logged in using the credentials. I have disabled it. Now, no one can log.
O.K. well you didn't log there but any solution you have come up with my dear friend.
 
  


Reply



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
Interfacing Web with CGI script for parallel port control (program) quandJe Programming 1 01-25-2012 01:20 AM
upload .cgi file to web page aocferreira Programming 2 04-21-2011 11:26 PM
On the web browser and File>Save As>Web Page, HTML only. stf92 Linux - Newbie 4 12-18-2010 04:21 AM
which FTP program to publish a web page ruwach Linux - Software 2 08-07-2004 02:19 AM
Need a graphics based web page program OmegaWarXIII Linux - Newbie 5 06-21-2001 01:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration