Changing the directory

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

Changing the directory

Postby Tedmund » 04. January 2009 05:05

I was reading that, XAMPP disables some features with apache and mysql. And that I'd have to do everything through XAMPP iteslf...

What I mean is, Can I change the directory to something else for my web content. I don't want to do everything strictly in \xampp\htdocs\. I'd like to use a separate folder on a different hard drive. Can someone tell me how to change the directory?

If not, do I have to use a seprate version of XAMPP?

Edit, also is there a way to change it to open a different link every time a use my ip. Because I'd rather a different location instead of http://***.***.***.***/xampp/splash.php
Last edited by Tedmund on 04. January 2009 05:17, edited 1 time in total.
Tedmund
 
Posts: 6
Joined: 03. January 2009 06:50

Re: Changing the directory

Postby Sharley » 04. January 2009 05:17

The simplest way is to use a Virtual Host by editing the xampp\apache\conf\extra\httpd-vhosts.conf file.

This will allow you to put your web site content in any location on your PC and also allows you to have multiple web sites served by the one server in XAMPP.

First do the hard yards by doing some reading:
Search the XAMPP For Windows forum for virtualhost or vhost.

Official Apache Documentation references:
http://httpd.apache.org/docs/2.2/vhosts/
http://httpd.apache.org/docs/2.2/vhosts/examples.html
Last edited by Sharley on 05. January 2009 02:32, edited 1 time in total.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Changing the directory

Postby berryboy » 04. January 2009 12:56

as for adding a dir try my thread: viewtopic.php?f=16&t=32593&p=132093#p132093

all that does is add my 2nd drive(E:) as http://xxxxxxxx/download2/
berryboy
 
Posts: 10
Joined: 29. December 2008 18:00

Re: Changing the directory

Postby dmphotography » 04. January 2009 16:28

Tedmund wrote:I was reading that, XAMPP disables some features with apache and mysql. And that I'd have to do everything through XAMPP iteslf...

What I mean is, Can I change the directory to something else for my web content. I don't want to do everything strictly in \xampp\htdocs\. I'd like to use a separate folder on a different hard drive. Can someone tell me how to change the directory?


If you're just tinkering or making one website on your webserver, then here's the way to do that:

Go to /xamp/apache/conf/ and open httpd.conf .
Search for DocumentRoot "C:/xampp/htdocs" (or whatever drive you installed XAMPP on)
Now change this to what you want your website directory to be. (example: "B:/mysite/")

Next, go down a few lines and find this:

<Directory "C:/xampp/htdocs">

and change it to what you want your website root folder to be.

Now simply save it and close it out. You should now reach your new directory when you go to "http://localhost/"

If you've configured your ports correctly through your firewall and router, your IP address should take you to this location as well. Be sure to have an index.php or index.html file in your new root directory, otherwise you'll get a page not found error or something similar.

Since you're reaching the splash page, this should work just fine for you.


Tedmund wrote:If not, do I have to use a seprate version of XAMPP?


NO!!! DO NOT tryt o install XAMPP twice to run another website on the same server. This will only cause problems. Trust me, I did it because I didn't understand it.

If you're wanting different websites on the same server, you will first need different domain names to access them publicly, otherwise you will always go to whatever your first [url]DocumentRoot[/url] is set to.

If you do want it and have a couple of domain names, use a service like http://www.ZoneEdit.com (it's free) and point the domain names to your IP address.

Then, do as Sharley said and follow those links on how to configure vhosts. You can have as many websites as you want on your server, assuming you have enough domain names and fast enough internet connection to support it.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 270 guests