Moving www folder to a network path while keeping WAMP on C drive
Posted by: shedrock (---.dsl.bell.ca)
Date: January 24, 2022 02:56AM

Is it possible to have WAMP installed on my C: drive as it is now, but have the WWW folder on my network path? For example \\MYNETWORK\Website\.

Thanks in advance,

Shedrock

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: Otomatic (Moderator)
Date: January 24, 2022 09:19AM

Hi,

You have to use the VirtualHost, as with all hosts, and your local sites can be somewhere else than in wamp(64)/www/.

See :
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

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: shedrock (---.dsl.bell.ca)
Date: January 24, 2022 03:41PM

I can't really find the answer in those posts for what I am trying to accomplish.

At present, I have WAMP installed on C:\wamp64. My website is local only and I am using a static IP address (192.168.0.144). I would just like the www folder over on my network path where I have more space. So for example, this is where I want the path for the www folder.

\\BBOXII\Website\. How do I add that path? Do I add it to httpd-vhosts.conf? Sorry, it is just very confusing. I apologize if the links you posted has these specific instructions, but I really can't find it.

Regards,

Shedrock

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: Otomatic (Moderator)
Date: January 24, 2022 05:47PM

Hi,

You need to modify all VirtualHost in httpd-vhosts.conf like mine that is on a NAS
<VirtualHost *:80>
   ServerName photos-famille
   DocumentRoot "//DS218/home/sites/photos-ottello"
  <Directory "//DS218/home/sites/photos-ottello/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride all
    Require local
  </Directory>
</VirtualHost>
But there will be an error in apache_error.log
AH00526: Syntax error on line 151 of E:/wamp64/bin/apache/apache2.4.52a/conf/extra/httpd-vhosts.conf:
DocumentRoot must be a directory

Why?

The wampapache64 service on computer must be launched with the admin account and not the local system account.
So, leave Wampserver, services manager, wampapache64 service, properties, connection tab:
-This account radio button
- Browse, Advanced, Search, validate the administrator account (in this case dominique DOMI) - Attention not the account marked Administrator).
- OK twice
- Fill in the Password and Confirm Password fields correctly
- Apply, then OK
Note: This is a translation of the terms I see on my French Windows. They may not be those terms on an English Windows.

Start Wampserver
To check that the wampapache64 service is no longer LocalSystem, Right-click -> Tools -> Check Service Status and you should see that it is no longer LocalSystem for Apache:
State of services:
 The service 'wampapache64' is started
 Service Session : .\dominique
 The service 'wampmysqld64' is started
 Service Session : LocalSystem
 The service 'wampmariadb64' is started
 Service Session : LocalSystem
	all services are started - it is OK
	all services BINARY_PATH_NAME are OK

For several sites in the same folder, it is possible to define an Apache variable at the beginning of the httpd-vhosts.conf file, for example
Define NETSITE "//DS218/home/sites/"
In your case
Define NETSITE "//BBOXII/Website/"
Then modify httpd-vhosts.conf with
<VirtualHost *:80>
   ServerName photos-famille
   DocumentRoot "${NETSITE}photos-ottello"
  <Directory "${NETSITE}photos-ottello/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride all
    Require local
  </Directory>
</VirtualHost>

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

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: shedrock (---.dsl.bell.ca)
Date: January 24, 2022 06:23PM

I've done that but when I try to start the service with the administrator credentials, I get the following error:


Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: Otomatic (Moderator)
Date: January 24, 2022 06:50PM

Hi,

This is out of my area of expertise.

I have indicated what works for me.

For the wampapache64 service I have :



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

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: shedrock (---.dsl.bell.ca)
Date: January 24, 2022 07:47PM

Yes, that's where I changed mine as well, but it does not want to start when I try. I get the resulting error as shown in my previous post, so I'm lost as to what I can do to fix it. I have used that same method with other programs such as Sonarr etc. and they always work with the Administrator's account credentials.

Regards,

Shedrock

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: Otomatic (Moderator)
Date: January 24, 2022 08:11PM

Hi,

> but it does not want to start when I try

See apache_error.log

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

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: shedrock (---.dsl.bell.ca)
Date: January 24, 2022 08:14PM

ok, so I think I got it to work as far as starting the service using the admin credentials. What I do not understand is how do I access the website via my browser.

This is what my virtual host file looks like:

<VirtualHost *:80>
   ServerName famphotos
   DocumentRoot "//BBOXII/One_Share/www"
  <Directory "//BBOXII/One_Share/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride all
    Require local
  </Directory>
</VirtualHost>



Edited 1 time(s). Last edit at 01/24/2022 08:15PM by shedrock.

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: RiggsFolly (Moderator)
Date: January 24, 2022 08:20PM

by using
http://famphotos
in the browser address bar

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 01/24/2022 10:59PM by RiggsFolly.

Re: Moving www folder to a network path while keeping WAMP on C drive
Posted by: shedrock (---.dsl.bell.ca)
Date: January 24, 2022 10:19PM

RiggsFolly Wrote:
-------------------------------------------------------
> by using `[famphotos]` in the browser address
> bar

Well, that didn't work for me. However, I used my local IP address, and I think it worked because in my httpd.conf file, I have it listening to the that address/port. It appears to be working from all my other PC's by adding the following to the httpd-vhosts.conf

Require all granted

Anyway, I am going to move my actual photo site to the shared drive and hopefully all goes well.

Thank you so much for your assistance. It was greatly appreciated.

Regards,

Shedrock

Sorry, only registered users may post in this forum.