Hosting Multiple Namebased VirtualHosts with SSL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

What do you think about this topic?

Poll ended at 19. September 2005 09:20

Excellent, it helped me a lot.
1
25%
Good, I don't need it now, but maybe later I will
3
75%
It's ok, but I don't think I'll ever need it
0
No votes
It sucks, read my message on how to do this better.
0
No votes
 
Total votes : 4

Hosting Multiple Namebased VirtualHosts with SSL

Postby fusibal » 24. September 2004 09:20

HOW TO USE XAMPP TO HOST MULTIPLE DOMAINS, ALOWING ALL THE DOMAINS TO HAVE BOTH NON-SSL(http://...) AND SSL(https://...) CAPABILITY?
For the past several days, I've been trying to host multiple name based vhosts using xampp. No one was any help. I read almost the entire apache 2.0 docs, and openSSL, mod_SSL docs. Finally, I succeeded ... I must have re-written the whole httpd.conf and ssl.conf files over 10x. I hope all the pain I went through will help you save time.
Just add the below to the end of your httpd.conf file as needed and it should work. You can just keep adding VirtualHosts with different ServerName and DocumentRoot directives.

-----------------add to http.conf---------------------------
# Use name-based virtual hosting, add your own ip,
# find your IP by going to start>run>cmd and type ipconfig /all.
NameVirtualHost 192.168..0.1:80
NameVirtualHost 192.168.0.1:443

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.

###### DOMAIN1 non SSL ###########
<VirtualHost 192.168.0.1:80>
DocumentRoot "C:/xampp/htdocs/path2domain1"
ServerName www.domain1.com
ServerAlias domain1.com *.domain1.com

# If you need domain specific Error or access logs
# ErrorLog logs/domain1_error.log
# CustomLog logs/domain1_access.log common
</VirtualHost>

### SSL FOR THE SAME DOMAIN1 ####
<VirtualHost 192.168.0.1:443>
# General setup for the virtual host
DocumentRoot "C:/xampp/htdocs/_test/catalog"
ServerName www.domain1.com
ServerAlias domain1.com *.domain1.com
ServerAdmin you@your.address

#If you need domain/SSL specific error and access logs
ErrorLog logs/domain1_sslerror.log
TransferLog logs/domain1_sslaccess.log
#SSL Engine Switch (on|off):
SSLEngine on
# Server Certificate:
SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt"
# Server Private Key:
SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"
# Below <Directory> only needed if you want to secure a directory with user
# authentication. Change options as needed.
# Read http://httpd.apache.org/docs-2.0/howto/auth.html
# <Directory "C:/xampp/htdocs/path2domain1">
# AuthType Basic
# AuthName "Restricted Stuff here"
# AuthUserFile "C:/xampp/apache/bin/passwd/passwords
# Require user yourNameHere
# </Directory>
</VirtualHost>
--------------------------THE END----------------------

Hope this helps ... if so, write a quick thank you note below! pass on your knowlege. Give and ye shall receive.
Last edited by fusibal on 25. September 2004 20:04, edited 4 times in total.
Dogman McKinszy
****************************************
* SHARE YOUR KNOWLEDGE, AND YE SHALL RECEIVE. *
****************************************
If you benefited from my post, please donate $1. Thank you.
User avatar
fusibal
 
Posts: 6
Joined: 24. September 2004 08:44

Oops

Postby fusibal » 24. September 2004 09:38

As you add additional VirtualHosts, the only directives you need to change in each are:
DocumentRoot
ServerName

You don't need any of the other directives for it to work, but you can use them to set things like alias names for your domain, specific log files .... etc.

:wink:
Last edited by fusibal on 25. September 2004 19:41, edited 1 time in total.
Dogman McKinszy
****************************************
* SHARE YOUR KNOWLEDGE, AND YE SHALL RECEIVE. *
****************************************
If you benefited from my post, please donate $1. Thank you.
User avatar
fusibal
 
Posts: 6
Joined: 24. September 2004 08:44

Postby Kristian Marcroft » 24. September 2004 11:25

Hi,

I just made it sticky...
Next time just edit your old post if you find an error.

So long
KriS
User avatar
Kristian Marcroft
AF Moderator
 
Posts: 2962
Joined: 03. January 2003 12:08
Location: Diedorf

Postby fusibal » 25. September 2004 19:46

Ok. Thank you KriS.
I didn't know I could edit ... Now I do. :D
How did you like the http.conf directives for hosting multiple domains with both nonSSL & SSL capabilities? If there is a better/easier way, let me know.

Also, everyone reading this topic, pleast vote ... let me know if a quick howto for this topic would be useful.
Dogman McKinszy
****************************************
* SHARE YOUR KNOWLEDGE, AND YE SHALL RECEIVE. *
****************************************
If you benefited from my post, please donate $1. Thank you.
User avatar
fusibal
 
Posts: 6
Joined: 24. September 2004 08:44

GREAT- yes, please, How2

Postby chanio » 26. September 2004 07:07

fusibal wrote: ... let me know if a quick howto for this topic would be useful.

:lol:
Please, see the manual link. It's empty.

What increases the value of every distribution is the number of HOW-2s that it has. So, if you appreciate this XAMPP one, please, don't doubt of filling it all with your nice How-2s.

Who, knows, perhaps they become included as the docs for next releases.
Besides, it would be the only one written with good English. Translations don't help much, though.

I have been trying to make my own SSL since WAMPP's first release. With your help, may be I'll succeed in some short time...

TXS, fusibal!
Gallactic Firewall
User avatar
chanio
 
Posts: 72
Joined: 18. March 2003 22:05
Location: Argentina


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 55 guests