Results 1 to 5 of 5

Thread: Virtual Hosts

  1. #1
    Join Date
    Oct 2007
    Beans
    21

    Virtual Hosts

    I am running a ubuntu webserver apache2 on my company.

    And i wold like o user several virtual hosts.

    My server extruture:

    /var/www/forum1
    /var/www/forum2
    /var/www/fileman
    /var/www/website

    My computer (server) name is jednet.

    I wold like to use virtual hosts like:

    /var/www/forum1 = http://forum1 or http://forum1.jednet
    /var/www/forum2 = http://forum2 or http://forum2.jednet
    /var/www/fileman = http://fileman or http://fileman.jednet
    /var/www/website = http://jednet


    Is it possible?

    I found a lot of tutorials about virtual hosts, but all of them are about registered domains.

  2. #2
    Join Date
    Apr 2006
    Location
    Seattle
    Beans
    2,893
    Distro
    Ubuntu Development Release

    Re: Virtual Hosts

    You can set them up the same way as a VirtualHost with a TLD, but keep in mind they won't be visible at all to the rest of the world, just the server LAN. Which probably isn't much. If that's all right with you, here's a sample vhost config with a non-TLD domain:

    Code:
    <VirtualHost *>
            ServerName forum1
            ServerAlias forum1.jednet
            DocumentRoot /var/www/forum1
            
            [...]
    </VirtualHost>

  3. #3
    Join Date
    Oct 2007
    Beans
    21

    Re: Virtual Hosts

    Thats exactly what i whant, its just for my company, not for the www.

    So as you say, its possible to use:

    <VirtualHost *>
    ServerName forum1
    ServerAlias forum1.jednet
    DocumentRoot /var/www/forum1

    [...]
    </VirtualHost>

    or

    <VirtualHost *>
    ServerName forum1
    ServerAlias forum1
    DocumentRoot /var/www/forum1

    [...]
    </VirtualHost>

    Keep in mind that my server or host name is jednet.

  4. #4
    Join Date
    Apr 2006
    Location
    Seattle
    Beans
    2,893
    Distro
    Ubuntu Development Release

    Re: Virtual Hosts

    Quote Originally Posted by diasje View Post
    Thats exactly what i whant, its just for my company, not for the www.

    So as you say, its possible to use:

    <VirtualHost *>
    ServerName forum1
    ServerAlias forum1.jednet
    DocumentRoot /var/www/forum1

    [...]
    </VirtualHost>

    or

    <VirtualHost *>
    ServerName forum1
    ServerAlias forum1
    DocumentRoot /var/www/forum1

    [...]
    </VirtualHost>

    Keep in mind that my server or host name is jednet.
    The first will suffice. ServerAlias lets you define alternative names to access the site by, so you can even remove that line entirely if needed.

  5. #5
    Join Date
    Oct 2007
    Beans
    21

    Re: Virtual Hosts

    Thanks man, i will try this today

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
  •