Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Apache setup problem

  1. #1
    Join Date
    Jul 2008
    Location
    Sandvika, Norway
    Beans
    406
    Distro
    Xubuntu 10.04 Lucid Lynx

    Apache setup problem

    I'm running Ubuntu 8.04.1 desktop, and have tried and tried and tried to set up apache with some local domans for use with we development. No success.

    I have left apache2.conf untouched from the installation, and have added http.conf thus:

    Code:
    ServerName intertrafico
    
    Listen 127.0.0.2:80
    Listen 127.0.0.3:80
    Listen 127.0.0.4:80
    Listen 127.0.0.5:80
    Listen 127.0.0.6:80
    Listen 127.0.0.7:80
    Listen 127.0.0.8:80
    Listen 127.0.0.99:80
    Naturally, each IP address is for one domain. "intertrafico" is the "main" server, which contains common files for all the other domains. The IPs are also defined in the /etc/hosts file.

    Each virtual host is set up like this (only shown is "intertrafico" but the others are equal except for domain name and directory).

    Code:
    NameVirtualHost intertrafico
    <VirtualHost 127.0.0.2:80>
        ServerAdmin webmaster@intertrafico
        ServerName intertrafico
        
        DocumentRoot /home/Ebackup/inge/public_html
        <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory /home/Ebackup/inge/public_html>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
        </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
        ServerSignature On
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 10.10.10.2/255.255.255.0
        </Directory>
    
    </VirtualHost>
    I also tried to set up apache on my windows machine before I switched, but no luck. I would still like to use apache because it's more or less a standard program.

    My router has address 10.10.10.1 and gives addresses from 2 to 9; the printer is 10 (10.10.10.10), so I've defined "legal" addresses to be 2-9.

    Can anyone see what's wrong or missing?
    Last edited by ingeva; August 19th, 2008 at 07:39 PM.
    If it works, FIX IT! (Bill Gates)


  2. #2
    Join Date
    Nov 2007
    Beans
    449
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Apache setup problem

    try just using
    Code:
    Listen 80
    i dont think you have to, and it might not let you, say the IP to listen on, it doesn't really make sense. Or perhaps thats your problem, if you can sepecify IP than it might only be accepting connections from your own computer.
    quidquid Latine dictum sit altum videtur

  3. #3
    Join Date
    Jul 2008
    Location
    Sandvika, Norway
    Beans
    406
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: Apache setup problem

    Quote Originally Posted by Potatoj316 View Post
    try just using
    Code:
    Listen 80
    i dont think you have to, and it might not let you, say the IP to listen on, it doesn't really make sense. Or perhaps thats your problem, if you can sepecify IP than it might only be accepting connections from your own computer.
    I tried this, and now apache generates a whole lot of errors, and reports missing directories that are not missing at all:

    Code:
    inge@Pantera:/etc$ sudo init.d/apache2 restart
     * Restarting web server apache2                                                                           Warning: DocumentRoot [/home/Ebackup/inge/public_html] does not exist
    Warning: DocumentRoot [/home/Ebackup/inge/public_html/noniplus] does not exist
    Warning: DocumentRoot [/home/Ebackup/inge/public_html/skms] does not exist
    Warning: DocumentRoot [/home/Ebackup/inge/public_html/test] does not exist
    Warning: DocumentRoot [/home/Ebackup/inge/public_html/forward] does not exist
    [Tue Aug 19 21:00:57 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Tue Aug 19 21:00:57 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Tue Aug 19 21:00:57 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Tue Aug 19 21:00:57 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Tue Aug 19 21:00:57 2008] [warn] NameVirtualHost test:0 has no VirtualHosts
    [Tue Aug 19 21:00:57 2008] [warn] NameVirtualHost skms:0 has no VirtualHosts
    [Tue Aug 19 21:00:57 2008] [warn] NameVirtualHost upandforward:0 has no VirtualHosts
    [Tue Aug 19 21:00:57 2008] [warn] NameVirtualHost noniplus:0 has no VirtualHosts
    [Tue Aug 19 21:00:57 2008] [warn] NameVirtualHost intertrafico:0 has no VirtualHosts
    httpd (no pid file) not running
    Warning: DocumentRoot [/home/Ebackup/inge/public_html] does not exist
    Warning: DocumentRoot [/home/Ebackup/inge/public_html/noniplus] does not exist
    Warning: DocumentRoot [/home/Ebackup/inge/public_html/skms] does not exist
    Warning: DocumentRoot [/home/Ebackup/inge/public_html/test] does not exist
    Warning: DocumentRoot [/home/Ebackup/inge/public_html/forward] does not exist
    [Tue Aug 19 21:01:07 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Tue Aug 19 21:01:07 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Tue Aug 19 21:01:07 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Tue Aug 19 21:01:07 2008] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Tue Aug 19 21:01:07 2008] [warn] NameVirtualHost test:0 has no VirtualHosts
    [Tue Aug 19 21:01:07 2008] [warn] NameVirtualHost skms:0 has no VirtualHosts
    [Tue Aug 19 21:01:07 2008] [warn] NameVirtualHost upandforward:0 has no VirtualHosts
    [Tue Aug 19 21:01:07 2008] [warn] NameVirtualHost noniplus:0 has no VirtualHosts
    [Tue Aug 19 21:01:07 2008] [warn] NameVirtualHost intertrafico:0 has no VirtualHosts
    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    So this did not help much ....
    If it works, FIX IT! (Bill Gates)


  4. #4
    Join Date
    Jul 2008
    Location
    Sandvika, Norway
    Beans
    406
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: Apache setup problem

    Quote Originally Posted by Potatoj316 View Post
    try just using
    Code:
    Listen 80
    i dont think you have to, and it might not let you, say the IP to listen on, it doesn't really make sense. Or perhaps thats your problem, if you can sepecify IP than it might only be accepting connections from your own computer.
    I found a typing error and corrected it.
    After that I get the following:

    Code:
     * Starting web server apache2                                                  (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    If it works, FIX IT! (Bill Gates)


  5. #5
    Join Date
    Jul 2008
    Location
    Sandvika, Norway
    Beans
    406
    Distro
    Xubuntu 10.04 Lucid Lynx

    Maybe....

    Maybe this wasn't the right place to ask -- but my Apache problem is on the desktop version, and not by the server although they shouldn't be that different (?).

    Does anyone have a virtualhost file that you might want to share?

    None of mine work.

    The http.conf file is now:

    Code:
    ServerName intertrafico
    
    Listen 127.0.0.2:80
    Listen 127.0.0.3:80
    Listen 127.0.0.4:80
    Listen 127.0.0.5:80
    Listen 127.0.0.6:80
    Listen 127.0.0.7:80
    Listen 127.0.0.8:80
    Listen 127.0.0.9:80
    Listen 127.0.0.99:80
    If it works, FIX IT! (Bill Gates)


  6. #6
    Join Date
    Jan 2006
    Location
    United Kingdom
    Beans
    2,787
    Distro
    Kubuntu 6.06 Dapper

    Re: Apache setup problem

    Quote Originally Posted by ingeva View Post
    Code:
     * Starting web server apache2                                                  (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    Always take any errors, particularly at process startup, seriously.

    In this case it is telling you two things - it could not bind to port 80 and hence it is not starting at all. So, if Apache isn't running on port 80 what is?

    Find out with sudo lsof -i :80 and post the results.

    Incidentally, as you are using name-based virtual hosting you only need the one Listen 127.0.0.1:80 directive (all hosts should then be configured <Virtualhost 127.0.0.1:80> to match).

    Mathew
    Last edited by MJN; August 20th, 2008 at 01:24 PM.
    www.NewtonNet.co.uk - Now supporting IPv6!

    ~ Please don't use PM's to request assistance - post your query on the forum and share the discussion - if you've got a problem chances are you won't be the only one! ~

  7. #7
    Join Date
    May 2008
    Beans
    69

    Re: Maybe....

    Quote Originally Posted by ingeva View Post
    Does anyone have a virtualhost file that you might want to share?
    The Apache Virtual Hosts documentation has some examples I've found useful in the past.

  8. #8
    Join Date
    Nov 2007
    Beans
    449
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Maybe....

    Quote Originally Posted by ingeva View Post
    Maybe this wasn't the right place to ask -- but my Apache problem is on the desktop version, and not by the server although they shouldn't be that different (?).
    shouldnt be a problem.

    your current problem sounds like its not able to connect/isnt connecting to port 80. try changing it to
    Code:
    Listen 9999
    (or some other random port above 1024)
    I also still dont think the IP is necessary when specifying what port to listen to, the default is just
    Code:
    Listen 80
    If you know for a fact that you can specify the IP do you mind sharing with me what it does/what the benefit is?
    quidquid Latine dictum sit altum videtur

  9. #9
    Join Date
    Jul 2008
    Location
    Sandvika, Norway
    Beans
    406
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: Apache setup problem

    Quote Originally Posted by MJN View Post
    So, if Apache isn't running on port 80 what is?

    Find out with sudo lsof -i :80 and post the results.

    Incidentally, as you are using name-based virtual hosting you only need the one Listen 127.0.0.1:80 directive (all hosts should then be configured <Virtualhost 127.0.0.1:80> to match).
    No output from the lsof command, so I guess no one is using port 80.

    I haven't tried using the same IP for all domains, but I could try that.
    In that case, what should be in the hosts file?
    If it works, FIX IT! (Bill Gates)


  10. #10
    Join Date
    May 2008
    Beans
    69

    Re: Maybe....

    Quote Originally Posted by Potatoj316 View Post
    If you know for a fact that you can specify the IP do you mind sharing with me what it does/what the benefit is?
    Listen without an IP specified listens on all available network interfaces. Listen with an IP specified binds only to the specified IP addresses. For example, if you wanted a test server that could only be accessed locally, you could specify:

    Code:
    Listen 127.0.0.1:80
    Then only browsers running on the local machine would be able to access the server.

    Similarly, if you had a web server running on your router, you could make the server available on the LAN and not the WAN.

Page 1 of 4 123 ... LastLast

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
  •