How to enable SSL for virtual host [SOLVED]

Problems with the Linux version of XAMPP, questions, comments, and anything related.

How to enable SSL for virtual host [SOLVED]

Postby iloveit » 16. December 2011 10:43

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.
User avatar
iloveit
 
Posts: 4
Joined: 16. December 2011 09:51
XAMPP Version: 1.8.3-2
Operating System: Ubuntu 10.10 (maverick)

Re: How to enable SSL for virtual host

Postby Sharley » 17. December 2011 05:54

Any helpful pages in these Google search results?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
XAMPP Version: 5.6.3
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: How to enable SSL for virtual host

Postby iloveit » 17. December 2011 12:03

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
User avatar
iloveit
 
Posts: 4
Joined: 16. December 2011 09:51
XAMPP Version: 1.8.3-2
Operating System: Ubuntu 10.10 (maverick)

Re: How to enable SSL for virtual host

Postby iloveit » 17. December 2011 15:44

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...
User avatar
iloveit
 
Posts: 4
Joined: 16. December 2011 09:51
XAMPP Version: 1.8.3-2
Operating System: Ubuntu 10.10 (maverick)

Re: How to enable SSL for virtual host

Postby iloveit » 17. December 2011 16:53

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 :)
User avatar
iloveit
 
Posts: 4
Joined: 16. December 2011 09:51
XAMPP Version: 1.8.3-2
Operating System: Ubuntu 10.10 (maverick)

Re: How to enable SSL for virtual host

Postby Sharley » 17. December 2011 22:11

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. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
XAMPP Version: 5.6.3
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 2 guests