Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

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. myhost.com) 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/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‌​. –  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

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

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.