Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to configuring a xampp web server for different root directory

The web directory is the home of all of your application's public and static files. Including images, stylesheets and JavaScript files. It is also where the front controllers live.

So the question is when i install and set up xampp my web directory is:

xampp\htdocs 

and I want to set it up for:

xampp\htdocs\myproject\web 

How to do it? Now when I type in my browser the address: http://localhost/
I enter xampp\htdocs directory
and I want to type in my browser the address: http://localhost/
and enter xampp\htdocs\myproject\web directory

like image 221
vardius Avatar asked Sep 19 '13 19:09

vardius


People also ask

Where is my XAMPP root directory?

The document root (web root) directory is located at /opt/lampp/htdocs/ . All files placed in this directory will be processed by the web server. To host other files on your system with XAMPP, you can configure an alias with Apache.


1 Answers

You can change Apaches httpd.conf by clicking (in xampp control panel) apache/conf/httpd.conf and adjust the entries for DocumentRoot and the corresponding Directory entry. Just Ctrl+F for "htdocs" and change the entries to your new path.

See screenshot:

XAMPP config

# # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "C:/xampp/htdocs" <Directory "C:/xampp/htdocs"> 
like image 152
blckwngd Avatar answered Oct 14 '22 00:10

blckwngd