Access XAMPP from External Hard Disk

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

Access XAMPP from External Hard Disk

Postby belajarxampp » 11. December 2020 01:07

Dear Expert,

I need your help since I have:

- XAMPP installed in C drive and
- XAMPP installed in D drive which is all of my htdocs files in D drive.

Problems:

- I opened XAMPP from C drive, then
- I type localhost/filename which is files located in D drive, and the result is nothing.

My question is:

1. How to access my all files in D drive when I type localhost/filename then it will show up?
2. Should I open XAMPP from C drive to get access all files in D drive with some edit on XAMPP? if yes, can you help me the step by step about how to.
3. OR should I open XAMPP from D drive in order to open htdocs files in D drive?

Highly appreciate if you can help me to solve this issue. Sorry, I am a newbie for this.

Thank you,

Alex
belajarxampp
 
Posts: 1
Joined: 11. December 2020 00:56
XAMPP version: 3.2.4
Operating System: Windows 10

Re: Access XAMPP from External Hard Disk

Postby Nobbie » 11. December 2020 12:26

Do NOT install Xampp twice. Its sufficient to install Xampp to C:/xampp

If you need to access files from other folders or drives than c:/xampp/htdocs, use the ALIAS configuration option, see https://httpd.apache.org/docs/2.4/mod/mod_alias.html

For example, in your case:

Code: Select all
Alias /foldername d:/myfiles

With that configuration enter http://localhost/foldername/filename.html into browser to request d:/myfiles/filename.html

WARNING: External drive letters like d: are valid only for the logged in Windows User. If you are running Apache as a service (there is an option in Xampp Dialog), Apache is started from User "SYSTEM", which does NOT know d: drive. Therefore you MUST NOT start Apache as service, simply start it manually in the Xampp Dialog (not automatically) via clicking on Apache and MySQL start option. Otherwise you will get Error 403 or Error 404 when requesting http://localhost/foldername/filename.html

You also have to grant certain rights to Apache to access files on D: drive, at least add this configuration to your httpd.conf:

Code: Select all
<Directory "D:/myfiles" >
Require all granted
</Directory>
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 106 guests