Results 1 to 8 of 8

Thread: Cannot get virtual hosting to work

  1. #1

    Cannot get virtual hosting to work

    i have lampp installed, and i am trying to get virtual hosting to work, so i know how to do it in the future. on my local computer (a windows machine) i've put an entry in the hosts file (C:\Windows\System32\drivers\etc\hosts)

    192.168.1.66 domain.tld

    and i have put the following in the vhosts file on the server

    NameVirtualHost *:80

    <VirtualHost *:80>
    ServerName www.domain.tld
    ServerAlias domain.tld *.domain.tld
    DocumentRoot /opt/lampp/media/
    </VirtualHost>

    then when i go to "domain.tld" its exactly the same as if i went to "192.168.1.66" and if i go to "www.domain.tld" firefox says "server not found". i want to know if there's anything i'm doing wrong

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

    Re: Cannot get virtual hosting to work

    Try this in you windows hosts file:

    Code:
    192.168.1.66 domain.tld
    192.168.1.66 *.domain.tld
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  3. #3

    Re: Cannot get virtual hosting to work

    same result :/

  4. #4

    Re: Cannot get virtual hosting to work

    i needed to uncomment an include in httpd.conf to include httpd-vhosts.conf. i am now officially moving from ubuntu to slackware because this forum has such an awful error rate.

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

    Re: Cannot get virtual hosting to work

    Thats interesting.

    You did not mention what version of Ubuntu server you were running.

    In Ubuntu 10.04 virtualhost is running happily with a blank httpd.conf.

    Two relative configs are:

    /etc/apache2/apache2.conf:
    Code:
    # Include the virtual host configurations:
    Include /etc/apache2/sites-enabled/
    /etc/apache2/ports.conf
    Code:
    NameVirtualHost *
    Listen 80
    The beauty of Linux is the freedom it offers us to choose.

    Enjoy.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  6. #6
    Join Date
    Aug 2008
    Location
    Victoria, BC Canada
    Beans
    1,741

    Re: Cannot get virtual hosting to work

    Even though Ubuntu lacks integration components, I can still use it on a VM because webmin allows full access.

    If you are using a VM for a web hosting, make sure that port 80 is sent to the right VM

  7. #7
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Cannot get virtual hosting to work

    Virtual host definitions in Ubuntu are stored in /etc/apache2/sites-enabled. Did you put your custom definition there?

  8. #8
    Join Date
    Aug 2010
    Location
    Between Heatsink and CPU
    Beans
    538
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Cannot get virtual hosting to work

    Quote Originally Posted by <h1>Mckennie</h1> View Post
    i am now officially moving from ubuntu to slackware because this forum has such an awful error rate.
    buh-bye.

    ** My Blog
    **

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
  •