Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

  1. #1
    Join Date
    Jun 2005
    Beans
    64

    Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    I've read quite a few tutorials of setting up named virtual hosts, but I am stumped.

    Info:
    - Ubuntu Server 8.04
    - Apache2 running successfully
    - want to host multiple sites w/ different domains
    - /var/www/site1 , /var/www/site2, etc
    - sitting behind a dynamic IP cable connection
    - using a dyndns domain to address the external IP from outside

    So I'd like if someone on web goes to http://site1.com, it goes to mysite.dyndns.org, which goes to my router, which forwards to the web server, which detects site1.com and serves that directory.

    What I am having trouble figuring out is if I am using dyndns, how does Apache know which domain to serve up? I am thinking the solution may lie with domain DNS - have a record to point site1.com to mysite.dyndns.org. Would this be a CNAME? A record?

    My ignorance is apparent...

    Any ideas?

    Thanks

  2. #2
    Join Date
    Jun 2005
    Beans
    64

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    Ah, I am thinking maybe the easiest solution is to cut out dyndns and use Custom DNS (which dynamically updates the actual domain name), which should pass the specific domain name, not mysite.dyndns.org

    Thoughts?

  3. #3
    Join Date
    Jun 2005
    Beans
    64

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    Custom DNS won't be an option, too expensive for 3 domains...

  4. #4
    Join Date
    Apr 2008
    Beans
    90

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    I've never done it myself, but can you setup three domains with DynDNS and use each one of them for your site? All three would resolve to your home server:

    site1.com -> site1.dyndns.net \
    site2.com -> site2.dyndns.net - server
    site3.com -> site3.dyndns.net /

    Then you can separate the requests at your server.

  5. #5
    Join Date
    Jun 2005
    Beans
    64

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    That's an idea, probably tricky though, since I imagine it would require running 3 separate ddns clients.

    And I guess this is all moot until I can get ONE domain working. Been wrestling with virtualhosts all day...

    Thanks for the repsonse

  6. #6
    Join Date
    Apr 2008
    Beans
    90

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    I like Linux because in 99 cases out of 100, somebody already had the same probem, solved it and posted his solition online

    Here's a script for you to update your DynDNS record:
    http://nick.borko.org/update-dyndns

    Make three copies of the script, each with its own logins to match your domains. Then just create a cron job to run them, say once a day to be safe, and viola - your domain redirection system is up and running

    No other DynDNS clients are needed in this case, of course.

    PS: I never used the script myself, I just googled for it. If it doesn't work, try finding another one.
    Last edited by osjak; July 7th, 2008 at 07:42 AM.

  7. #7
    Join Date
    May 2007
    Location
    Phoenix, Arizona USA
    Beans
    2,909
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    IMHO this is like holding your car together with chicken wire and chewing gum. Static IPs are fairly easy to get these days and pretty cheap. I only pay $4.95 a month extra for mine and as an added bonus, I get no ports blocked. Unless you absolutely can't get one even by changing ISPs, I would not use dynamic dns, at least on production boxes for sure.

    -Tim
    www.pcchopshop.net

    Hard to find and obsolete PC and server parts. "If we can't find it, it probably doesn't exist"

  8. #8
    Join Date
    Feb 2008
    Beans
    179

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    That's why I didn't go with DynDNS. Go with zoneedit.com and you don't have the subdomain crap to deal with.

    Name based virtual hosts is basic to set up (at least it was on my 8.04 server). Simply make a host file for each site in the sites-available directory, and then symlink to it. If you don't know what to put in the host file, take a look through the forum and you will see plenty of examples.

    Here is an example of one I am running right now:

    Code:
    <VirtualHost *>
    	ServerName www.bigdomain.com
            ServerAlias bigdomain.com	
    	DocumentRoot /var/www/bigdomain
    	<Directory /var/www/bigdomain>
    		Options -Indexes FollowSymLinks MultiViews
    		AllowOverride All
    		Order allow,deny
    		allow from all
    	</Directory>
    	ErrorLog /var/log/apache2/bigdomain-error.log
    </VirtualHost>
    Make your symlink, add the /var/www/bigdomain directory, restart apache, and put your index.htm file in /var/www/bigdomain to test it out.

    This is literally all I had to do to get name based virtual hosts working.

    Side note: I made sure to use -Indexes in the /sites-available/default file so that the www directory was no longer indexed, but this isn't necessary to get name based virtual hosting working.

  9. #9
    Join Date
    Apr 2008
    Beans
    90

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    Quote Originally Posted by windependence View Post
    IMHO this is like holding your car together with chicken wire and chewing gum. Static IPs are fairly easy to get these days and pretty cheap. I only pay $4.95 a month extra for mine and as an added bonus, I get no ports blocked. Unless you absolutely can't get one even by changing ISPs, I would not use dynamic dns, at least on production boxes for sure.

    -Tim
    You are totally right, Tim. But hey, if a person wants to experiment, why not? If I'm understanding correctly, those are not going to be production sites. This is a hobby project. I am actually interested how well such system will work for the OP.

    On the other side, if a better reliability is desired, I would suggest buying some shared web hosting plan and setting up sites there. This way, you get your websites running independently of your home server experiments. You can get somewhat acceptable shared hosting for $3 - $8 per month.

    I'm just not a big fan of home based web servers. When I fire up my torrent client, there's no way my upstream connection is going to be enough for a half-sane person to browse my home-based website. I have a home server for experimenting purposes, but my hobbiest websites are on a shared plan with a hosting company. I also use that hosting for offsite backups of my desktop documents.

  10. #10
    Join Date
    May 2007
    Location
    Phoenix, Arizona USA
    Beans
    2,909
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Ubuntu Server > Apache2 Virtual Hosts > DYNDNS

    Quote Originally Posted by osjak View Post
    You are totally right, Tim. But hey, if a person wants to experiment, why not? If I'm understanding correctly, those are not going to be production sites. This is a hobby project. I am actually interested how well such system will work for the OP.

    On the other side, if a better reliability is desired, I would suggest buying some shared web hosting plan and setting up sites there. This way, you get your websites running independently of your home server experiments. You can get somewhat acceptable shared hosting for $3 - $8 per month.

    I'm just not a big fan of home based web servers. When I fire up my torrent client, there's no way my upstream connection is going to be enough for a half-sane person to browse my home-based website. I have a home server for experimenting purposes, but my hobbiest websites are on a shared plan with a hosting company. I also use that hosting for offsite backups of my desktop documents.
    The problem is, when you are trying to do things like virtual hosting, a redirect is going to get in your way most of the time depending on how it is done. Many people are also not aware that they can get a static IP just by asking their ISP for it. There are also ISPs like SpeakEasy which do not block ports and offer static IP connections in most areas.

    I serve a site from my home that gets 13,000 page views per day and over 5 million hits per month. I try to limit any downloading to the overnight hours but there have been times when I had to do it and I have had no issues with bandwidth, in fact, I am only using a small fraction of the bandwidth I have. Also, with the proper gateway box, you can limit certain traffic and certain connections to a predetermined amount of bandwidth, also a good learning experience BTW. I just see so many people deviling themselves with this dynamic crap when they really don't have to go through all that pain.

    -Tim
    www.pcchopshop.net

    Hard to find and obsolete PC and server parts. "If we can't find it, it probably doesn't exist"

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •