Run wampserver from 2 hdd
Posted by: Dragos (---.workpage.ro)
Date: June 25, 2021 02:20PM

Hello.
I would like to ask how I can expand the server so that the website can work with folders and files on 2 hard disks.
In fact I have wampserver (64) on the c: partition and because it is full I would like to continue running both the c: / wamp64 / www / partition and a new hard d :.
I mention that I have Wampserver 3.2.5 Thank you.

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Otomatic (Moderator)
Date: June 25, 2021 03:41PM

Hi,

Local sites defined as VirtualHost do not need to be in the Wampserver tree (c:\wamp64\www\mysites\) and can be located almost anywhere on other drives or partitions.

For example, my Wampserver is in e:\wamp64\ but all my sites ares in g:\www\

See The need for Virtual Host

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Dragos (---.orangero.net)
Date: June 25, 2021 04:11PM

I understand that but i want to run my site from c:/ wamp64/www/my site and share (link files) from another partition d:/movies/.....What can i do?

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Otomatic (Moderator)
Date: June 25, 2021 04:42PM

Hi,

Apache documentation: Alias

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Dragos (---.workpage.ro)
Date: June 25, 2021 09:12PM

Ok Sir....im not a pro and for that i dont understand exactly what most do to work with 2 hdd...step by step...i understand this forum is not for beginners...so...consider this topic solved (for you)...will ask to another place...Sorry again...



Edited 1 time(s). Last edit at 06/25/2021 10:00PM by Dragos.

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Otomatic (Moderator)
Date: June 26, 2021 09:00AM

You did not read the link given and yet everything is explained there in a clear way and with examples.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Dragos (---.workpage.ro)
Date: June 26, 2021 10:02AM

Sorry Sir...but i'm noob,,,,i dont understand ....is strange language for me.....most have ftp server? where most write alias..????where most translate http link from website in internal path? i dont understand....but doesn't matter...is to hard for me...i read your link from A to Z but realy...i dont understand exactly what can i do...my link is [mysite.com]... my website are in c:/wamp64/www/mysite/... i need to send link on d:/movies/file.mp4 where in wamp most change? Sorry again....

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Otomatic (Moderator)
Date: June 26, 2021 12:33PM

Hi,

If you wait a bit, I'll post a bit more explanation.
Why "wait"? Because I never post an explanation that hasn't been duly verified in a real situation.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Otomatic (Moderator)
Date: June 26, 2021 01:58PM

Hi,

For what you want to do, i.e. from a local site located on disk C: to be able to load videos located on disk D:, we can consider that there are two possible solutions.
But in all cases, it is imperative to have defined the local site as VirtualHost, which in your case should be :
<VirtualHost *:80>
	ServerName mysite
	DocumentRoot "e:/wamp64/www/mysite"
	<Directory  "e:/wamp64/www/mysite/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>
Note: You replace the paths with your own, my Wampserver is on e:, not on c:

- The first solution is the use of an Alias.

An Alias with name "myvideos", when used in a link or a url, will be replaced by the path defined in this Alias
Alias should be:
Alias /myvideos d:/movies
<Directory "d:/movies">
	Options +Indexes +FollowSymLinks
	AllowOverride All
	Require local
</Directory>
This indicates that when the http protocol encounters "myvideos" in a path, it will be replaced by the actual path d:/movies.
If you are creating an Alias to a directory outside of your DocumentRoot, you may need to explicitly permit access to the target directory.

This code for the alias must be saved in a text file c:\wamp64\alias\myvideos.conf

In order for the VirtualHost and the alias to be taken into account, you must either restart Wampserver or Right-Click -> Refresh.

Now in a page of your local mysite site, the following code:
<video width='720' height='405' title='Test of video from an alias' poster='' controls>
  <source src='myvideos/file.mp4' type='video/mp4'>
</video>
will load the video file located at d:/movies/file.mp4

- The second solution is the use of jonction.
And, in this case there is no more need for Alias, so we must delete the file myvideos.conf
A jonction is a symbolic link that points to a folder outside its location and even to another disk.
A jonction causes the pointed folder to be seen as being located in the folder where the jonction is.

So, in the folder e:/wamp64/www/mysite, we will create a junction with the name "myvideos" pointing to d:\movies.
In a command window launched "As administrator" (The word administrator must be in the title bar), let's position ourselves in the folder e:\wamp64\www\mysite then let's create the junction by the command mklink
C:\Windows\system32>cd /d e:\wamp64\www\mysite

e:\wamp64\www\mysite>mklink /J myvideos d:\movies
Connection created for myvideos <<===>> d:\movies

Here also, after that, the code
<video width='720' height='405' title='Test of video from an alias' poster='' controls>
  <source src='myvideos/file.mp4' type='video/mp4'>
</video>
will load the video file located at d:/movies/file.mp4

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Run wampserver from 2 hdd
Posted by: Dragos (---.workpage.ro)
Date: June 26, 2021 02:59PM

Thank You very much ...Best of the best

Options: ReplyQuote


Sorry, only registered users may post in this forum.