logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: using virtual hosts and ssl
Author
Lizzy



Joined: 02 May 2008
Posts: 2

PostPosted: Fri 02 May '08 13:56    Post subject: using virtual hosts and ssl Reply with quote

Hi
I have some problems with using virtual hosts and ssl. For handling a request "GET http://mysite.com/" I've created virtual hosts. For this I’ve done following steps:
In httpd.conf I added “Include conf/extra/httpd-vhosts.conf”.
In httpd-vhosts.conf I added
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mysite.com”
ServerName mysite.com
ErrorLog “log/mysite-error.log”
CustomLog “log/mysite-access.log”
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mysite.com ">
AllowOverride All
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
For testing this functionality I use telnet. In command line I run telnet 192.168.1.1 80. And then enter GET http://mysite.com/. Then I can see content of index.html (<html><body><h1> It works!</h1></body></html>). Test’s passed. But I didn’t have access to mysite.com via internet explorer and also for next case. Why?
Then I have to handle request CONNECT sslsite.net:443. For this I’ve created ssl. In httpd.conf I added “Include conf/extra/httpd-ssl.conf” and “LoadModule ssl_module modules/mod_ssl.so”.
In httpd-sll.conf I changed
<VirtualHost *:443>
DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/sslsite.net”
ServerName sslsite.net
ErrorLog “log/sslsite-error.log”
TransferLog “log/sslsite-access.log”
SSLEngine On
SSLCertificateFile “C:/Program Files/Apache Software Foundation/Apache2.2/bin/ca.crt”
SSLCertificateKeyFile “C:/Program Files/Apache Software Foundation/Apache2.2/bin/ca.key”
</VirtualHost>
For testing this functionality I use openssl.exe. Run s_client –connect 192.168.1.1:443 –state –debug and after I wrote request GET https://sslsite.net. AS I can see it works. But I have request CONNECT with sslsite.net (not ip address). So I don’t know what I need to change in configuration to be able to write s_client –connect sslsite.net:443 –state –debug(now in this case there is gethostbyname failure). If I wrote <VirtualHost sslsite.net:443> there is [error] Couldn’t resolve host name sslsite.net -- ignoring
I’m looking forward to reply
Thanks,
Lizzy
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Fri 02 May '08 15:32    Post subject: Reply with quote

This is a Frequently Asked Question in the Apache docs.

It is becoming a Frequently-asked-question here too. See these previous Apache Lounge posts:-tom-
Back to top
Lizzy



Joined: 02 May 2008
Posts: 2

PostPosted: Fri 02 May '08 23:33    Post subject: Reply with quote

tdonovan wrote:
This is a Frequently Asked Question in the Apache docs.

It is becoming a Frequently-asked-question here too. See these previous Apache Lounge posts:-tom-

Thanks for quick reply
I’ll be much appreciated if you clarify me some points. If we couldn’t use NameBased VirtualHosting to identify ssl virtual host, does it mean that request CONNECT domen.net:443 is impossible?

Unfortunately I've not found answer to my question about why i couldn't have access via browser Sad If I enter https://192.168.1.1 and http://192.168.1.1, needed html-page is loaded. But if I enter it https://sslsite.net or http://mysite.com it couldn’t display webpage.

Sorry for repeated questions Rolling Eyes

Lizzy
Back to top


Reply to topic   Topic: using virtual hosts and ssl View previous topic :: View next topic
Post new topic   Forum Index -> Apache