VirtualHost Help!!!!

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

VirtualHost Help!!!!

Postby WorldDrknss » 18. September 2005 04:08

I've been trying for hrs to get VirtualHost to work

Hosts:
Code: Select all
127.0.0.1   localhost
127.0.0.1   clanrevengeance.game-host.org
127.0.0.1   xampp.game-host.org


VirtualHost:
Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot "/htdocs"
    ServerName localhost
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "/htdocs"
    ServerName clanrevengeance.game-host.org
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "/htdocs/xamp"
    ServerName xampp.game-host.org
</VirtualHost>


When I navigate to either one I receive Object Not Found
User avatar
WorldDrknss
 
Posts: 292
Joined: 17. September 2005 13:40

Update

Postby WorldDrknss » 18. September 2005 04:37

Hosts:
Code: Select all
127.0.0.1       localhost
127.0.0.1   local.clanrevengeance.game-host.org
127.0.0.1   local.xampp.game-host.org


Virtual Host:
Code: Select all
NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
    DocumentRoot "/htdocs"
    ServerName localhost
</VirtualHost>

NameVirtualHost local.clanrevengeance.game-host.org:80

<VirtualHost 127.0.0.1:80>
    DocumentRoot "/htdocs"
    ServerName local.clanrevengeance.game-host.org:80
</VirtualHost>

NameVirtualHost local.xampp.game-host.org:80

<VirtualHost 127.0.0.1:80>
    DocumentRoot "/htdocs/xamp"
    ServerName local.xampp.game-host.org:80
</VirtualHost>
User avatar
WorldDrknss
 
Posts: 292
Joined: 17. September 2005 13:40

Postby cj_nza » 22. September 2005 01:37

I assume your XAMPP installation is on a Windows box. If so the path to your document root directory would likely have a root of `c:` rather than a root of `/`. Try changing your doc root path to the full windows path.
cj_nza
 
Posts: 53
Joined: 06. September 2005 11:49

Postby mbd » 22. September 2005 04:44

WorldDrknss , How you make the virtual host anyway like name.domain.com with xammp
mbd
 
Posts: 8
Joined: 17. June 2005 05:12

Postby ~Net Dreamz~ » 22. September 2005 06:49

I just want to clarify on this thread before I go tossin crap into my config file. Ok, my server does not have a domain name, I have been working just off my ip alone, I have a friend that wants hosting, his domain is www.hisdomain.net, now, his dir is htdocs/hosted/hisdir. If he points his domain to my isp's nameservers and I have them create the appropriate files, www file and A list file, (these two things I have already done.) I can insert
Code: Select all
<VirtualHost 127.0.0.1:80>
    DocumentRoot "D:\xampp\htdocs\hosted\hisdir"
    ServerName hisdomain.net:80
</VirtualHost>

into my http config file in apache and it should take all requests for www.hisdomain.net and point them towards his dir rather than pulling up whatever is in xampp/htdocs right? Hope I explained that well enough.
~Net Dreamz~
 
Posts: 5
Joined: 12. September 2005 23:29

I got it working

Postby WorldDrknss » 29. October 2005 11:21

httpd.conf

Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot C:/www/thegamerslounge
    ServerName thegamerslounge.game-host.org
    ServerAlias www.thegamerslounge.game-host.org
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot C:/www/gamersworld
    ServerName gamersworld.game-host.org
    ServerAlias www.gamersworld.game-host.org
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot C:/www/personal
    ServerName thewiccanslounge.blogdns.org
    ServerAlias www.thewiccanslounge.blogdns.org
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot C:/xampp/xampp/htdocs
    ServerName localhost
</VirtualHost>


ssl.conf
Code: Select all
NameVirtualHost *:443
<VirtualHost *:443>
    DocumentRoot C:/www/thegamerslounge
    ServerName thegamerslounge.game-host.org
    ServerAlias www.thegamerslounge.game-host.org
    SSLEngine on
    SSLCertificateFile "C:/xampp/xampp/apache/conf/ssl.crt/thegamerslounge.crt"
    SSLCertificateKeyFile "C:/xampp/xampp/apache/conf/ssl.key/thegamerslounge.key"
</VirtualHost>


Works great
Last edited by WorldDrknss on 29. October 2005 11:41, edited 1 time in total.
User avatar
WorldDrknss
 
Posts: 292
Joined: 17. September 2005 13:40

How to create a CA Certificate

Postby WorldDrknss » 29. October 2005 11:29

Create private key

openssl genrsa -des3 -out ca.key -rand $randomness_source 1024
chmod 400 ca.key

Note: If you really know what you're doing and don't want to use a password on the private key then remove the -des3 argument.

Setup the config file for the new CA

Create a new file called ca.conf and copy the following code into it

[ req ]
default_bits = 1024
default_keyfile = ca.key
distinguished_name = req_distinguished_name
x509_extensions = v3_ca
req_extensions = v3_req
string_mask = nombstr

[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = **
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = ****
localityName = Locality Name (e.g., city)
localityName_default = ****
organizationName = Organization Name (e.g., company)
organizationName_default = ****
organizationalUnitName = Organizational Unit Name (e.g., section)
organizationalUnitName_default = Certification Services Division
commonName = My company's Root CA
commonName_default = ****
commonName_max = 64
emailAddress = E-mail address
emailAddress_default = ****
emailAddress_max = 40

[ v3_ca ]
basicConstraints = critical,CA:true
subjectKeyIdentifier = hash

[ v3_req ]
nsCertType = objsign,email,server


Replace the stars with information pertaining to your setup

Self sign the root certificate

openssl req -new -x509 -days 3650 -config ca.conf -key ca.key -out ca.crt
The root certificate will be valid for 10 years (-days 3650).
Install the resulting .crt file in browser
On Windows you can just click on the file and you will have the option to import the certificate.
Congratulations. You now have a certification authority certificate.
User avatar
WorldDrknss
 
Posts: 292
Joined: 17. September 2005 13:40


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 124 guests