James,

> > Nope, I run Gallery too and it all works.  I can upload internally to
> > the server just by having the entry in /etc/hosts.  The answer is so
> > simple and it works very well.  No need for "internal" and "external"
> > views in DNS - been there, done that and it is too complex for a lot of
> > people.  Mind you - I do run a name based virtual apache server but
> > without any hacks, the /etc/hosts works for ALL of my hosted sites.
> >
> > Anyway, we could argue forever but one line in the hosts file will tell
> > the user whether it works or not.  No big deal - no wasted energy if it
> > doesn't.
> >
> Rick
> I'm jelous (wow that spelling looks gruk) I could not get internal/external 
> gallery albums to work. I agree it's a pain, but I could not do it without 
> views.
> How do you get your named virtual hosts to resolve. Is the http server in the 
> DMZ?

No, the server is NATed behind a DLink router with firewalling.

> I am using virtual-server on a dlink 604T. It requests 192.168.5.254 and 
> every 
> request gets the same page. It worked fine with bridged ADSL.
> 
> In that scenario do you have a /etc/hosts entry for every www page?
> I guess my issue is that I also run the DNS for all the sites and the order 
> is 
> probably DNS, files not the other way round.

I run DNS for all of my sites too.  I only use the /etc/hosts entry so
that I can a) get to and update my own site and those that people want
me to adjust and b) so that I can check that all sites are functioning
as they should.  I had one defaced a few years ago and make it my policy
to view each site at least once per day.  Fortunately, I am only a small
hoster.  My take on the functionality of /etc/hosts is that the file
points the browser to the local server (internally) and then the
Vhosts.conf file points it to the right folder.  I take it that you use
the Vhosts.conf file that is part of Apache.

I have A records for all of my sites as well so I have to have two
entries per site in Vhosts.conf eg

NameVirtualHost 192.xxx.xxx.xxx:80
<VirtualHost 192.xxx.xxx.xxx:80>
ServerName www.something.org
ServerPath /something
DocumentRoot /var/www/html/something.org
</VirtualHost>

NameVirtualHost 192.xxx.xxx.xxx:80
<VirtualHost 192.xxx.xxx.xxx:80>
ServerName something.org
ServerPath /something
DocumentRoot /var/www/html/something.org
</VirtualHost>

This means that on my /etc/hosts file I can have a line which has -

192.xxx.xxx.xxx  www.something.org  something.org

Whichever URL I then use in the browser will then resolve (internally)
to the correct web page.  Neither DNS nor DNS views are required in this
situation.

I can also add for instance another line which has -

203.xxx.xxx.xxx  anothersite  www.anothersite.com

I can then simply type "anothersite" in my web browser and it instantly
resolves to an outside web page.  I often use this trick to provide me
with a shorthand to my favourite sites especially those that are only IP
based and don't have an URL.  I hasten to add that there is nothing
shonky about these site - I administer a couple of educational sites
which are largely accessed from internal desktops but which do have
external connectivity.  I work for a government department which does
not allow us to register URLs.

In this case I have an entry which just has -

203.xxx.xxx.xxx  anothersite

I love /etc/hosts

Rick

> 
> Cheers
> James
> 
-- 
Suncoast Technical
Ph 040 888 53 57
http://www.suntech.net.au

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to