virtual directory??

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

virtual directory??

Postby bludshot » 09. September 2008 00:01

When I go to http://localhost , it shows me what is in C:\xampp\htdocs\

Do I have to put my website at C:\xampp\htdocs\ ??


I would rather put my website at D:\My Documents\Website\

So, can I set xampp to make http://localhost go to D:\My Documents\Website\ ?

I have no idea how to do this.

Thanks!
bludshot
 
Posts: 6
Joined: 08. September 2008 23:57

Postby glitzi85 » 09. September 2008 08:38

Why do you want to do this?

If you really want to, you can open the httpd.conf and replace the DocumentRoot Directive to your desired Path. Additional there should be a block looking like this:

Code: Select all
<Directory "C:/xampp/htdocs">
[...]
</Directory>


This Path you have to adjust too.

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby bludshot » 09. September 2008 20:23

I wanted to do it because there is a bunch of stuff in htdocs, and I wanted to put my website on its own, nice and un-cluttered. But I guess I can't do it, because I need those files right?
bludshot
 
Posts: 6
Joined: 08. September 2008 23:57

Postby glitzi85 » 09. September 2008 20:59

It's depending what you define as "need". The XAMPP-Site is just a bunch of introduction sites, with some examples and some helpful tools. Two of them you will probably need. One is phpinfo, the other is phpMyAdmin.

phpinfo is an overview of all PHP Settings. This can be created easily, just put this in a file:

Code: Select all
<?php
phpinfo();
?>


save it as phpinfo.php in a http reachable folder and call it with your browser. This is very helpful if you want to install a script and do not know whether your installation meets the minimun citeria or not. Just call it and compare the several settings.

phpMyAdmin you will need as soon as you want to develop applications with MySQL, as it is a configuration frontend for this Database. This is not affected by the htdocs folder, as it is included via an Alias-Directive from the xampp-Directory. Even if you delete the complete content of htdocs, http://localhost/phpmyadmin will still work. So don't worry about this.

Maybe you want use the security tool, shipped with XAMPP. This is only required if you expect someone is accessing your computer. In this case you can run the security tool and afterwards change your configuration.

Now you have to decide how you want to do it. The simplest solution is to create a new folder inside the htdocs directory and put all your files inside this folder. You can do this for every project you make. Then you simply can reach every project by going to http://localhost/projectfolder

If you have more than one project at the same time, you will have to use VirtualHosts in Apache as the DocumentRoot just can lead to one directory. And then it is more complicated than just changing two lines in httpd.conf.

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby bludshot » 09. September 2008 22:23

Ok great, I do need to use phpmyadmin. I just edited the conf file. Works great, thanks
bludshot
 
Posts: 6
Joined: 08. September 2008 23:57

Postby EnglishRocker » 12. September 2008 12:32

Why not just put your website in C:\xampp\htdocs\website\?
It's easier than changing all of the permissions.
You access it by calling localhost/website.
EnglishRocker
 
Posts: 25
Joined: 12. September 2008 11:07

Postby bludshot » 12. September 2008 18:56

Because I'd rather access my site at the root url of localhost.

I've done it, and didn't have to change any permissions. Is there some permission stuff I need to change???
bludshot
 
Posts: 6
Joined: 08. September 2008 23:57


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 105 guests