Changing root directory, preserving localhost interface
Posted by: Fatbat (---.red-81-40-157.staticip.rima-tde.net)
Date: November 12, 2020 01:28PM

Server's installed, everything is working. So my install is in the default C:/wamp64/ location and my projects folder lives at G:/Dropbox/www. I have tried both creating a virtual host for this, and I've also altered the localhost DocumentRoot and Directory in httpd-vhost.conf with reasonable results.

However, there use to be a way to both alter the localhost location and preserve the nice WAMP localhost interface with the projects directory populated, instead of an ugly default directory listing, by copying the files from C:/wamp64/www to your own www folder. This only kind of works now, the index file loads, but with a lot of PHP errors displayed. The documented methods to make this work don't seem to work anymore.

Is this still possible to achieve or should I just give up?

Options: ReplyQuote
Re: Changing root directory, preserving localhost interface
Posted by: Otomatic (Moderator)
Date: November 12, 2020 01:43PM

Hi,

> I've also altered the localhost DocumentRoot and Directory
The VirtualHost localhost must never be modified and must remain :
<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>
It is the DocumentRoot and <Directory of your own VirtualHost that should reflect the folders they are in, these folders can be anywhere.

Read or reread:
The need for Virtual Host
and
Wampserver 3 - Create or add a VirtualHost
and
Why to create a VirtualHost BEFORE installing a CMS

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.4 32 bit - Apache 2.4.46a - PHP 8.0.0…5.6.40 - MySQL 5.7.32 - MariaDB 10.5.8
Wampserver 3.2.4 64 bit - Apache 2.4.46a - PHP 8.0.0…5.6.40 - MySQL 5.7.32/8.0.22 - MariaDB 10.5.8
PhPMyadmin 5.0.4 - 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


Sorry, only registered users may post in this forum.