I must look into the access of the apache server.I've written a stand alone code for cheking the access of the apache server. Basically simply type the url it's accessable...But wen i run it through code it throws exception..

as java.io.IOException: Server came back HTTP response code: 403 for URL:

What's 403 response code ?? hw can one allow it to be accessible from stand alone code...

This really is my code connecturl = "http://" + ip + ":" + port + "/server-status?auto" targetURL = new URL(connecturl) HttpURLConnection httpURLConnection = (HttpURLConnection) targetURL.openConnection()






the 403 code is definitely an "access refused" code.

The reason is probably because of directive inside your httpd.conf file not getting an "Allow from" which includes the ip from the host you are attempting to run this program on.

for instance, you are trying running this from the client ( and wish to look into the status from the webserver you've running on

Make certain the httpd.conf file around the server has something similar to the next:

<Location /server-status>

  SetHandler server-status

  Order deny,allow

  Deny all

# now make certain the consumer host is permitted for connecting for this location

  Allow from


Best of luck.