Forum Moderators: phranque
so at the momment my document root says
DocumentRoot "G:/apachefriends/xampp/htdocs"
and when im trying to set my virtual hosts up i have a setup like this
<VirtualHost example.com>
ServerAdmin admin@example.com
DocumentRoot G:/apachefriends/xampp/htdocs/example
ServerName example.com
ErrorLog logs/example-error_log
CustomLog logs/example-access_log common
</VirtualHost>
<VirtualHost example2.com>
ServerAdmin admin@example2.com
DocumentRoot G:/apachefriends/xampp/htdocs/example2
ServerName example2.com
ErrorLog logs/example2-error_log
CustomLog logs/example2-access_log common
</VirtualHost>
when i type either of the urls it brings me to my documentroot and shows my 2 folders
example
and
example2
I have my listen set at
Listen 80
and server name set at
ServerName 10.0.0.100 (my internal network ip address)
ive used slackware 10 and done this but using xampp it doesnt seem to work ..
all help would be appreciated.
[edited by: jdMorgan at 3:56 am (utc) on Mar. 19, 2005]
[edit reason] Examplified. [/edit]
the code
NameVirtualHost *
<VirtualHost *>
ServerAdmin admin@example.com
DocumentRoot G:/apachefriends/xampp/htdocs/example
ServerName example.com
ErrorLog logs/example-error_log
CustomLog logs/example-access_log common
</VirtualHost>
<VirtualHost *>
ServerAdmin admin@example2.com
DocumentRoot G:/apachefriends/xampp/htdocs/example2
ServerName example2.com
ErrorLog logs/example2-error_log
CustomLog logs/example2-access_log common
</VirtualHost>
ServerName localhost
and left it like that with no ipaddress and it seemed to fix the problem, except i have to fix the error log reporting i kind of took that part out for now
haha but it works and i have multiple domains on the same ip again working fine
oops i also did a common problem i didnt define
my final setup that worked was
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain1.com
ServerAlias domain1.com
DocumentRoot "G:/apachefriends/xampp/htdocs/domain1"
ServerAdmin admin@domain1.com
</VirtualHost>
<VirtualHost *:80>
ServerName www.domain2.com
ServerAlias domain2.com
DocumentRoot "G:/apachefriends/xampp/htdocs/domain2"
ServerAdmin admin@domain2.com
</VirtualHost>