jordanwb Posted March 11, 2008 Share Posted March 11, 2008 I have XAMPP installed on my Vista computer. I want E:\xampp\htdocs\jukebox\songs to point to E:\Music, I found this topic: http://www.phpfreaks.com/forums/index.php/topic,105954.0.html and this page: http://httpd.apache.org/docs/1.3/mod/mod_alias.html They're both useful (more the later than the former) but I'm kinda confused where and how I'm supposed to put this in. Do I put it in a .htaccess file or in php.ini? BTW where did the "Topic Solved" button go? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/95664-solved-creating-virtual-directories-where-to-set-it-up/ Share on other sites More sharing options...
jordanwb Posted March 11, 2008 Author Share Posted March 11, 2008 I found out that I need to put Alias /jukebox/songs "E:/Music" into Apache's httpd.conf file but I get an HTTP 403 error. I know I'm supposed to put a <Directory "E:/Music"> after but I don't know what to put there. Quote Link to comment https://forums.phpfreaks.com/topic/95664-solved-creating-virtual-directories-where-to-set-it-up/#findComment-489840 Share on other sites More sharing options...
jordanwb Posted March 11, 2008 Author Share Posted March 11, 2008 I figured it out. (Sorry for triple posting but I couldn't edit) For those that need help on a similar subject: 1: Open Apache's config file (%XAMPP_ROOT_FOLDER%\apache\httpd.conf using Notepad or whatever 2: At the end of the file add the following: Alias *path to virtual dir* *path to real dir* <Directory *path to real dir*> Options +Indexes Order allow,deny Allow from all </Directory> This is a real example that I'm using: Alias /jukebox/songs "E:/Music" <Directory "E:/Music"> Options +Indexes Order allow,deny Allow from all </Directory> Make sure that the paths don't have a trailing slash. Save the httpd.conf file and restart Apache Quote Link to comment https://forums.phpfreaks.com/topic/95664-solved-creating-virtual-directories-where-to-set-it-up/#findComment-489847 Share on other sites More sharing options...
eddierosenthal Posted March 11, 2008 Share Posted March 11, 2008 virtual hosting will allow you to create a local domain name for any directory on your hard drive. therefore, after you create it it can be accessed via your browser using the domain name you choose. so that if you wanted to have pages served from e:\music you can. you could call it local.music.com or whatever 1) on a windows machine you need to set up the etc/hosts file found in system32/drivers/etc/hosts it might end up like this: 127.0.0.1 localhost 127.0.0.1 local.music.com # for browser access if you choose to call it that ( local.music.com) or anything you want. just make it different from any real web server so you know where you are... then you need to configure apache to know how to serve the pages... with xampp you are given a lot of config files, the one you need is called extra.httpd-vhosts.conf under the apache/conf files. it might end up looking a bit like this: <VirtualHost *:80> DocumentRoot E:\music ServerName local.music.com <Directory E:\music> Options Indexes FollowSymLinks +Includes AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> then restart the apache serve, but likely you will also need to reboot so that the etc hosts file is reread. let me know how that goes... at that point you should be able to url the site from you browser by pointing it to : http://local.music.com Quote Link to comment https://forums.phpfreaks.com/topic/95664-solved-creating-virtual-directories-where-to-set-it-up/#findComment-489855 Share on other sites More sharing options...
jordanwb Posted March 11, 2008 Author Share Posted March 11, 2008 I had already solved the problem but your info may be useful to others. Quote Link to comment https://forums.phpfreaks.com/topic/95664-solved-creating-virtual-directories-where-to-set-it-up/#findComment-489856 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.