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

Options: ReplyQuote
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

------------------------------------------------------------------------------------------------------------
Wampserver 3.3.0 32 bit - Apache 2.4.54.2 - PHP 8.2.0…5.6.40 - MySQL 5.7.39 - MariaDB 10.5.13/10.6.5
Wampserver 3.3.0 64 bit - Apache 2.4.54.2 - PHP 8.2.0…5.6.40 - MySQL 5.7.39/8.0.30 - MariaDB 10.5.17/10.9.2
PhPMyadmin 5.2.0 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
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:

Options: ReplyQuote
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>

------------------------------------------------------------------------------------------------------------
Wampserver 3.3.0 32 bit - Apache 2.4.54.2 - PHP 8.2.0…5.6.40 - MySQL 5.7.39 - MariaDB 10.5.13/10.6.5
Wampserver 3.3.0 64 bit - Apache 2.4.54.2 - PHP 8.2.0…5.6.40 - MySQL 5.7.39/8.0.30 - MariaDB 10.5.17/10.9.2
PhPMyadmin 5.2.0 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
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

Options: ReplyQuote


Sorry, only registered users may post in this forum.