Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 5th, 2001, 07:11 PM
mjdawson5232 mjdawson5232 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 2 mjdawson5232 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Desperate!! SSL and non-SSL VirtualHost at the same IP

Thank you very much for your help!!!

I've been trying to set up a SSL and non-SSL VirtualHost at the same IP for the last 2 weeks without success. I'm including that I believe are the relavent portions of my httpd.conf file and server config. What am I missing here??

------------------------------------------------------------------------

Apache/1.3.20 (Unix) AuthMySQL/2.20 PHP/4.0.5 mod_ssl/2.8.4 OpenSSL/0.9.6a

------------------------------------------------------------------------

ServerType standalone
ServerRoot "/usr/local"
PidFile /var/run/httpd.pid

Port 80
<IfDefine SSL>
Listen 80
Listen 443
</IfDefine>

User nobody
Group nobody

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

HostnameLookups Off

NameVirtualHost 68.121.21.226:80
NameVirtualHost 68.121.21.226:443

<VirtualHost URL>
DocumentRoot /usr/local/share/doc/apache/htdocs
ServerName URL
...
Redirect /secure URL
SSLDisable
</VirtualHost>
<VirtualHost 68.121.21.226:443>
DocumentRoot /usr/local/share/doc/apache/htdocs/secure
ServerName 68.121.21.226
...
SSLEnable
</VirtualHost>

Thx
Mike

Reply With Quote
  #2  
Old August 6th, 2001, 12:20 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> NameVirtualHost 68.121.21.226:80
>> NameVirtualHost 68.121.21.226:443

Have you specified a ServerName line globally? If so and it's host.ip.com. Then remove the NameVirtualHost lines above and change it to: NameVirtualHost *. Else, change it to: NameVirtualHost 68.121.21.226.

>> <VirtualHost www.ip.com:80>

Change to <VirtualHost *> or <VirtualHost 68.121.21.226>

>> Redirect /secure https://68.121.21.226:443

Change to Redirect /secure https://www.ip.com or preferably:

RewriteEngine on
RewriteRule ^secure(.*) https://www.ip.com$1 [R,L]

because a request of http://www.ip.com/secure/blahblah.html would redirect to https://www.ip.com/, not with the requested blahblah.html file as https://www.ip.com/blahblah.html.

>> SSLDisable

Comment out this line

>> <VirtualHost 68.121.21.226:443>

Use <VirtualHost _default_:443>

>> ServerName 68.121.21.226

Set it to www.ip.com

>> SSLEnable

Comment out this line

You should also have something like:

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/etc/apache/certs/server.cert
SSLCertificateKeyFile /usr/local/etc/apache/certs/server.key

Keep in mind, the cn (common name) MUST MATCH and UNIQUE per IP.
You may generate a cert for host.ip.com, since you wanted it to be www.ip.com, so just generate a cert with the cn -- www.ip.com. If you set the ServerName for https to be the IP, then the cn don't match.

Last edited by freebsd : August 6th, 2001 at 12:24 AM.

Reply With Quote
  #3  
Old August 6th, 2001, 09:29 AM
mjdawson5232 mjdawson5232 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 2 mjdawson5232 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the reply, still need help!

I made changes to the httpd.conf file. Still doesn't work. Thank you very much for your help!!!!

ServerType standalone
ServerRoot "/usr/local"

Port 80
<IfDefine SSL>
Listen 80
Listen 443
</IfDefine>

User nobody
Group nobody

NameVirtualHost 64.133.50.226

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/etc/apache/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/etc/apache/ssl.key/server.key
<Directory "/usr/local/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</Files>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
SSLVerifyClient 0


<VirtualHost URL>
DocumentRoot /usr/local/share/doc/apache/htdocs
ServerName URL
...
SSLDisable
</VirtualHost>


<VirtualHost URL>
DocumentRoot /usr/local/share/doc/apache/htdocs01
ServerName URL
...
RewriteEngine on
RewriteRule ^/restricted(.*) URL$1 [R,L]
SSLDisable
</VirtualHost>
<VirtualHost _default_:443>
DocumentRoot /usr/local/share/doc/apache/htdocs01/restricted
ServerName secure.ip2.com
...
SSLEnable
</VirtualHost>


<IfDefine SSL>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
</IfDefine>

<IfModule mod_ssl.c>
SSLPassPhraseDialog builtin
SSLSessionCache dbm:/var/run/ssl_scache
SSLSessionCacheTimeout 300
SSLMutex file:/var/run/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLLog /var/log/ssl_engine_log
SSLLogLevel info
</IfModule>

Reply With Quote
  #4  
Old August 6th, 2001, 01:50 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Your cn must be www.ip1.com, not www.ip2.com and not secure.ip2.com.

>> RewriteRule ^/restricted(.*) https://secure.ip2.com$1 [R,L]

Should be written as:

RewriteRule ^restricted(.*) https://www.ip1.com$1 [R,L]

Keep in mind, you MUST use just one cert that match your default host. Your default host, if it's configured inside <VirtualHost>, MUST be the first <VirtualHost> appears in your httpd.conf (www.ip1.com in your case).

>> I made changes to the httpd.conf file. Still doesn't work

But you didn't follow my instructions exactly. And you keep saying it doesn't work. What doesn't work exactly?

1) What did you do?
2) What did happen?
3) What you expected to happen?

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Desperate!! SSL and non-SSL VirtualHost at the same IP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT