Page 2 of 2

Re: vitualhost and name based site problem

PostPosted: 31. July 2012 17:07
by ravpxl
Thanks for the followup.

I was going to look at the security issue next, I just wanted to see if I could get this to work on the network, so I followed the set up specified by sharley above.
To clarify things for myself, and possibly anyone else that may come across this, it's best not to have to have mydomainfolder set up in the htdocs folder, but somewhere outside of that,
something like c:/projects/mydomainfolder?

As far as the host file, I do only have the 192.168.nn.nnn mydomainfolder.local line in the host file where I have the xampp install.
So, basically what your saying, is that if I want multiple people on the internal network to access the site I create via vanity url like http://mydomainfolder.local, i'll have to update every pc's host file and add
that one line of code, otherwise they will have to use the ip address?

I kind of get it, but it defeats the purpose of facilitating access to other users, if I have to update all their host files.

if this is the case, do you know of any other options I might have, or an alternate set up?

I appreciate the feedback, or any links/blog post you might know of.

Thanks again

Re: vitualhost and name based site problem

PostPosted: 31. July 2012 19:30
by Altrea
Hi ravpxl,

ravpxl wrote:To clarify things for myself, and possibly anyone else that may come across this, it's best not to have to have mydomainfolder set up in the htdocs folder, but somewhere outside of that,
something like c:/projects/mydomainfolder?

Not exactly. The best way to organize things for me is to have one unique directory per application and one (sub-)domain for each application which is routed directly in this specific application folder.
My servers are organized something like this, but it is fully up to you:
Code: Select all
- /htcocs
--- /domain1.com
----- some folders/files outside documentroot
----- /public_html <--DocumentRoot
------- /css
------- /js
------- other asset folders
------- /.htaccess
------- /index.php
--- /domain2.com
----- some folders/files outside documentroot
----- /public_html <--DocumentRoot
------- /css
------- /js
------- other asset folders
------- /.htaccess
------- /index.php

you can have it inside your htdocs or outside. It doesn't matter.
It depends all on your DocumentRoot setting

ravpxl wrote:So, basically what your saying, is that if I want multiple people on the internal network to access the site I create via vanity url like http://mydomainfolder.local, i'll have to update every pc's host file and add
that one line of code, otherwise they will have to use the ip address?

correct.

ravpxl wrote:if this is the case, do you know of any other options I might have, or an alternate set up?

You could use a DNS Server in your network for url name translation. But this DNS Server needs to be known by any client too.

best wishes,
Altrea