multiple HTTP/HTTPS virtualhosts

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

multiple HTTP/HTTPS virtualhosts

Postby alain.roger » 26. May 2012 12:51

Hi,

i have some issues with virtualhosts in http and https on windows 7.
basically i have 2 virtualhost using http/https and setup as following:

Code: Select all
#--------------------------
# website1 with Joomla 2.5
#--------------------------
<VirtualHost *:80>
  DocumentRoot "d:/webserver/www/website1"
  ServerName website1.loc
  ServerAlias www.website1.loc
  ErrorLog "logs/website1.loc.error.log"
  CustomLog "logs/website1.loc.access.log" common
 
  AccessFileName .htaccess
 
  <Directory "d:/webserver/www/website1/">
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 192.168.x.x
    Allow from 127.0.0.1
  </Directory>
</VirtualHost>

<VirtualHost website1.loc:443>
  DocumentRoot "d:/webserver/www/website1"
  ServerName website1.loc
  ServerAlias www.website1.loc
  ErrorLog "logs/website1.loc.error.log"
  CustomLog "logs/website1.loc.access.log" common
 
      SSLEngine on 
    SSLCertificateFile conf/ssl.crt/server.crt 
    SSLCertificateKeyFile conf/ssl.key/server.key 
 
  AccessFileName .htaccess
 
  <Directory "d:/webserver/www/website1/">
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 192.168.1.x
    Allow from 127.0.0.1
  </Directory>
       
</VirtualHost>

#--------------------------
# website2 with Joomla 2.5
#--------------------------
<VirtualHost *:80>
  DocumentRoot "d:/webserver/www/website2"
  ServerName website2.loc
  ServerAlias www.website2.loc
  ErrorLog "logs/website2.loc.error.log"
  CustomLog "logs/website2.loc.access.log" common
 
  AccessFileName .htaccess
 
  <Directory "d:/webserver/www/website2/">
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 192.168.x.x
    Allow from 127.0.0.1
  </Directory>
</VirtualHost>

<VirtualHost website2.loc:443>
  DocumentRoot "d:/webserver/www/website2"
  ServerName website2.loc
  ServerAlias www.website2.loc
  ErrorLog "logs/website2.loc.error.log"
  CustomLog "logs/website2.loc.access.log" common
 
      SSLEngine on 
    SSLCertificateFile conf/ssl.crt/server.crt 
    SSLCertificateKeyFile conf/ssl.key/server.key 
 
  AccessFileName .htaccess
 
  <Directory "d:/webserver/www/website2/">
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 192.168.1.x
    Allow from 127.0.0.1
  </Directory>
       
</VirtualHost>


in my host file i have:
www.website1.loc 192.168.1.x
website1.loc 192.168.1.x
www.website2.loc 192.168.1.x
website2.loc 192.168.1.x

1. now when in my browser i type website2.loc i have an error 500
2. if instead of using <VirtualHost *:80> i use <VirtualHost website1.loc:80> and <VirtualHost website2.loc:80> respectively for website1 and website2.... only website1.loc works :(
so where is my mistake ?
thx.
What does not kill you, makes you stronger

RogTek, Web agency: htttp://www.rogtek.com
facebook: http://www.facebook.com/rogtek
User avatar
alain.roger
 
Posts: 20
Joined: 03. February 2012 22:14
XAMPP version: 7.4.10
Operating System: Kubuntu 20.04

Re: multiple HTTP/HTTPS virtualhosts

Postby Altrea » 26. May 2012 13:15

Hi alain-roger,

alain.roger wrote:1. now when in my browser i type website2.loc i have an error 500

Take a look into your \xampp\apache\logs\error.log fle

And i don't see your NameVirtualHost directive.
I hope it is there, otherwise namebased virtualhosts can't work.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: multiple HTTP/HTTPS virtualhosts

Postby alain.roger » 26. May 2012 13:19

it's like that : NameVirtualHost *:80
What does not kill you, makes you stronger

RogTek, Web agency: htttp://www.rogtek.com
facebook: http://www.facebook.com/rogtek
User avatar
alain.roger
 
Posts: 20
Joined: 03. February 2012 22:14
XAMPP version: 7.4.10
Operating System: Kubuntu 20.04

Re: multiple HTTP/HTTPS virtualhosts

Postby JonB » 29. May 2012 15:04

You failed to address the error log issue with regard to the ISE 500 error. That would probably not be caused by improper vhosts entries, but more likely by either a syntax error in a .conf file, or a URL that pointed to an invalid service.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 111 guests