Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Apache Friends (XAMPP). I installed it under C: drive. Its path is C:\xampp\
Its default root is C:\xampp\htdocs.Thus, all programs need to reside in C:\xampp\htdocs\ so that we can run http://localhost/myapp/

PhpMyAdmin comes along with XAMPP, but it resides in C:\xampp\ and it can be run from /localhost/phpMyAdmin/.
When my application is moved to C:\xampp\, I cannot run it /localhost/myapp.

I would like to have two server root C:\xampp\ and C:\xampp\htdocs\ so that I can separate my private apps and public apps in different folders. And both can be run from http://localhost/ such as /localhost/myprivateapp/ and /localhost/mypublicapp/

How can I do that ? I'm on Windows XP.

share|improve this question

closed as off topic by John Gardeniers, Ward, rnxrx, Michael Hampton, Scott Pack Sep 25 '12 at 0:22

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Basically you can do anything with XAMPP you could do with any other Apache installation. The first thing to know is that the Apache configuration files for a default XAMPP install are in c:\xampp\apache\conf and C:\xampp\apache\conf\extra

The default webroot is, as you mentioned, c:\xampp\htdocs as defined by the above configuration files, the phpMyAdmin directory is nothing more than a standard Apache alias which makes /phpMyAdmin look in "c:\xampp\phpmyadmin\" for its files.

You have several options, depending on what you mean by public vs private (I assume you might want to password protect the private files). You can use an alias, or you could even set up an entirely new vhost/server, I will post links to some documentation and a very basic example below.

The simplest way to accomplish what you want would be to create a folder in the c:\xampp root called "private" - "c:\xampp\private\" and edit the c:\xampp\apache\conf\extra\httpd-xampp.conf file with a line:

Alias /private "/xampp/private"

If you want to password protect it, or give it any other special directives you would follow that line with a directory block:

<Directory "/xampp/private">
    AuthType Basic
    AuthName "Restricted Files"
    AuthUserFile /xampp/htpasswd-private
    Require user foo

Any time you make changes to these files you need to restart Apache for them to take effect.

share|improve this answer

Thanks to WerkkreW, I added an alias for my private folder as below. I can now access my apps from /localhost/private/myapp.

Alias /private "C:/xampp/private/"
<Directory "C:/xampp/private/">
    Order allow,deny
    Allow from all

But, I still need to run my app /localhost/private/myapp as /localhost/myapp. Thus, I tried an alias as below :

Alias / "C:/xampp/private/"
<Directory "C:/xampp/private/">
    Order allow,deny
    Allow from all

I think it is a wrong usage and I cannot access my apps in C:\xampp\htdocs

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.