0

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 http://www.mydomain.com/services/myWebService?wsdl) but when I try it over https it gives me error 404.

Here is the virtual host configuration

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

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

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

</VirtualHost>

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

Thanks

AL̲̳I
  • 105
  • 1
  • 7
  • 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. https://www.myhost.com/) Do I have to configure my web service to be able to work over SSL? – AL̲̳I 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/mydomain.com/cp_jkmount.conf` 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/mydomain.com/cp_jkmount.conf`. – AL̲̳I 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
  • I know you are trying to help and I appreciated it, but I do not feel comfortable publishing my Virtualhost configuration... What could be the possible problem in my configuration? What do you think? Thanks – AL̲̳I Mar 28 '13 at 16:15
  • I don't know, that's why I'm asking for more information. If you're unwilling/unable to provide that, then I cannot help. – Dennis Kaarsemaker Mar 28 '13 at 16:18

1 Answers1

1

You write that you try to access the server with the URL http://www.mydomain.com/services/myWebService?wsdl, 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 https://www.mydomain.com/WEB-INF/services/myWebService?wsdl, 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.

Jenny D
  • 27,780
  • 21
  • 75
  • 114