Results 1 to 5 of 5

Thread: [SOLVED] Apache Configuration

  1. #1
    Join Date
    Sep 2005
    Location
    Northfleet, Kent, UK
    Beans
    346
    Distro
    Ubuntu 11.04 Natty Narwhal

    [SOLVED] Apache Configuration

    Hello folks.

    Bit of a newbie when it comes to apache here. Running apache2 on ubuntu.

    I have 2 subdomains: sub1.beercz.com and sub2.beercz.com say.

    My ISP has my top level domain (beercz.com), and can forward all web requests to my server, via port mapping on my router. That is all done.

    I have set up two websites, one for each domain, the locations of each site is as follows:

    /home/websites/sub1
    /home/websites/sub2

    What I am trying to achieve is to for a user who wants to go to http://sub1.beercz.com pick up the site in /home/websites/sub1, and simililary if another user wants to go to http://sub2.beercz.com be directed to the site in /home/websites/sub2

    I think this is a configuration issue within apache2. Can someone offer guidance as to how I can achieve this.

    Thanks in advance.

  2. #2
    Join Date
    Oct 2007
    Location
    Belgium
    Beans
    146
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Apache Configuration

    hi,

    you might want to check that your subdomains are correct:

    here is a little tutorial:
    http://thinkingnectar.com/2008/getti...-in-localhost/

  3. #3
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,868
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Apache Configuration

    What you need to do is setup virtual hosts for each sub domain. You can read up on virtual hosting, in the meantime this will get you started.

    You need to create the .conf file for each sub domain and edit it.

    then disable the default, and enable the two new subdomains in sites-enabled. If you will be running other sites, without the subdomain, ie: beercz.com, or www.beercz.com, you will also want to create virtual hosts for them as well.

    This can all be done in a terminal or webmin.

    One how-to I followed also had me edit /etc/hosts and add all my subdomains listed with 127.0.0.1. I am not sure if it is required.

    http://www.debian-administration.org/articles/412

    I just went trough this, post #3 has several links.

    http://ubuntuforums.org/showthread.p...e+virtual+host
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  4. #4
    Join Date
    Jun 2008
    Location
    Nottingham, uk
    Beans
    48
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Apache Configuration

    Quote Originally Posted by volkswagner View Post

    One how-to I followed also had me edit /etc/hosts and add all my subdomains listed with 127.0.0.1. I am not sure if it is required.

    http://www.debian-administration.org/articles/412
    I followed the same tutorial + a couple of others and didn't need to add any entries to my /etc/hosts file to get my sites up and running.

    Hope this helps,
    Steve.

  5. #5
    Join Date
    Sep 2005
    Location
    Northfleet, Kent, UK
    Beans
    346
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: [SOLVED] Apache Configuration

    All sorted now and my knowledge has increased.

    Thanks guys.

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
  •