[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Writing Java cgi for apache.

Posted on 2009-04-30
Medium Priority
Last Modified: 2013-12-25
Hi experts,
I have a java servlet, which excepts username, password and domain values from a php file, does some authentication checks and returns a value if authentication succeds or fails using 'out.println("1") or 'out.println("0") and my php file reads these values.

Current situation: Since to run a java servlet i need a servlet container, i need to install the container in the machine where i intend to use it. But i cant do it in my present situation. Also i have to mandatorily use java as i have to extend other java classes for authentication purpose, that is the reason i have written a java servlet.  I also have a apache server installed in my system.

Q1. Now since apache has a built in support for cgi, is it possible to convert this servlet into a java cgi so that it can be called by php file and can save me from installing the servlet container.
Q2.I am very new to cgi. please let me know how can i do this.
Q3.Is it possible to do this using web services? I am very new to web services also.
Q4.Which will be the best under this situation cgi or webservices?
Q5.Any tutorials for this would be of great help (writing cgi/web services in java etc). As i have to mandatorily use java.

Please help.
Question by:sandhya01
LVL 11

Accepted Solution

Goodangel Matope earned 2000 total points
ID: 24278934
Check out these CGI tutorials




You did not mention why you cannot install a servlet container?

Author Comment

ID: 24280779
Hi goodangel,
I am going through the tutorials you mentioned and very thank you for that.

For your question, I cannot install a servlet container as if i can do the same thiing using a  cgi java program, then why should i be installing a servlet container in the first place.  Also, this application is to be used by a very small user base. So ,cgi is actually reducing the amount of configuration changes i have to make in a already running system. I  want to avoid it if at all i can.


Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month20 days, 8 hours left to enroll

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question