LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Web page not able to find CGI program file (https://www.linuxquestions.org/questions/linux-server-73/web-page-not-able-to-find-cgi-program-file-4175476182/)

ravisingh1 09-06-2013 10:13 AM

Web page not able to find CGI program file
 
2 Attachment(s)
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.

TenTenths 09-06-2013 10:44 AM

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.

ravisingh1 09-06-2013 10:07 PM

@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.

ravisingh1 09-12-2013 09:38 AM

Quote:

Originally Posted by TenTenths (Post 5023121)
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.

TenTenths 09-12-2013 09:46 AM

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 (Post 5026504)
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.

ravisingh1 09-12-2013 10:24 AM

Quote:

Originally Posted by TenTenths (Post 5026510)
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 (Post 5026510)
Sure, assuming you'll pay my normal rate, $100 an hour, up front.

HaHaHaHa!!!
I like your joke.
<moderated>

You have sudo powers.

TenTenths 09-12-2013 10:29 AM

Quote:

Originally Posted by ravisingh1 (Post 5026544)
Quote:

Originally Posted by TenTenths (Post 5026510)
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.

ravisingh1 09-13-2013 11:03 AM

Quote:

Originally Posted by TenTenths (Post 5026548)
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.


All times are GMT -5. The time now is 08:36 PM.