XAMPP - Wordpress Vhosts.. apologies

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

XAMPP - Wordpress Vhosts.. apologies

Postby sagramor » 04. August 2010 20:07

Hello Apache friends,

I humbly ask for your help. I understand this is a much asked topic and I'm sure this pisses the regulars off. Let me say that I have tried to set up multiple wordpress sites locally over 5 times now and I simply cannot stumble upon the right configuration. I have read lots of documentation which is always slightly different.

Here is what I have done:
Installed XAMPP 1.7.3 with Apache and MySQL
My path to htdocs is C:\xampp\xampp\htdocs <--yes I know I have xampp inside an xampp folder. I have modified all my paths to reflect this.
inside \htdocs i have two folders, \site1 and \site2
Inside both of these folders, I have an index.html and a wordpress folder with all the wordpress files.
Configured my hosts file to include the following:
Code: Select all
127.0.0.1       localhost
127.0.0.1       phpmyadmin
127.0.0.1       localhost.site1
127.0.0.1       localhost.site2

My httpd-vhosts files includes the following:
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "C:\xampp\xampp\htdocs"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "C:\xampp\xampp\phpmyadmin"
ServerName phpmyadmin
</VirtualHost>

and
Code: Select all
<VirtualHost *:80>
ServerName localhost.site1
ServerAdmin webmaster@localhost
DocumentRoot "C:\xampp\xampp\htdocs\site1"
</VirtualHost>

<VirtualHost *:80>
ServerName localhost.site2
ServerAdmin webmaster@localhost
DocumentRoot "C:\xampp\xampp\htdocs\site2"
</VirtualHost>

Afterwards, I go to http://localhost.site1/phpmyadmin and set up a db, a user, and permissions.
Then I go into C:\xampp\xampp\htdocs\site1\wordpress\ and edit my wp-config.php file to include
Code: Select all
define('DB_NAME', 'site1');

/** MySQL database username */
define('DB_USER', 'my_username');

/** MySQL database password */
define('DB_PASSWORD', 'my_password');

/** MySQL hostname */
define('DB_HOST', 'localhost');

After all of this, when I try to go to:
http://localhost/wordpress/wp-admin/install.php
or
http://localhost.site1/wordpress/wp-admin/install.php
I get nothing. Please help me :oops:
sagramor
 
Posts: 2
Joined: 04. August 2010 19:30

Re: XAMPP - Wordpress Vhosts.. apologies

Postby JonB » 04. August 2010 20:34

You get no errors in the Apache error log(s)?

Can you access HTML files correctly in both 'sites'?

Does a phpinfo.php file work right from both locations?

If you tried multiple time, did you ever get to the actual install? if so be sure to drop the databases.

If you are using WP 3.0, try 2.9.2 or the patched up 3.0.1 - 3.0 users have had many inexplicable problems - including a couple posted here.

viewtopic.php?f=16&t=40967&p=163163&hilit=Wordpress+3.0#p163163

BTW, this one should not work;

http://localhost/wordpress/wp-admin/install.php
it would have to be http://localhost/wordpress/site1/wp-admin/install.php
or http://localhost.site1/wordpress/wp-admin/install.php (your second entry in the post)

the other should be (I think)
http://localhost.site2/wordpress/wp-admin/install.php

For your sanity's sake, why not make them site1 and site2 and not have them nested in the localhost's htdocs folder? :idea: (only a suggestion)

:roll:
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

Re: XAMPP - Wordpress Vhosts.. apologies

Postby sagramor » 04. August 2010 21:08

Error Log: [Wed Aug 04 13:57:52 2010] [error] [client 127.0.0.1] File does not exist: C:/xampp/xampp/htdocs/wordpress
The HTML files do work.
The phpinfo.php does not appear to be working when i go to http://localhost.site1/phpinfo.php
no, I never got the actual install script to work.

As per your sane suggestion, you mean have C:\site1 and C:\site2?
Where would I put the xampp and wordpress folders? It was my understanding that everything HAD to be in htdocs\
oi vey!
sagramor
 
Posts: 2
Joined: 04. August 2010 19:30

Re: XAMPP - Wordpress Vhosts.. apologies

Postby JonB » 04. August 2010 23:28

An Apache note:

When you create vhosts, effectively you are creating new 'webspaces' BUT they are specific to Apache. The DocumentRoot directive/setting tells Apache where you want to place the files that you wish to be published via Apache. (if you look, you will see the DocumentRoot of localhost is [normally] c:\xampp\htdocs)

The phpinfo.php does not appear to be working when i go to http://localhost.site1/phpinfo.php


you did copy it (phpinfo.php) from "htdocs\xampp" into this location?
DocumentRoot "C:\xampp\xampp\htdocs\site1" :?:

here's a pic of my XAMPP devlopment server's folder

Image

and here's the vhost directive for one of the 'sites' (the expanded one in C;\xampp\sites)

Code: Select all
<VirtualHost *:80>
    ServerAdmin jonb@newnetenterprises.xxx
    DocumentRoot "C:/xampp/sites/es.newnetenterprises"
    ServerName es.newnetenterprises.xxx
    ErrorLog "logs/es_bravo-error.log"
</VirtualHost>


I put the 'sites' folder inside c:\xammp so I could back it all up in one piece with Acronis every day (and I know where to find everything :shock: ). That was merely a convenience thing, they could be on any mapped drive.

You only need one 'htdocs/xampp' folder as all that stuff (the tools) is server-wide. You can see I placed the wordpress folder(s) right under the DocumentRoot in each case. They all work, by the way.

Generally vhosts shoulld not be nested, as it makes the Vhost(s) part of the existing site. I.E. you could reach it through http://localhost/site1.

LOL - I haven't heard 'oi vey' since last chatting with a friend of mine from Chicago (and before that since leaving NYC a long, long time ago) :mrgreen:

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 155 guests