Page 1 of 1

Virtual host hell

PostPosted: 14. February 2006 00:02
by kightErrant03
I’m having a problem setting up virtual hosts using the Xampp lite package, in order to build a local development version of sites on my windows XP computer. I can get textpattern to run if I set up Apache and MySql myself. But I’m trying to get the server running ‘propperly,’ so I can develop other sites as well.

I’ve read many different articles, one specifically on how to set up xampp for textpattern. I’m still running into walls. Any help would be appreciated.

Heres the setup info:

=============================================================
Virtual hosts set-up in httpd.conf:

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
ServerAdmin admin@localhost
DocumentRoot /xampplite/htdocs/xampp
ServerName localhost
<Directory "/xampplite/htdocs/xampp">
Options Indexes FollowSymLinks ExecCGI
</Directory>
</VirtualHost>

<VirtualHost testpattern.dev>
ServerName testpattern.dev
ServerAdmin admin@localhost
DocumentRoot /xampplite/htdocs/testing/testpattern
DirectoryIndex index.php

<Directory "/xampplite/htdocs/testing/testpattern">
Options Indexes FollowSymLinks
AllowOverride All
#Override default restrictive access control setting for Apache 2.2
Allow from All
</Directory>
</VirtualHost>

=============================================================
The resulting effect on the xampp lite setup is:




============================================================
DNS setup in Host doc:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
127.0.0.1 testpattern.dev
===========================================================


http://testpattern.dev, which hosts an un installed version of textpattern (site root) returns:

Warning: include(/home/path/to/textpattern/dir/publish.php) [function.include]: failed to open stream: No such file or directory in C:\xampplite\htdocs\testing\testpattern\index.php on line 27

Warning: include() [function.include]: Failed opening '/home/path/to/textpattern/dir/publish.php' for inclusion (include_path='.;C:\xampplite\php\pear\') in C:\xampplite\htdocs\testing\testpattern\index.php on line 27

Fatal error: Call to undefined function textpattern() in C:\xampplite\htdocs\testing\testpattern\index.php on line 28

===========================================================
http://testpattern.dev/textpattern/ (install root) returns:

Database unavailable.

===========================================================

What the hell have I done wrong, xampp was meant to be the easy option, I should have know better. I’m only a lowly designer so try and use small words. ;)

PostPosted: 14. February 2006 00:43
by WorldDrknss
Visit http://xampptutorials.com

It will give you step by step on how to properly setup virtualhost.

PostPosted: 14. February 2006 00:53
by Wiedmann
Warning: include(/home/path/to/textpattern/dir/publish.php) [function.include]: failed to open stream: No such file or directory in C:\xampplite\htdocs\testing\testpattern\index.php on line 27

1st This is no Problem with Apache and/or VirtualHosts, this is a configuration problem in this php script. This script trys to include a file from a wron path.
--> Read the documentation for this script

Code: Select all
NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
    ServerName localhost
    ...
</VirtualHost>

<VirtualHost testpattern.dev>
    ServerName testpattern.dev
    ...
</VirtualHost>

2nd This should be:
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost:80
    ...
</VirtualHost>

<VirtualHost *:80>
    ServerName testpattern.dev:80
    ...
</VirtualHost>

PostPosted: 14. February 2006 01:57
by SeanO
You set the Document root to be
Code: Select all
DocumentRoot /xampplite/htdocs/testing/testpattern


Then you refer to
Code: Select all
http://testpattern.dev/textpattern/


Which should then point at the dir /xampplite/htdocs/testing/testpattern/textpattern

Now apart from the fact that testpattern and textpattern tend to be confused not to mention confusing, if your DocumentRoot already points at x/y/z you don't need to refer to http://sitename.com/x/y/z or http://sitename.com/z , http://sitename.com/ maps onto /x/y/z already.

Also this bit:
/home/path/to/
That's definitely some screwed up path in the app

PS believe me XAMPP is the easy way to do all this. Maybe next time you'll hire one of those long haired linux server wierdos to set up your servers ;)