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:
http://highered.mcgraw-hill.com/sites/dl/free/0070635463/372169/CGI_with_PERL.pdf
Please find below the html file:
<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.
I have the same query in the below link but isn't resolved yet. Please look through it. http://www.linuxquestions.org/questions/linux-server-73/web-page-not-able-to-find-cgi-program-file-4175476182/
localhost/~ravbholua/
are you trying to access your$HOME
? That won't work, you should have the perl script in the same directory tree as you place the HTML file. – terdon Sep 15 '13 at 15:31ps -ef | grep http
. Many lines were displayed but I couldn't be sure. As earlier told you, I am new to running an html program. If you say I w'd add the output of the ps command in my 1st post. – Ravi Sep 17 '13 at 04:01service apache2 status
, 3) Read up on the documentation, you are missing a lot of information and it is going to be very hard to answer before you understand a bit more. Start here and go on to here. Pay special attention tosites_enabled
,sites_available
and thecgi-bin
directories. – terdon Sep 17 '13 at 04:32apache2: unrecognized service
– Ravi Sep 17 '13 at 08:02