How to set up an alias on xampp dev machine

I want to be able to use aliases outside the scope of c: \ xampp, as in

alias /opt "C:\opt" 

Is there some kind of setting in xampp that I can’t install, I tried to change the user, added, etc., of which nothing works, this is a pure dev environment, so what is the most complete solution here?

Regards, // t

+7
source share
3 answers

To do this, you need to have two entries: an alias and a directory. You should have an entry in the file / opt / lampp / etc / extra / httpd -xampp.conf ( source ), which looks like one of the following code blocks. Some configuration parameters have been changed, for more information see the document Upgrading to 2.4 from 2.2

Apache 2.2 Config:

 Alias /opt/ "C:/opt/" <Directory "C:/opt"> Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> 

Apache 2.4 Config:

 Alias /opt/ "C:/opt/" <Directory "C:/opt"> Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Require all granted </Directory> 

The "Alias" section determines where your virtual directory and real directory are located. In this example, site.com/opt/(or localhost / opt) will point to C: / opt on your hard drive.

Part of the directory determines how apache should handle content served from this location, it will function like any other directory entry, so it might be a good idea to just copy it from your root entry and make it similar.

This also requires the inclusion of mod_alias, check your httpd-xampp.conf and make sure the entry for it is not commented out. After any changes to your conf file, you will need to restart apache so that the changes are active.

+11
source

The first thing you need to do is add the alias directory to your XAMPP installation:

 C:\xampp\apache\conf\alias 

Next, you need to modify the Apache configuration file . You can find it under

 C:\xampp\apache\conf\httpd.conf 

Once you have opened httpd.conf , add the following to the end and save it.

 Include "conf/alias/*" 

Now for each alias you want to create, you need to create one file as follows:

 <directory "c:\users\foo\programming\dev"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks Includes ExecCGI # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> Alias /dev "C:\users\foo\programming\dev" 

In this example, the alias is called "dev" and it points to "C: \ users \ foo \ programming \ dev"

Finally, you need to restart the Apache server and it.

+2
source

finally easy as in:

 Alias /opt "C:/opt" <Directory "C:/opt"> Options +Indexes AllowOverride None Order allow,deny Allow from all </Directory> 
0
source

All Articles