VHOST on NAS
Posted by: FGNeurieser (194.76.180.---)
Date: July 08, 2016 08:07AM

Hello all,

I've installed wamp on C:\wamp64, enabled the VitualHosts sub-menu and tried to create a VHost via the GUI.

Name of the Virtual Host: carlifting.loc

Complete absolute path: //HEJAFR/web/develop/carlifting.loc/work/internet/

Then I hit the Button 'Start the creation of the VirtualHost. But I always get the message: /HEJAFR/web/develop/carlifting.loc/work/internet/ does not exists or is not a directory.

Next I tried to use the Network drive as complete absolute path: w:/develop/carlifting.loc/work/internet/ with the same result.

Could anyone explain why this is not working?

In XAMPP I used the same configuration as in the first variant and it worked fine.

Regards and thanks
Franz-Georg

PS: in the hosts the entries are set correct



Edited 1 time(s). Last edit at 07/08/2016 08:59AM by FGNeurieser.

Options: ReplyQuote
Re: VHOST on NAS
Posted by: Otomatic (Moderator)
Date: July 08, 2016 10:21AM

Hi,

I use IP of NAS, not name or drive letter, for example :
<Directory "//192.168.0.11/Public/sites/photos-ottello/">
but... there is a little bug in wamp\www\add_vhost.php (even with 3.0.5) that replace double slash '//' with single slash '/'

After line 245 that is:
	$vh_folder = strtolower($vh_folder);
add
	//3.0.6 - Check / at first character
	if(substr($vh_folder,0,1) == "/" && substr($vh_folder,0,2) != "//" )
		$vh_folder = "/".$vh_folder;

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

Options: ReplyQuote
Re: VHOST on NAS
Posted by: FGNeurieser (194.76.180.---)
Date: July 08, 2016 10:51AM

Hello,

thanks for the hints, I did the changes and tried it with the IP of my NAS but get the same answer: //192.168.0.101/web/develop/carlifting.loc/work/internet/ does not exist or ist not a directory.

Any other hint why it doesn't work?

Best regards
Franz-Georg

Options: ReplyQuote
Re: VHOST on NAS
Posted by: Otomatic (Moderator)
Date: July 08, 2016 11:11AM

Hi,

> Any other hint why it doesn't work?
It works for me.

It is only the result of PHP function is_dir :
	elseif((!file_exists($vh_folder) || !is_dir($vh_folder))) {
		$message[] = '<p class="warning">'.sprintf($langues['DirNotExists'],$vh_folder).'</p>';
		$errors = true;
	}

You can try to manually add this VirtualHost in
wamp\bin\apache\apache{apche version used}\conf\extra\httpd-vhosts.conf, for example :
<VirtualHost *:80>
   ServerName carlifting.loc
   DocumentRoot //192.168.0.101/web/develop/carlifting.loc/work/internet
  <Directory "//192.168.0.101/web/develop/carlifting.loc/work/internet/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride all
    Require local
  </Directory>
</VirtualHost>

Then carlifting.doc in hosts file
Then :
- Right-Clic -> Tools -> Restart DNS

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

Options: ReplyQuote
Re: VHOST on NAS
Posted by: Otomatic (Moderator)
Date: July 09, 2016 03:03PM

Hi,

For my local site that works fine located into my NAS :
<Directory "//192.168.0.11/Public/sites/photos-ottello/">
in the settings of the NAS, I have for the folder Public : shared and public
That correspond to the UNC notation:

\\NameORIp\SharedName\Folder\[Folder2...\FolderX\][File]

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.