Jump to content

Recommended Posts

Posted

I recently installed xampp on my Windows xp machine and everytime i got to my domain name it brings up the xampp control pannel (web based thingy) how do i get it to go to htdocs?

Posted

Welcome to the forums.

 

You can edit the httpd to tell apache where you store your files, I put mine at C:\www

 

So I have the following set:

DocumentRoot "C:/www"

<Directory "C:/www">

 

and then for each website I have under the virtual hosts:

 

<VirtualHost *:80>

ServerName www.local.joomla.com:80

DocumentRoot "C:/www/joomla"

</VirtualHost>

 

Where the document root is changed to whatever the path is, and as you can see, to make sure I don't mess up, I have each domain name as www.local.XXXXX.com

 

And then to get the computer to see of this, find your HOSTS file in windows/system32/drivers/etc open it in notepad and add in whatever lines you need, e.g.:

127.0.1.1 www.local.joomla.com

 

Thats it, should work just fine!

 

JimE

Posted (edited)

Jim, what you've described sounds like what I want to do. But I'm having trouble.

 

 

<VirtualHost *:80>

ServerName local.cms.com:80

DocumentRoot "C:/Program Files/xampp/htdocs/cms3"

</VirtualHost>

 

I tried above in both httpd.conf and httpd-vhosts.conf

 

Setting in httpd.conf for document root:

 

DocumentRoot "C:/Program Files/xampp/htdocs"

 

Setting in hosts file of windows

 

127.0.0.1 localhost

127.0.1.1 local.cms.com

 

Result: every time I go to local.cms.com I get the index.php file found in htdocs directory. Normally this would redirect to xampp directory but I changed the code so now it just tells me there's an error with my setup... which is the default error message. So it appears that Apache isn't picking up on my virtual hosts directive but the setting in the 'hosts' file of windows is working.

 

Thanks for the help.

Edited by surefire
Posted
Setting in hosts file of windows

 

127.0.0.1 localhost

127.0.1.1 local.cms.com

I'm not sure if that IP address is a typo or not, but I think it should be 127.0.0.1, not 127.0.1.1. Your computer and web server normally aren't listening for connections on 127.0.1.1, and this probably would prevent the VirtualHost directives from working.

Posted

Hello,

 

There is one more bit, I included it above but I didnt say where to change it, just down from the document root will be the following:

 

>#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">

 

Make sure you change this to exactley the same as your documentroot is above.

 

Is that any good?

 

JimE

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...