Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 APACHE SSL AND VIRTUAL HOST USAGE
Google
Post new topic Reply to topic
Author Message
nico
donor
donor


Joined: 08 Aug 2005
Posts: 6

PostPosted: Thu Aug 18, 2005 1:10 am Reply with quoteBack to top

Hi everyone,

I have the latest apache2triad. I am running the apache 2 SSL version.
I want to create both secure and non-secure virtual hosts in the httpd.conf

ie

namevirtualhost 12.23.34.45

<virtualhost 12.23.34.45>
documentroot "c:/xxx/xxx/xxx"
ServerName non-secure.mysite.com
</virtualhost>

<virtualhost 12.23.34.45:443>
documentroot "c:/xxx/xxx/xxx"
ServerName secure.mysite.com
</virtualhost>

This only works for non-secure pages. And I wanted to have triadcp to be accessed through https but was not successful.

Now, when I try to include a Listen 443 directive, I cannot start the server.
Any ideas would be greatly appreciated Smile
View user's profileSend private message
Vlad Alexa Mancini
lead developer
lead developer


Joined: 07 Jul 2003
Posts: 1539

PostPosted: Thu Aug 18, 2005 1:25 pm Reply with quoteBack to top

for a virtualhost entry like

Quote:
<VirtualHost 12.23.34.45>
ServerName non-secure.example.com
ServerAdmin webmaster@example.com
DocumentRoot C:\docume~1\example\public_html
ErrorLog C:\apache2triad\logs\error_example.com
CustomLog C:\apache2triad\logs\access_example.com combined
</VirtualHost>


you would have a virtualhost like :

Quote:
<IfDefine SSL>
<VirtualHost 12.23.34.45:443>
ServerName secure.example.com
ServerAdmin webmaster@example.com
DocumentRoot C:\docume~1\example\public_html
ErrorLog C:\apache2triad\logs\ssl_error_example.com
CustomLog C:\apache2triad\logs\ssl_access_example.com "%t %{version}c %{cipher}c %{clientcert}c"
SSLEngine on
SSLCertificateFile C:\apache2triad\opssl\cert\example.com.crt
SSLCertificateKeyFile C:\apache2triad\opssl\cert\example.com.key
</VirtualHost>
</IfDefine>


and make sure you have DNS entries for the non-secure.example.com and secure.example.com subdomains

a Listen 443 allready exists in the server configuration , httpd.conf is not the only apache configuration file , ssl.conf is included from httpd.conf line 1128


Last edited by Vlad Alexa Mancini on Thu Aug 18, 2005 4:32 pm; edited 1 time in total
View user's profileSend private message
nico
donor
donor


Joined: 08 Aug 2005
Posts: 6

PostPosted: Thu Aug 18, 2005 4:08 pm Reply with quoteBack to top

Hi,

I have attempted to create the SSL virtualhost for one of my domain names, and made sure that there is a secure.my-domain.com entry in my DNS servers. However, the apache SSL server would not restart after the editing of the httpd.conf file. But, when I comment off the SSLEngine On Line, it starts up fine, but of course, there is no SSL support this time. Do you have any idea what could be causing this? Maybe certificate or a key issue? It is a self signed certificate.
View user's profileSend private message
Vlad Alexa Mancini
lead developer
lead developer


Joined: 07 Jul 2003
Posts: 1539

PostPosted: Thu Aug 18, 2005 4:31 pm Reply with quoteBack to top

see : apache2triadcp > server-error-logs > The SSL server on ...........:443 last 100 eror log lines:
View user's profileSend private message
nico
donor
donor


Joined: 08 Aug 2005
Posts: 6

PostPosted: Thu Aug 18, 2005 6:36 pm Reply with quoteBack to top

Code:
#server config
NameVirtualHost 12.13.14.15:80
NameVirtualHost 12.13.14.15:443


<VirtualHost 12.13.14.15:80>
  ServerName site1.com
  DocumentRoot "c:/apache2triad/htdocs/site1"
</VirtualHost>

<VirtualHost 12.13.14.15:81>
  ServerName site2.com
  DocumentRoot "c:/apache2triad/htdocs/site2"
</VirtualHost>

<IfDefine SSL>
<VirtualHost 12.13.14.15:443>
ServerName securesite.com
ServerAdmin test@example.com
DocumentRoot "c:/apache2triad/htdocs"
ErrorLog C:\apache2triad\logs\ssl_error_example.com
CustomLog C:\apache2triad\logs\ssl_access_example.com "%t %{version}c %{cipher}c %{clientcert}c"
SSLEngine on
SSLCertificateFile C:\apache2triad\opssl\bin\securesite.com.crt
SSLCertificateKeyFile C:\apache2triad\opssl\bin\securesite.com.key
</VirtualHost>
</IfDefine>


This is the only configuration I found to help me out. The SSL works! But only the first non-SSL site works as a virtual host, the second one (site-2) when I enter the address in, defaults to the first site's address. If I make the port number on site2 as 80 also, the server does not start. So had to give it an 81, or leave blank and it works fine. The SSL error log told me this: [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!? and I fixed the SSL problem that way. It was the certificate/key issue. But the virtualhost issue still remains for non-SSL vistual hosts. Was it a good idea to give 2 "NameVirtualHost"s? It is the only thing that made it work...



WORKING!!!! THANK YOU SO MUCH VLAD! Things are finally coming around, I was able to setup multiple SSL virtualhosts as well as non-secure virtual hosts. Things are working like a charm. Now to fix my slimftp problem, but of course that is for another forum Smile

Thanks again...
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT