Page 1 of 1

How to enable SSL for virtual host [SOLVED]

PostPosted: 16. December 2011 10:43
by iloveit
Hi all,

I've setup a virtual host on XAMPP 1.7.3a, to test my custom application I need to access it via https.
I've tried a lots of tutorials and troubleshooting. nothing works (and no idea why?)
Some times in Firefox, I get the error (Error code: ssl_error_rx_record_too_long) and some other times "can't find the server at blabla"

and https://localhost also not working, though XAMPP says, "Starting Apache with SSL.." on start
Please somebody help me here to get it working.

I've tried
<VitrualHost *:443>, <VitrualHost localhost:443> etc.


Now my working virtual host(without ssl) look like this.
Code: Select all
NameVirtualHost *
  <VirtualHost *>
    DocumentRoot /opt/lampp/htdocs
    ServerName localhost
  </VirtualHost>
<VirtualHost *>
    ServerAdmin webmaster@example.com
    DocumentRoot /home/iloveit/sites/example.com
    ServerName example.com
    DirectoryIndex index.php
    ServerAlias *.example.com
    ErrorLog logs/example.com-error_log
    CustomLog logs/example.com-access_log common
</VirtualHost>
<Directory "/home/iloveit/sites/example.com">
   RewriteEngine on
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

</Directory
>

and my host file
Code: Select all
127.0.0.1 example.com


any help would be appreciated. Thanks in advance.

Re: How to enable SSL for virtual host

PostPosted: 17. December 2011 05:54
by Sharley
Any helpful pages in these Google search results?

Re: How to enable SSL for virtual host

PostPosted: 17. December 2011 12:03
by iloveit
Thanks Sharley

I've already followed exactly as it's explained in
http://slacksite.com/apache/certificate.php & http://www.nurdletech.com/https.html

but XAMPP says:

XAMPP: Error 1! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Sorry, I've no idea what's going wrong.
XAMPP: Please contact our forum http://community.apachefriends.org/f/

I'm very new in this and fails to troubleshoot the error myself. please help

Re: How to enable SSL for virtual host

PostPosted: 17. December 2011 15:44
by iloveit
When I commented out # Listen 443 and set SSLEngine off in my virtual host file, I could just start the apache without any error. What does it mean?

is there any problem with port 443?
Please anybody guide me here. I'm struck, but Googling...

Re: How to enable SSL for virtual host

PostPosted: 17. December 2011 16:53
by iloveit
Hi all,
my issue is solved and I could successfully test my application also

There was a duplicate Listen 127.0.0.1:443 in my virtual host file :)
This horrible CARELESSNESS wasted my half day!

Thanks Sharley. you thought me to walk myself

I'm just diving on my bed.... tired :)

Re: How to enable SSL for virtual host

PostPosted: 17. December 2011 22:11
by Sharley
Often self teaching is the surest way to learn. 8)

I will close this topic and mark it solved.

Thanks for the feedback and good luck. :)