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.