Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have SSL installed on my website. I wrote a java web service and deployed it in public_html/WEB-INF/service folder. Now I can access my service over http (like but when I try it over https it gives me error 404.

Here is the virtual host configuration

    DocumentRoot /home/accountName/public_html
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/ combined
    CustomLog /usr/local/apache/domlogs/ "%{%s}t %I .\n%{%s}t %O ."
    ## User accountName # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup accountName accountName
    <IfModule !mod_disable_suexec.c>
        <IfModule !mod_ruid2.c>
            SuexecUserGroup accountName accountName
    <IfModule mod_ruid2.c>
        RUidGid accountName accountName
    ScriptAlias /cgi-bin/ /home/accountName/public_html/cgi-bin/
    SSLEngine on

    SSLCertificateFile /etc/ssl/certs/
    SSLCertificateKeyFile /etc/ssl/private/
    SSLCACertificateFile /etc/ssl/certs/
    CustomLog /usr/local/apache/domlogs/ combined
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    <Directory "/home/accountName/public_html/cgi-bin">
        SSLOptions +StdEnvVars

    # To customize this VirtualHost use an include file at the following location
    Include "/usr/local/apache/conf/userdata/ssl/2/accountName/*.conf"


Do I have to configure SSL for services as well? What am I missing?


share|improve this question
Post your virtualhost configs please. – Dennis Kaarsemaker Mar 28 '13 at 15:36
I cannot post the whole configuration here in the comments and my reputation is not good enough to answer my own question but I think there is no problem in vitualhost configuration as the website works fine over https (i.e. Do I have to configure my web service to be able to work over SSL? – Ali Mar 28 '13 at 15:54
Don't put it in the comments, edit your question. – Dennis Kaarsemaker Mar 28 '13 at 15:56
Basically I am running tomcat under apache server. To allow tomcat to access my servlets I updated the /usr/local/apache/conf/userdata/std/2/accountName/ file and added the path to the servlets. When I installed SSL certificate, I had to do the same for ssl /usr/local/apache/conf/userdata/ssl/2/accountName/‌​. – Ali Mar 28 '13 at 16:05
You posted only parts of the config. Please post full configs, including included files, for http and https virtualhosts. – Dennis Kaarsemaker Mar 28 '13 at 16:08
up vote 1 down vote accepted

You write that you try to access the server with the URL, and that it is installed in public_html/WEB-INF/service. These two do not match up; there's an smissing in the path or an extra sin the URL.

However, if we assume that the path should contain the s, the problem is with your VirtualHost setting:

DocumentRoot /home/accountName/public_html

If you have your files in /home/accountname/public_html/WEB-INF/services, then you need to either use the URL, or you need to change your DocumentRoot to be /home/accountName/public_html/WEB-INF. The way it's set up now, your server is looking for your website in /home/accountName/public_html/services instead of in /home/accountName/public_html/WEB-INF/services.

The best advice for you to get the SSL to look just like the HTTP version is to take both virtual host files, and run diff vh-http.conf vh-ssh.conf to see what's different. You can ignore all lines with SSL, but if anything else is different, that's likely where your problem lies.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.