----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Hello Andras,

getRemoteHost() source

    public String getRemoteHost() {
        return (String) env_vars.get("REMOTE_HOST");
    }

Apache sends the REMOTE_HOST value on every request, so you have
1. either Apache configuration problem.
2. or Apache-JServ communication problem (Ajpv12 protocol)


Wednesday, January 19, 2000, 1:38:15 PM, you wrote:

AB> ----------------------------------------------------------------
AB> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
AB> WHEN YOU POST, include all relevant version numbers, log files,
AB> and configuration files.  Don't make us guess your problem!!!
AB> ----------------------------------------------------------------

AB>           Hi all,


AB>     Sorry for disturbing the list but i have a problem and i cann't fix it.
AB> In the archives no reference were  found.

AB> My server config is:

AB>     Redhat Linux 6.1
AB>     Apache 1.3.9. + Apache Jserv1.1b3 compiled in source
AB>     JSDK2.0
AB>     IBM jdk118 for Linux

AB> In a simple servlet I try to get the request.getRemoteHost() but it returns
AB> an empty String.
AB> In the httpd.conf file i set HostNameLookups on.
AB> In the earlier (1.0) version of Jserv it worked great.

AB> I thought that is is a configuration problem with my server config but
AB> i ran the /cgi-bin/printenv script and  returned
AB> ....
AB> REMOTE_HOST = gw.grafx.ro (this is correct).
AB> ....

AB> I don't know what could be the problem.
AB> Somebody said that it has to do with the IBM jdk but i tried on another
AB> Linux box with
AB> blackdown jdk 1.1.6 too with the same result.

AB> Here is the source of my servlet:

AB> import java.io.*;
AB> import javax.servlet.*;
AB> import javax.servlet.http.*;



AB> public class HostNameServlet extends HttpServlet
AB> { 
AB> public void init(ServletConfig conf) throws ServletException{
AB> super.init(conf);
AB> } 
AB> public void doGet(HttpServletRequest req, HttpServletResponse res) throws 
ServletException, IOException 
AB> {
AB> res.setContentType("text/html");
AB> PrintWriter toClient=res.getWriter();
AB> toClient.println("Host:"+req.getRemoteHost()); 
AB> toClient.println("<br>IP:"+req.getRemoteAddr()); 
AB> toClient.close();
AB> }
AB> } 

 
AB> Can somebody please try it?

AB> Can somebody help me?

AB>                     Thank You,
AB>                                         Andras.




AB> --
AB> --------------------------------------------------------------
AB> Please read the FAQ! <http://java.apache.org/faq/>
AB> To subscribe:        [EMAIL PROTECTED]
AB> To unsubscribe:      [EMAIL PROTECTED]
AB> Archives and Other:  <http://java.apache.org/main/mail.html>
AB> Problems?:           [EMAIL PROTECTED]




-- 
Best regards,
 Ivan                            mailto:[EMAIL PROTECTED]




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to