1827897 Members
1725 Online
109970 Solutions
New Discussion

Virtual Host and ssl

 
SOLVED
Go to solution
Piotr Kirklewski
Super Advisor

Virtual Host and ssl

Hi there

I've added ssl to my site, and everythink works fine if I go to https:// but wont work by http:// enymore :(
Here's my vhost.conf configuration:


ServerName mysite.com
ServerAlias www.mysite.com
ServerAdmin webmaster@mysite.com
DocumentRoot /home/default/mysite.com/user/htdocs
ErrorLog /home/default/mysite.com/user/logfiles/error_log
TransferLog /home/default/mysite.com/user/logfiles/access_log
php_admin_value open_basedir /tmp:/home/default/mysite.com SuexecUserGroup mysite mydomain
ScriptAlias /cgi-bin/ /home/default/mysite.com/user/htdocs/cgi-bin/
AddHandler server-parsed .shtml
AddType text/html .shtml

Options +Includes

# Begin SSL Config
SSLEngine on
SSLCertificateFile /home/default/mysite.com/user/cert/ssl.cert
SSLCertificateKeyFile /home/default/mysite.com/user/cert/ssl.key
# End SSL Config
# Begin user directives <--
# --> End user directives


Does anyone know why the site is not working if I'll put http://mysite.com ?

Cheers
Jesus is the King
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: Virtual Host and ssl

Shalom,

ssl is not compatible with having more than one named virtual host.

To have a proper ssl certificate for a website, due to limitations in the design of openssl requires a separate IP address.

Myself and many others have experiemented with this over the years and named virtual hosts don't work. Allocating an IP address does.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Piotr Kirklewski
Super Advisor

Re: Virtual Host and ssl



The begining of this file is looking like that - so the IP address is the same - something is forcing it to serve the page on port 443 and disabling 80.

And that is actual problem.
The IP's are obviously exemples - but they are exactly the same.

So my question is what prevents the http:// on port 80 to be alive ?

When I go to http:// I have blank page - I'm not getting error 404.

Any Ideas ?




Jesus is the King
Steven E. Protter
Exalted Contributor

Re: Virtual Host and ssl

Shalom,

Depending on httpd.conf settings, lack of an index.htm/index.html file may be preventing access.

I'd also have to ssh/telnet sessions on the server and do this.

Session 1:
tail -f /var/log/httpd/access_log

Session 2:
tail -f /var/log/httpd/error_log

I'd add a third session for the ssl log if nothing interesting is revealed here.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Heironimus
Honored Contributor

Re: Virtual Host and ssl

You have "SSLEngine on" in your virtual host. You can't serve non-SSL from a vhost if you enable SSL - it's either on or off for the entire virtual host. If you need both http and https you will need two different virtual hosts.
Vitaly Karasik_1
Honored Contributor

Re: Virtual Host and ssl

for the non-SSL server you can use either configure default :80 server, or create new virtual server.