logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: trouble accessing vhosts on static ip
Author
barathrum



Joined: 06 Aug 2007
Posts: 8

PostPosted: Sat 05 Dec '09 1:04    Post subject: trouble accessing vhosts on static ip Reply with quote

hi everyone,
this has been giving me a bad headache. i browsed so many guides and websites but none seem to work really.

right now i use this in my httpd-vhosts.conf:

Code:
<VirtualHost *>
   DocumentRoot C:\www\videos
   ServerName vids.wan-ip
   ServerAlias vids.wan-ip
</VirtualHost>

<VirtualHost *>
   DocumentRoot C:\www\pictures
   ServerName pics.wan-ip
   ServerAlias pics.wan-ip
</VirtualHost>


then in my host file i have this:

Code:
192.168.0.2 vids.wan-ip
192.168.0.2 pics.wan-ip


so now when i type vids.wan-ip into my brother it leads me to the videos folder. when i type in pics.wan-ip it also leads me to the videos folder.

the other issue is, when i want to try to access it from the outside using a proxy, it doesn't work at all. both don't work.

can someone please help me with this? it's becoming quite frustrating.

thanks in advance everyone
Back to top
itproxy



Joined: 17 Jan 2009
Posts: 14

PostPosted: Sat 05 Dec '09 16:45    Post subject: Reply with quote

Hi, barathrum,
Not sure I understand your problem. Isn't it a DNS issue? What mechanism exists on the internet (equivalent to your internal hosts file) to point 'http://vids.wan-ip' or 'http://pics.wan-ip' to (your) wan-ip (address)?
Back to top
barathrum



Joined: 06 Aug 2007
Posts: 8

PostPosted: Sat 05 Dec '09 17:26    Post subject: Reply with quote

hi itproxy,
i'm not too sure really.. can't you bypass all the DNS related stuff if you access the IP address directly from your browser on port 80(defualt)?

sorry if i'm mistaking something here :/
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 05 Dec '09 17:29    Post subject: Reply with quote

yeah, you need DNS for accessing vhosts from outside

also, add one more vhost above those two, make it a minimal copy of your main (or existing) host from httpd.conf.

If the DocumentRoot in httpd.conf was for example C:/Apache2/htdocs then the first vhost should look like

NameVirtualHost *:80

<VirtualHost _default_:80>
DocumentRoot C:/Apache2/htdocs
</VirtualHost>

then those you posted below it. It's mentioned in the docs for name-based vhosts under the heading "Main Host Goes Away" and is the most commonly missed item when setting up vhosts for the first time, so your not alone. Worse is, they do not really show an example anywhere.

http://httpd.apache.org/docs/2.2/vhosts/name-based.html
Back to top
barathrum



Joined: 06 Aug 2007
Posts: 8

PostPosted: Sat 05 Dec '09 17:49    Post subject: Reply with quote

hi glsmith,

after reading both your responses, am i correct in assuming that i have to relay on an online service so that others can access my vhosts? like dyndns or no-ip?

if that's the case, could you suggest a good, free one for me? i know dyndns and no-ip offer those wildcard functions, but it'd be nice to get something free for the first time before moving on to paid services.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 05 Dec '09 18:16    Post subject: Reply with quote

Yes and no, yes in either of those two services will work for you and both are free. yourname.dyndns.net or yourname.no-ip-org. I have no particular love or hate for either of them. There's many out there similar.

Afraid.Org, ChangeIP, DtDNS, Microtech, Sitelutions, StaticCling, YI.Org

No in that it's not relaying anything really. Hopefully short and sweet,

People do not remember numbers to well, especially IP addresses.
Computers do not use the names but IPs. Something needs to be in the middle to convert name to IP, so we have DNS for that.

You type www.yourname.com in your browser and what happens in the background is your computer contacts a DNS server, it tells your computer what the ip is that matches your domain name, your browser then goes to the IP address and includes the name in the 'host header', which Apache then uses to figure out the proper host for the name.

Wildcard mean anthing.yourname.dyndns.net for example where the anything can be just that, and it will also go to your IP.

yourname.dyndns.net
joe.yourname.dyndns.net
sue.yourname.dyndns.net

all will get there.

Quote:
can't you bypass all the DNS related stuff if you access the IP address directly from your browser


Yes BUT, then there is nothing to determine which site to serve, unless it's

http://xxx.xxx.xxx.xxx/joe
http://xxx.xxx.xxx.xxx/sue
etc. and you will not be using vhosts for a config like this cause everything will be a branch (or Alias) off the main host or using UserDir's which would end up like
http://xxx.xxx.xxx.xxx/~joe
http://xxx.xxx.xxx.xxx/~sue


Last edited by glsmith on Sat 05 Dec '09 21:05; edited 3 times in total
Back to top
itproxy



Joined: 17 Jan 2009
Posts: 14

PostPosted: Sat 05 Dec '09 18:42    Post subject: Reply with quote

I've used No-IP and DynDNS in the past for free dynamic DNS services, while learning about web hosting; you have to put up with slightly sub-optimal domain names, but it is free! I now have a static ip address, but use both as (paid-for) domain registrars (don't put all your eggs in one basket!). Used to prefer No-IP, they did have brilliant help files, though they're a mess currently; DynDNS help files are vastly superior, you can learn a lot about the whole DNS 'thing' from them. No-IP basic domain registration includes DNS service; DynDNS basic domain registration does not. ( I run my own simple 'authoritative' DNS server for my domains, so that's not a problem for me.)
GoDaddy (who I also use as a paid-for registrar) is another possibility, with an in-your-face "pile 'em high, sell 'em cheap" approach, often discounting the normal cost of domain registration (typically $15 py for eg .org or .net domains) but pester you to register lots of domains at these prices, with extra bulk discounts.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 05 Dec '09 21:23    Post subject: Reply with quote

itproxy wrote:
DynDNS basic domain registration does not.


Huh? You mean DNS for a real honest to gosh domain name? ok, but even though domains are cheap, they are not "Free" (tho I did get one for free back in 2000). I'm trying to stick to free as the OP asked.

I have a dyndns address, and no-ip (3utilities.com), actually one at all the ones mentioned in this thread but Sitelutions, I have a real domain there.
Back to top
itproxy



Joined: 17 Jan 2009
Posts: 14

PostPosted: Sat 05 Dec '09 22:07    Post subject: Reply with quote

I buy services from DynDNS and No-IP now, because they provided me with a good service over a number of years for free; I learnt to trust them. (Though No-IP are not as good as they were, a result, no doubt, of their becoming part of a bigger organisation, a phenomenon constantly repeated in my internet experience.)
There's lots of organisations that seem to operate differently; to provide you with a poor experience for free, but promise you better if you pay. I've learnt to avoid them like the plague!
I'm an open source/free software devotee, and I'm in the happy position of being able to do everything I want IT-wise, without paying for it, with four exceptions:
01. Buying the hardware
02. Paying Microsoft for operating systems. (Linux, of which I have a great deal of experince, is a joke; great if you enjoy an intellectual challenge, but you have to be a geek to do the simplest things.)
03. Photo management: I've yet to find a decent replacement for ACDSee
04. Domains: if you want to call your domain 'somevariantof.someodddomain.com', fine (and it's a good idea while you're experimenting); but there may come a time when you want to create a separate identity, something barathrum is clearly anticipating, and which I was addressing.
Oh dear, this looks like another of those forums where the powers-that-be think it's their role to rubbish the contributions of others, so that it isn't a 'forum' in a genuine sense, but where 'newbies' can only get advice from self-appointed 'experts'. I was wondering why so many posts went unanswered, if they weren't answered by the 'experts'; I guess other users have learnt to fear to put in their tuppence-worth, for fear of being sneered at.
Goodbye. This is my last post.
Back to top
barathrum



Joined: 06 Aug 2007
Posts: 8

PostPosted: Sat 05 Dec '09 22:25    Post subject: Reply with quote

thanks for the information everyone, it helped me a lot.

itproxy: i don't think anyone was trying to go against you, no need to react offended like that Shocked
Back to top


Reply to topic   Topic: trouble accessing vhosts on static ip View previous topic :: View next topic
Post new topic   Forum Index -> Apache