Results 1 to 6 of 6

Thread: Problems with vhosts

  1. #1
    Join Date
    Jan 2010
    Posts
    57

    Problems with vhosts

    I have big problems with my vhosts. Situation: I have a RPS server, and a dozen domains configured to point to this server.

    I managed to bind, and then try to manage Apache, and I use virtual hosts to manage sub-domains for example.

    Only a few weeks, without my knowledge why, nothing goes, and I think it shows that I have misconfigured something (and perhaps misunderstood, at the base).

    That translates into the fact that some of my domains are not accessible, sometimes only the subdomains are but "http://domain.com" does not work ...

    When I say "not working", it says on Firefox:
    Not Found

    The requested URL / was not found on this server.
    I have a folder "assets" which simply replaces "sites-enabled". This is just for practical reasons I stated in apache2.conf I wanted to be it who is taken into account.

    In "active" I have a file for each domain. Each file is roughly made the same way:

    Code:
    <VirtualHost my.fine.address.ip:80>
            ServerName domain1.com
            Redirect permanent / http://www.domain1.com
    </VirtualHost>
    <VirtualHost my.fine.address.ip:80>
            ServerAlias *.domain1.com
            VirtualDocumentRoot /home/mynickname/domain1/%-3+/
    </VirtualHost>
    They told me on IRC (# httpd on Freenode) not without benefit to pass to talk to me like a mongolian (I love IRC), I have had anywhere my.fine.address.ip:80 (with My IP instead, you can imagine).

    So I put everywhere. They also told me "for each VirtualHost, you need a DIFFERENT ServerAlias". Until proven otherwise, it is good.

    They also told me that I should not have two VirtualHost one after the other as it is in every file ... possible.

    Then, in my conf.d 000-default contains:

    Code:
    NameVirtualHost my.fine.address.ip:80
    
    <VirtualHost my.fine.address.ip:80>
            ServerName localhost
            DocumentRoot "/var/www/"
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            </Directory>
    
            ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
            <Directory "/usr/lib/cgi-bin">
                    AllowOverride None
                    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                    Order allow,deny
                    Allow from all
            </Directory>
    
            ErrorLog /var/log/apache2/error.log
    
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
    
            CustomLog /var/log/apache2/access.log combined
    
            Alias /doc/ "/usr/share/doc/"
            <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    
    </VirtualHost>
    They asked me on IRC the result of apache2ctl-S.

    Code:
    VirtualHost configuration:
    my.fine.address.ip:80       is a NameVirtualHost
             default server localhost (/etc/apache2/conf.d/000-default:3)
             port 80 namevhost localhost (/etc/apache2/conf.d/000-default:3)
             port 80 namevhost pineapple.com (/etc/apache2/actifs/pineapple:1)
             port 80 namevhost apple.com (/etc/apache2/actifs/pineapple:5)
             port 80 namevhost kiwi.us (/etc/apache2/actifs/kiwi:1)
             port 80 namevhost apple.com (/etc/apache2/actifs/kiwi:5)
             port 80 namevhost apple.com (/etc/apache2/actifs/apple:1)
             port 80 namevhost apple.com (/etc/apache2/actifs/apple:5)
             port 80 namevhost banana.com (/etc/apache2/actifs/banana:1)
             port 80 namevhost apple.com (/etc/apache2/actifs/banana:5)
             port 80 namevhost orange.cat (/etc/apache2/actifs/orange:1)
             port 80 namevhost apple.com (/etc/apache2/actifs/orange:5)
             port 80 namevhost mango.us (/etc/apache2/actifs/mango:1)
             port 80 namevhost apple.com (/etc/apache2/actifs/mango:5)
             port 80 namevhost pear.com (/etc/apache2/actifs/pear:1)
             port 80 namevhost apple.com (/etc/apache2/actifs/pear:5)
             port 80 namevhost cherry.com (/etc/apache2/actifs/cherry:5)
             port 80 namevhost apple.com (/etc/apache2/actifs/cherry:9)
    Syntax OK
    I have replaced my domain names with the names of fruit. As you see, it's just a mess. Finally I think. In short, how to fix it and do things properly?

  2. #2
    Join Date
    Nov 2008
    Posts
    1,185

    Re: Problems with vhosts

    There really was no noticeable change on the server a few weeks ago? A new site? A DNS conf?

    There is indeed surprising things:
    port 80 namevhost apple.com (/etc/apache2/actifs/banana:5)
    port 80 namevhost apple.com (/etc/apache2/actifs/kiwi:5)
    port 80 namevhost apple.com (/etc/apache2/actifs/apple:1)
    port 80 namevhost apple.com (/etc/apache2/actifs/apple:5)
    port 80 namevhost apple.com (/etc/apache2/actifs/banana:5)
    We see everywhere apple.com

    The behavior is random (or appears random)? It's always have the same plant or area that it varies?

    Have you tried to put across: 80 instead of my.fine.address.ip:80?

    It is possible that you send the entire contents of your active directory? Can you also give the contents of /etc/hosts for your server?

  3. #3
    Join Date
    Jan 2010
    Posts
    57

    Re: Problems with vhosts

    Yes I added a domain, but it is not the first time I do, so I understand. It does not vary over time. Some areas are working completely, others partially. Before, I put: 80 everywhere, it was the same thing. I will send the contents of my folder "assets" by PM.

  4. #4
    Join Date
    Nov 2008
    Posts
    1,185

    Re: Problems with vhosts

    In the Apache access logs, try to add the hostname (% (Host) i) in the tracks to see what hostname is actually received and interpreted by Apache when you have your 404 not found.

  5. #5
    Join Date
    Jan 2010
    Posts
    57

    Re: Problems with vhosts

    Listen to log I, after access to biganon.com and lypt.us (access that does not work):

    biganon.com:80 92.104.196.183 - - [11/Jan/2010:23:03:42 +0200] "GET / HTTP/1.1" 404 256 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090913 Shiretoko/3.5.3"
    lypt.us:80 92.104.196.183 - - [11/Jan/2010:23:04:43 +0200] "GET / HTTP/1.1" 301 266 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090913 Shiretoko/3.5.3"
    I have not managed to change the format (though I specified LogFormat)

  6. #6
    Join Date
    Nov 2008
    Posts
    1,185

    Re: Problems with vhosts

    Just to test, if you change the VH biganon.com as follows, what is happening?

    Code:
    <VirtualHost 87.98.146.113:80>
        ServerName biganon.com
        DocumentRoot /home/biganon/biganon/www/
    </VirtualHost>

Similar Threads

  1. MNP problems
    By Evangelia in forum Portable Devices
    Replies: 4
    Last Post: 09-03-2011, 02:59 AM
  2. Problems in AVG 9
    By Oswaldo in forum Networking & Security
    Replies: 5
    Last Post: 04-01-2010, 10:50 PM
  3. problems
    By xromania in forum Operating Systems
    Replies: 10
    Last Post: 24-10-2008, 03:44 AM
  4. USB problems
    By Stephanatic in forum Hardware Peripherals
    Replies: 2
    Last Post: 12-09-2008, 04:20 PM
  5. Replies: 4
    Last Post: 28-06-2008, 01:06 PM

Tags for this Thread

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
  •  
Page generated in 1,718,303,775.22136 seconds with 16 queries