Results 1 to 10 of 13

Thread: Unable to run Apache when listening on port 80

Hybrid View

  1. #1
    Join Date
    Mar 2013
    Beans
    4

    Angry Unable to run Apache when listening on port 80

    Although this appears to be an Apache problem,
    I believe the cause is in Ubuntu.

    Issue ;- When I configure Apache to isten to port 80, it will not start.

    It works fine on port 8080.

    I believe sometingh else is on port 80.

    Did this;-
    Code:
    lsof -i :80  
    COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    ubuntu-ge 1778 hans    7u  IPv4  11099      0t0  TCP hans-GA-78LMT-S2P.local:58177->mistletoe.canonical.com:http (CLOSE_WAIT)
    What is this and do I need it?

    If not, how do I get rid of it?

    Please be specific as I am very new to Linux and don't know very much yet.

    Am running 12,04 LTS and Lampstack 5.4.10-0
    which includes Apache 2.4

    Any help would be appreciated.

    Thanks
    Last edited by sandyd; March 17th, 2013 at 02:18 AM. Reason: formatting

  2. #2
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    2,210
    Distro
    Ubuntu Development Release

    Re: Unable to run Apache when listening on port 80

    Hi and welcome to Ubuntu forums.

    I'm not sure, but I think your listing from "lsof -i :80" is showing an outgoing connection from your computer port 58177 to a web page on some canonical server port 80. The connection is just in the prosses of closing. Using your method, and also haveing just fetched a page on from my web server via some client, I get:
    Code:
    doug@doug-64:~$ sudo lsof -i :80
    COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    apache2  1476     root    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 20763 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 26343 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 26344 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 26978 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 27502 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 27503 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 28112 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 28112 www-data    9u  IPv4 365704      0t0  TCP ns1.smythies.com:http->doug-xps2.smythies.com:6885 (ESTABLISHED)
    apache2 28721 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 28890 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    apache2 28948 www-data    3u  IPv4   9740      0t0  TCP *:http (LISTEN)
    Now, this is an example of the method I have seen recommended many times on these forums to see who is listening for TCP connections on what port:
    Code:
    doug@s15:~$ sudo netstat -plnt
    [sudo] password for doug:
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1900/dnsmasq
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1154/sshd
    tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1971/master
    tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      2056/apache2
    tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      874/smbd
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1676/mysqld
    tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      874/smbd
    tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2056/apache2
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  3. #3
    Join Date
    May 2010
    Location
    uk
    Beans
    9,374
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Unable to run Apache when listening on port 80

    Hi

    A geoip server ? You're running Ubuntu with Unity desktop ?

    From the terminal, what does this return ?

    Code:
    gsettings list-recursively | grep geoip
    What about this ?
    Code:
    gsettings list-recursively | grep 'mistletoe.canonical.com'
    Try with and without quotes around mistletoe....

    Kind regards
    Last edited by matt_symes; March 17th, 2013 at 10:52 AM.
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  4. #4
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Unable to run Apache when listening on port 80

    Quote Originally Posted by GerritR View Post
    Although this appears to be an Apache problem,
    I believe the cause is in Ubuntu.

    Issue ;- When I configure Apache to isten to port 80, it will not start.

    It works fine on port 8080.

    I believe sometingh else is on port 80.

    Did this;-
    Code:
    lsof -i :80  
    COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    ubuntu-ge 1778 hans    7u  IPv4  11099      0t0  TCP hans-GA-78LMT-S2P.local:58177->mistletoe.canonical.com:http (CLOSE_WAIT)
    What is this and do I need it?

    If not, how do I get rid of it?

    Please be specific as I am very new to Linux and don't know very much yet.

    Am running 12,04 LTS and Lampstack 5.4.10-0
    which includes Apache 2.4

    Any help would be appreciated.

    Thanks
    hi
    i belive it too: --> I believe the cause is in Ubuntu.
    got the same problem years ago. the reason is a faulty TCP implementations, and leave the server hanging in FIN_WAIT. that means that mistletoe.canonical.com will have
    bigger problems - a lot of connections will hang in FIN_WAIT ?!
    and surprise on my box --> ubuntu-ge 3075 richi 7u IPv4 158684 0t0 TCP tschangwifi:37467->mistletoe.canonical.com:http (CLOSE_WAIT)
    same behavior. the connection is a three way handshake and i guess an ACK is lost
    ciao
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  5. #5
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Unable to run Apache when listening on port 80

    Quote Originally Posted by GerritR View Post
    Although this appears to be an Apache problem,
    I believe the cause is in Ubuntu.

    Issue ;- When I configure Apache to isten to port 80, it will not start.

    It works fine on port 8080.

    I believe sometingh else is on port 80.

    Did this;-
    Code:
    lsof -i :80  
    COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    ubuntu-ge 1778 hans    7u  IPv4  11099      0t0  TCP hans-GA-78LMT-S2P.local:58177->mistletoe.canonical.com:http (CLOSE_WAIT)
    What is this and do I need it?

    If not, how do I get rid of it?

    Please be specific as I am very new to Linux and don't know very much yet.

    Am running 12,04 LTS and Lampstack 5.4.10-0
    which includes Apache 2.4

    Any help would be appreciated.

    Thanks
    hi
    i belive it too: --> I believe the cause is in Ubuntu.
    got the same problem years ago. the reason is a faulty TCP implementations, and leave the server hanging in FIN_WAIT. that means that mistletoe.canonical.com will have
    bigger problems - a lot of connections will hang in FIN_WAIT ?!
    and surprise on my box --> ubuntu-ge 3075 richi 7u IPv4 158684 0t0 TCP tschangwifi:37467->mistletoe.canonical.com:http (CLOSE_WAIT)
    same behavior. the connection is a three way handshake and i guess an ACK is lost
    ciao
    oh - my apache isn't involed in that problem.
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  6. #6
    Join Date
    Mar 2013
    Beans
    4

    Re: Unable to run Apache when listening on port 80

    Hi All,

    Thanks for the help.

    Matt_Symes,

    I tried both your suggestions, got no output at all, just the prompt.

    Doug S ;

    Did a Netstat and got this

    hans@hans-GA-78LMT-S2P:~$ sudo netstat -plnt
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1047/php-fpm.conf)
    tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 9789/mysqld.bin
    tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 795/smbd
    tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 3719/httpd
    tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1011/dnsmasq
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 803/cupsd
    tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 3719/httpd
    tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 795/smbd
    tcp6 0 0 :::21 :::* LISTEN 1095/proftpd: (acce
    tcp6 0 0 ::1:631 :::* LISTEN 803/cupsd
    hans@hans-GA-78LMT-S2P:~$ ^C
    hans@hans-GA-78LMT-S2P:~$



    Notice, NO Port 80

    How strange that ?

    Just tried once again to start Apache on port 80, No luck.

    This has got me stumped HELP !!

    Thanks

  7. #7
    Join Date
    May 2010
    Location
    uk
    Beans
    9,374
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Unable to run Apache when listening on port 80

    Hi

    Try

    Code:
    sudo kill 1778
    to kill the process and restart apache.

    if that does not work try

    Code:
    sudo kill -9 1778
    If you kill it does it respawn ?

    EDIT: Extra info

    Code:
    matthew-S206:/home/matthew % apt-cache search ubuntu-ge 
    geoclue-ubuntu-geoip - Provide positioning for GeoClue via Ubuntu GeoIP services
    matthew-S206:/home/matthew %
    It may be GeoClue.

    Does this return anything ?

    Code:
    dpkg -l | grep ubuntu-ge
    You could uninstall it or disable it.

    Kind regards
    Last edited by matt_symes; March 17th, 2013 at 05:16 PM. Reason: Extra info
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  8. #8
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    2,210
    Distro
    Ubuntu Development Release

    Re: Unable to run Apache when listening on port 80

    I am having trouble to understand the geo connection to the main problem. Myself, I believe it to be a red-haring (i.e. an unrelated, yet intersting, issue). However, I'll defer to Matt on this part of it.

    So, I see the issue as apache is not running and listening on port 80, so why not? Do you see anything in the log files either in /var/log or /var/log/apache2 that might help? If you try to start apache manually does any error get listed as to why it does not start up? Example:
    Code:
    doug@s15:~$ sudo service apache2 stop   <<< Just to have it not running.
     * Stopping web server apache2
     ... waiting    [ OK ]
    doug@s15:~$ sudo netstat -plnt   <<< Just to check
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1900/dnsmasq
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1154/sshd
    tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1971/master
    tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      874/smbd
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1676/mysqld
    tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      874/smbd
    doug@s15:~$ sudo service apache2 start    <<< What do you get for this?
     * Starting web server apache2
      [ OK ]
    doug@s15:~$ sudo netstat -plnt    <<< I can not get the "su" to be red, weird.
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1900/dnsmasq
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1154/sshd
    tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1971/master
    tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      13070/apache2
    tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      874/smbd
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1676/mysqld
    tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      874/smbd
    tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      13070/apache2
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  9. #9
    Join Date
    May 2010
    Location
    uk
    Beans
    9,374
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Unable to run Apache when listening on port 80

    Hi

    I am having trouble to understand the geo connection to the main problem. Myself, I believe it to be a red-haring (i.e. an unrelated, yet intersting, issue). However, I'll defer to Matt on this part of it.
    No need to defer to me

    I was following the idea that some process was listening on port 80 and so apache could not bind to it, especially as it could bind on port 8080.

    However, i was surprised to see that netstat did not show anything bound to port 80.

    I am following just on train of thought but, we can, and should follow every path we can think of. After all, we all trying to help the OP.

    I may well be, and often am, wrong

    Kind regards
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

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
  •