Change Wamp document root folder to secondary hard drive
Posted by: mycdnprince (---.lb.shawcable.net)
Date: September 04, 2022 04:10PM

My secondary drive is F:

What would I need to put here to solve my issue:

DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">

Simple, I'm sure, but everything I've tried has not worked.

Any assistance here would certainly be appreciated.

Thanks,
John

Re: Change Wamp document root folder to secondary hard drive
Posted by: Otomatic (Moderator)
Date: September 04, 2022 06:03PM

> What would I need to put here to solve my issue:

I don't understand what your problem is!

Your local sites can be located anywhere, even on another partition or disk.

VirtualHosts allow this without any problem and the DocumentRoot of each VirtualHost can be different.

See:
The need for Virtual Host
and
Wampserver 3 - Create or add a VirtualHost

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

Re: Change Wamp document root folder to secondary hard drive
Posted by: mycdnprince (---.lb.shawcable.net)
Date: September 04, 2022 07:45PM

All very fine for you to say there's no problem but would you be so kind, if you can, as to fill in the following with an example bearing in mind Wamp being on c: drive on one disk and document root being on F: drive on a secondary disk:

DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">

Place your answer here:

Re: Change Wamp document root folder to secondary hard drive
Posted by: Otomatic (Moderator)
Date: September 05, 2022 08:42AM

DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Is a part of the VirtualHost localhost in the file httpd-vhosts.conf
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>
And must remain as is and not be modified.

If you had read the two links I gave you earlier you would have seen that you can add as many VirtualHost as you need with locations anywhere.

For example:
<VirtualHost *:80>
  ServerName my-site-one
  DocumentRoot "F:/myfolderone"
  <Directory "F:/myfolderone/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>
#
<VirtualHost *:80>
  ServerName my-site-two
  DocumentRoot "F:/www/myfoldertwo"
  <Directory "F:/www/myfoldertwo/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

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

Re: Change Wamp document root folder to secondary hard drive
Posted by: mycdnprince (---.lb.shawcable.net)
Date: September 05, 2022 08:00PM

Otomatic,

Thank you for your assistance. It turns out I was doing exactly as you described and as your links pointed out but had an error relating to my databases that was unrelated to my query i.e. I was fishing up the wrong stream. Sorry for having troubled you.

Best,
John

Sorry, only registered users may post in this forum.