Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: [SOLVED] running a local site and an external site...

  1. #11
    Join Date
    May 2008
    Beans
    69

    Re: running a local site and an external site...

    Quote Originally Posted by a.thomas View Post
    Thank you, I finally saw that. But now I am not sure what this error is?
    Code:
    [Tue Aug 19 16:46:24 2008] [error] (EAI 2)Name or service not known: Failed to resolve server name for 192.168.0.189 (check DNS) -- or specify an explicit ServerName
    Any ideas?
    You need to put an explicit ServerName line in your Apache config for each virtual host, or provide a reverse-lookup (maybe via /etc/hosts?) for the IP in question on the server. I suggest the former.

    Copied mostly from the Apache2 VirtualHost examples:

    Code:
    # Ensure that Apache listens on port 80
    Listen 80
    
    # Listen for virtual host requests on all IP addresses
    NameVirtualHost *:80
    
    <VirtualHost *:80>
    DocumentRoot /web/testing/
    ServerName www.testing.site.com
    
    # Other directives here
    
    </VirtualHost>
    
    <VirtualHost *:80>
    DocumentRoot /var/www/
    ServerName www.site.com
    
    # Other directives here
    
    </VirtualHost>

  2. #12
    Join Date
    Aug 2008
    Beans
    21
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: running a local site and an external site...

    Yes this makes sense, but with IP based is it not different? I have added to my apache2.conf file as follows:
    Code:
    NameVirtualHost xxx.xxx.63.12
    NameVirtualHost 192.168.0.189
    Here are my site config files now:
    Code:
    <VirtualHost 192.168.0.189>
            DocumentRoot /web/testing/
            ServerName testing.site.com
    
            <Directory /web/testing/>
                    Options -Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>
    </VirtualHost>
    Code:
    <VirtualHost xxx.xxx.63.12>
            DocumentRoot /var/www/
            ServerName site.com
    
            <Directory /var/www/>
                    Options -Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>
    </VirtualHost>
    I do not get this error anymore:
    Code:
    [Tue Aug 19 16:46:24 2008] [error] (EAI 2)Name or service not known: Failed to resolve server name for 192.168.0.189 (check DNS) -- or specify an explicit ServerName
    I now get:
    Code:
    sudo /etc/init.d/apache2 reload
     * Reloading web server config apache2
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    Is this due to the /etc/hosts file?
    I am assuming it is the /etc/hosts file, but I am not sure what to put in there.

    Thanks for your help!

  3. #13
    Join Date
    May 2008
    Beans
    69

    Re: running a local site and an external site...

    Quote Originally Posted by a.thomas View Post
    I now get:
    Code:
    sudo /etc/init.d/apache2 reload
     * Reloading web server config apache2
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    Is this due to the /etc/hosts file?
    I am assuming it is the /etc/hosts file, but I am not sure what to put in there.
    This sounds like you have a third host you haven't showed us config for (the Apache package's sites-available/default?). Regardless, you should be able to let Apache "reliably determine the server's fully qualified domain name" (FQDN) by putting the FQDN (e.g., "www.site.com") in /etc/hostname.

    You have to reboot for the change to /etc/hostname to register, but you can set it until the next reboot like this:

    Code:
    sudo hostname www.site.com
    Derek

  4. #14
    Join Date
    Aug 2008
    Beans
    21
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: running a local site and an external site...

    I forgot I commented out the ServerName in the apache2.conf... so changing it solved my issue. Not sure what I was doing...

    I do have the sites-available/default config still there but disabled.

    My server is name good to go with the setup I wanted... for now hahaha

    Thanks Derek!

    -Aaron

Page 2 of 2 FirstFirst 12

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
  •