Results 1 to 3 of 3
Hi
I have a small problem.
My Apache is configured in this way that I have one IP and more VirtualHost
Something like this:
Code:
NameVirtualHost 123.456.7.89
..
<VirtualHost subdomain.site.com ...
- 04-25-2008 #1Just Joined!
- Join Date
- Nov 2005
- Posts
- 6
[SOLVED] Apache with and without SSL == Site with https and http
Hi
I have a small problem.
My Apache is configured in this way that I have one IP and more VirtualHost
Something like this:
Now I need to have one site with SSL Encryption.Code:NameVirtualHost 123.456.7.89 .. <VirtualHost subdomain.site.com > .... </VirtualHost> <VirtualHost subdomain2.site.com> </VirtualHost> <VirtualHost subdomain.othersite.com> ... </VirtualHost>
So I tried something like this
In this way the subdomain.site.com was accessible via https and all sites returning 400 - bad request when I tried to access it via http.Code:NameVirtualHost 123.456.7.89 .. <VirtualHost subdomain.site.com > ServerName subdomain.site.com </VirtualHost> <VirtualHost subdomain.othersite.com> ... </VirtualHost> <VirtualHost subdomain.site.com > ServerName subdomain.site.com:443 SSLCertificateFile /etc/httpd/ssl/cert.crt SSLCertificateKeyFile /etc/httpd/ssl/cert.key SSLEngine on ...... </VirtualHost>
I read a bit and found out that the SSL encrypted site have to have own IP address. So I ordered new IP and tried this:
DNS-Entry shows subdomain.site.com on IP 123.456.7.900
Now are all other site ok again (accessible via HTTP).Code:NameVirtualHost 123.456.7.89 .. <VirtualHost subdomain.site.com > ServerName subdomain.site.com </VirtualHost> <VirtualHost subdomain.othersite.com> ... </VirtualHost> <VirtualHost 123.456.7.900 > ServerName subdomain.site.com:443 SSLCertificateFile /etc/httpd/ssl/cert.crt SSLCertificateKeyFile /etc/httpd/ssl/cert.key SSLEngine on ...... </VirtualHost>
But the site I need to secure subdomain.site.com is accessible via https.
If I try to access it with http I get 400 - bad request.
What I need to do is to have:
- Several named based VirtualHost without encryption
- One or more sites with SSL encryption
- One or more sites accessible with and without SSL encryption
- I have 5 IP addresses available for it.
It is possible?
Kind regards,
Neo
- 04-25-2008 #2
Yes
I assume you have already changed it to listen on 443.
how about this
restart apache and then do aCode:NameVirtualHost 123.456.7.89:80 NameVirtualHost 123.456.7.89:443 .. <VirtualHost subdomain.site.com:80 > .... </VirtualHost> <VirtualHost subdomain2.site.com:80> </VirtualHost> <VirtualHost subdomain.othersite.com:443> Your ssl stuff here. and did you create the ssl </VirtualHost>
#tail -f /../../apache/error.log
and then try and access your ssl site and see what gets logged.
- 04-25-2008 #3Just Joined!
- Join Date
- Nov 2005
- Posts
- 6
You have fully right this was exactly this problem.
It is neccessary to tell Apache to listing both ports for this IP and then the port has to be also defined in the VirtualHost name.
Thanks,
Neo



