[i give up] Virtualhost Xampp Windows

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

[i give up] Virtualhost Xampp Windows

Postby QiQme » 26. June 2008 15:46


Using xampp for a couple of years now but never had the need to use virtualhosts.

But now i do :)

After 2 days struggling and reading all forumposts i just can't get it running the way it should be.

Please advice :oops: :oops:

What i want to do:
www.domain.tld is my main develop domainname and when opening it shows the whole htdocs index with directories.
When ussing www.domain.tld/phpmyadmin, it shows phpmyadmin as it should be

I'm now working on a site with a lot of mod_rewrite stuff which i want to test as if it's located at www.communitysite.tld (C:/www/htdocs/communitysite) for optimal testing and developing.

But i just can't get it working correct.

if i use www.communitysite.tld it shows that website
if i use www.domain.tld it also goes to that communitysite website

that's not the way it should be.

www.domain.tld must show my htdocs index

So if anyone sees my misconfiguration or has an idea, please help me :)

My httpd.conf
Code: Select all
ThreadsPerChild 250
MaxRequestsPerChild  0

ServerRoot "C:/www/apache"

Listen 80

LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule status_module modules/mod_status.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule autoindex_color_module modules/mod_autoindex_color.so

ServerAdmin admin@localhost

ServerName localhost:80

DocumentRoot "C:/www/htdocs"

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

<Directory "C:/www/htdocs">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all

<IfModule dir_module>
    DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all

ErrorLog logs/error.log

LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    CustomLog logs/access.log common


<IfModule alias_module>
    ScriptAlias /cgi-bin/ "C:/www/cgi-bin/"

<Directory "C:/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

DefaultType text/plain

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi
    AddType text/html .shtml
   AddOutputFilter INCLUDES .shtml

EnableMMAP off
EnableSendfile off

Include conf/extra/httpd-xampp.conf
Include conf/extra/httpd-multilang-errordoc.conf
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-userdir.conf
Include conf/extra/httpd-info.conf
Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-manual.conf
Include conf/extra/httpd-dav.conf
Include conf/extra/httpd-default.conf
Include conf/extra/httpd-ssl.conf

<IfModule ssl_module>
   SSLRandomSeed startup builtin
   SSLRandomSeed connect builtin

Include conf/extra/perl.conf

My httpd-vhosts.conf
Code: Select all

NameVirtualHost *:80

<VirtualHost *:80>
   ServerName communitysite.tld
   ServerAlias www.communitysite.tld
   ServerAdmin webmaster@communitysite.tld
   DocumentRoot "C:/www/htdocs/communitysite"
   ErrorLog C:/www/htdocs/communitysite/error_log
   <Directory "C:/www/htdocs/communitysite">
      Options Indexes +FollowSymLinks Includes ExecCGI MultiViews
      IndexOptions FancyIndexing
      DirectoryIndex /index.html index.php index.php4 index.php3 index.cgi index.pl index.htm index.shtml index.phtml
      AllowOverride All
      Order allow,deny
      Allow from all
   ScriptAlias /cgi-bin/ "C:/www/htdocs/communitysite/cgi-bin/"

My C:\Windows\System32\drivers\etc\hosts file
Code: Select all      localhost      www.domain.ltd      # Main xampp dev domainname and should always go to C:/www/htdocs      www.communitysite.tld   # Must be poiting to C:/www/htdocs/communitysite
::1      localhost

Posts: 3
Joined: 26. June 2008 15:16

Postby Nobbie » 26. June 2008 16:20

>that's not the way it should be.

... therefore you *MUST* declare a virtual host for www.domain.tld as well as for www.communitysite.tld. As far as i can see, you configured only one virtual host (for www.communitysite.tld). All server requests, which are unknown to Apache (as www.domain.tld) are routed to the FIRST virtual host entry.
Posts: 8640
Joined: 09. March 2008 13:04

Postby QiQme » 26. June 2008 16:53

Thank you for your reply :)

So if i add the code below to my httpd-vhosts.conf it should be enough ?

Code: Select all

<VirtualHost *:80>
   ServerName domain.ltd
   ServerAlias www.domain.ltd
   ServerAdmin webmaster@domain.ltd
   DocumentRoot C:/www/htdocs
   <Directory "C:/www/htdocs">
      Options Indexes FollowSymLinks Includes ExecCGI MultiViews
      IndexOptions FancyIndexing
      AllowOverride All                     
      DirectoryIndex /index.html index.php index.php4 index.php3 index.cgi index.pl index.htm index.shtml index.phtml
      Order allow,deny
      Allow from all
   ScriptAlias /cgi-bin/ "C:/www/cgi-bin/"

Posts: 3
Joined: 26. June 2008 15:16

Postby QiQme » 26. June 2008 16:57

Yes, that's it :D :D :D

I just don't understand why i couldn't get it running :oops:

Thanx very very much
Posts: 3
Joined: 26. June 2008 15:16

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 58 guests