expanding Web space by adding a disk drive...

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

expanding Web space by adding a disk drive...

Postby mk6913 » 13. September 2020 14:42

I was wondering what needs to happen if I want to locally expand my webspace. What I have build sofar:

I have a desktop with a 4TB harddisk, and xampp installed on it and I've build a Php/mysql movie-database, with music video's on it. These music video's are from bands with live footage of concerts i've been too and its fun to collect and Database it.. 2 years ago I had to expand my 2T harddisk and moved everything over to a 4TB disk, as I needed space to store the increasing amount of live movies.

And now my question.... Is it possible to have additional HD's (for example an additional 4T disk), enabling me to have around 8T available for storing the video's. I wonder what the right approach there is... I could of course also buy a 8T disk.. but how is this normally done at other companies with Huge amount.
Posts: 2
Joined: 13. September 2020 14:39
XAMPP version: 3.2.4
Operating System: win10

Re: expanding Web space by adding a disk drive...

Postby Altrea » 13. September 2020 17:42

That highly depends on the way you store the data.
For Apache it is quite easy to deliver from different hard drives. So if you only reference for example movie files on your hard drives this is one solution.
If your data is fully capsuled in your database than it is more difficult. You would need to partition your database tables.
In enterprise solutions server capacities is often modular or virtually assigned, so you would have a storage server (like HPE MSA or 3Par) and another system assigning chunks of that storage logically but not affected by single drive borders.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
AF Moderator
Posts: 10342
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: expanding Web space by adding a disk drive...

Postby mk6913 » 14. September 2020 06:48

OK.. So indeed my data is not capsuled into the database. The xampp environment is currently on the same drive as my data and the db only holds hyperlinks,text,titles, artist etc (so quite simple setup).
So where can I let Xampp (apache) know that I'm using an additional drive (4T), which would then extend the storage capacity of my www environment.
Posts: 2
Joined: 13. September 2020 14:39
XAMPP version: 3.2.4
Operating System: win10

Re: expanding Web space by adding a disk drive...

Postby Nobbie » 14. September 2020 12:33

There are many different options:

1) Define an ALIAS in httpd.conf which points to the new drive. You can then link to media files using that ALIAS. Example:

Code: Select all
ALIAS /mydrive  d:/mymedia

And in your PHP Script or HTML Documents you can link to media on that drive via:

Code: Select all

The above link yield to d:/mymedia/myvideo.mpg

2) Or, a little more sophisticated, define a new VirtualHost, which holds the new drive as DocumentRoot. Keep in mind, if you define any VirtualHost, you MUST define ALL servernames (i.e. localhost) as VirtualHosts. Example:

Code: Select all
<VirtualHost *:80*>
Servername mymedia.local
DocumentRoot "d:/mymedia"

If you do so, you also have to apply an entry for mymedia.local in every hosts file of your environment, in Xampp Server PC, in each client PC etc., which assigns mymedia.local to the LAN IP of the Xampp PC.

Code: Select all    mymedia.local

where is meant to be the LAN IP of the Xampp PC.

You finally can assign a media file via this URL:

Code: Select all

3) Last not least, you could also simply create a "symbolic link" from your new hard drive into the htdocs folder of your Xampp PC. In Windows 10 there is a command (to be used in a Terminal) called "mklink". You can create a symbolic link to your new drive like this for example:

Code: Select all
mklink c:/xampp/htdocs/mydrive   d:/

You will find the contents of the new drive d: then also under c:/xampp/htdocs/mydrive and can also create URLs which point to that folder. Apache must be told to follow those symbolic links, you have to add the option "FollowSymLink" in you configuration of the DocumentRoot. Probably there is already such an option per default in your Xampp configuration. See the <Directory "c:/xampp/htdocs"> configuration in your Xampp httpd.conf. Finally that results in URLs like this:

Code: Select all

A last hint: A drive letter like d: is only known to the currently logged in User (your UserID). If you run Apache as a service (which you can opt for in the Xampp DIalog), Apache is NOT executed by your UserID, instead it is started at boot time by User "System". At that time and for this User there is no drive letter D:, therefore Apache will fail to connect to the new drive. You have to start Apache manually instead of starting it at boot time and also do NOT run Apache as a service. You can remove the "x" in the option dialog for running Apache as a service in the Xampp DIalog.

Instead you can avoid using drive letters, use the so called UNC Pathname of your Drive. That is the name of the WIndows Share and usually looks like \\mydrive\mymedia or similar. Finally keep in mind, that Apache must have appropriate rights to read from that drive. If it is a NAS, you have to assign certain rights in the setup of the NAS.
Posts: 11676
Joined: 09. March 2008 13:04

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 105 guests