Skip to main content
Participating Frequently
June 30, 2011
Question

Local testing server root and web url

  • June 30, 2011
  • 1 reply
  • 1459 views

I would like to know if I have correctly set up my local testing server for the root folders. Very new to this.

Local site folder is at C:\xampp\htdocs\NIF\.

Test server folder is C:\xampp\htdocs\NIF\

Web URL is http://localhost/NIF/

Links are relative to document.

In case it matters, site is using ZenPhoto gallery.

I can see my index page's dynamic content in LiveView, but I'm not sure if I have the root paths correct.

Root of the online website is at http://natureinfocus.com/ with a gallery at http://natureinfocus.com/galleries

Currently an address in DW shows http://localhost/nif/galleries/ where the actual website would show http://natureinfocus.com/galleries/

I've put testing site root in a subfolder since I may have several sites.

Do I have this set up correctly or do I need to change soemthig since I've put the root in a subfolder?

Also wasn't sure if links should be set instead to relative to document or site root?

Thanks for any help.

This topic has been closed for replies.

1 reply

David_Powers
Inspiring
July 1, 2011

NaturalEnquirer wrote:

Do I have this set up correctly or do I need to change soemthig since I've put the root in a subfolder?

Also wasn't sure if links should be set instead to relative to document or site root?

Yes, it's set up correctly, as long as you use links relative to the document.

To set up your testing environment so that the site is not in a subfolder, you need to create a virtual host for each site. There are instructions on setting up virtual hosts on my website at http://foundationphp.com/tutorials/apache22_vhosts.php.

Participating Frequently
July 4, 2011

Thank you for your help with this! I've tried this once before about a year ago and gave up then. So started from scatch again (for the nth time)

I installed XAMPP in default directory on my PC at \xamp\

In DW, I have

Local site folder: C:\xampp\htdocs\nif\

Server folder : C:\xampp\htdocs\nif\

Web URL: http://localhost/nif/

Server Model: PHP/MySQL

Advanced settings:

Links relative to Document

Web URL: http://localhost/nif

So now my DW site should see the website root and all subfolders including the galleries folder. In LiveView I can view the index page of the galleries directory and its linked pages ok but I cannot view, for example \galleries\themes\zpmasonry\404.php. I get the An unknown error occurred while discovering dynamically related files.

Address bar shows  file:///c:\xampp\htdocs\nif\galleries/themes/zpmasonry/404.php and other address shows c:\xampp\htdocs\nif\galleries/themes/zpmasonry/404.php

I hope that the above error has to do with your suggested fix.

So I tried to modify the vhosts files as suggested in your directions, but then Apache will not start at all.

I expect my error is in the final step to specify the document and server roots?

I created c:\vhosts and c:\vhosts\nif\

In C:\windows\system32\drivers\etc\hosts  I added

127.0.0.1 nif

In c:\xampp\apache\conf\httpd.conf I uncommented the line you referred to

I expect my error is in the c:\xampp\apache\conf\extra\httpd-vhosts.conf

I think the line eVirtualHost *.80 was already uncommented (not sure now)

I added the Directory lines below that.

<Directory C:/vhosts>   Order Deny,Allow   Allow from all </Directory>

<VirtualHost *:80>

DocumentRoot c:/xampp/htdocs  

ServerName localhost

</VirtualHost>

<VirtualHost *:80>  

DocumentRoot c:/vhosts/nif  

ServerName nif</VirtualHost>

(I did reboot)

David_Powers
Inspiring
July 8, 2011
Please download the attached file to view this post