Apache2Triad Help, Support and Development Forum Index Apache2Triad Help, Support and Development
The apache2triad help , support and development forums
 

APACHE SSL AND VIRTUAL HOST USAGE
Click here to go to the original topic

 
       Apache2Triad Help, Support and Development Forum Index -> Hosting
View previous topic :: View next topic  
Author Message
nico



Joined: 08 Aug 2005
Posts: 6

Posted: Thu Aug 18, 2005 1:10 am    Post subject: APACHE SSL AND VIRTUAL HOST USAGE  

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 :)
Back to top  
Vlad Alexa Mancini



Joined: 07 Jul 2003
Posts: 1538

Posted: Thu Aug 18, 2005 1:25 pm    Post subject:  

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
Back to top  
nico



Joined: 08 Aug 2005
Posts: 6

Posted: Thu Aug 18, 2005 4:08 pm    Post subject:  

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.
Back to top  
Vlad Alexa Mancini



Joined: 07 Jul 2003
Posts: 1538

Posted: Thu Aug 18, 2005 4:31 pm    Post subject:  

see : apache2triadcp > server-error-logs > The SSL server on ...........:443 last 100 eror log lines:
Back to top  
nico



Joined: 08 Aug 2005
Posts: 6

Posted: Thu Aug 18, 2005 6:36 pm    Post subject:  

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 :)

Thanks again...
Back to top  
 
       Apache2Triad Help, Support and Development Forum Index -> Hosting
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.13 © 2001, 2002 phpBB Group