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

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.