Announcement

Collapse
No announcement yet.

Starting apache2 server failed ?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Starting apache2 server failed ?

    Hello ,

    Solved one problem and this never stops .......oh well .

    Googled for this error and tried the various commands that seem to work for other`s ( except me of course ).

    Here`s the screenshot :

    Click image for larger version

Name:	apach2-err.png
Views:	1
Size:	81.8 KB
ID:	648933

    Hope someone can help one this.

    Thank you .

    #2
    Not that I can help, as Apache I have not used in some time, and then as part of a LAMP stack, you might want to specify which things you have tried, and where you found those things to try.

    Comment


      #3
      Hi claydoh,

      Found 2 links which basically cover most of the methods used over different sites.

      http://stackoverflow.com/questions/2...2-restart-fail

      http://fogproject.org/forum/threads/...p-start.11106/

      The second link is what in effect answered my own question in that apache2 was broken due to an external package.

      This seems to be on the ball as i am still using bm2lts (it works) and with Nvidia but should you update/upgrade the software , you break distro function.

      Comment


        #4
        Hmmm Please copy and paste the text in the terminal instead of posting a screenshot. makes for more work quoting any part of the error messages

        https://help.ubuntu.com/community/Ap...lling_Apache_2
        This probably would have been one of the first places to go, it even has a section specific to the error message you posted in the OP.
        As we don't have any info on exactly what you did, and I sure cannot tell from link #2 how an external package was involved,



        Then again, it is 430 in the morning, and I have yet to go to bed

        Comment


          #5
          Are you running any other http servers? That error looks to me like something else is already listening on port 80, so Apache was unable to bind to it.

          You can check which process it is with this command:

          Code:
          sudo netstat -tulpn | grep :80
          Note that the "could not determine the server's fully qualified domain name" part is a warning not an error, you can get rid of it by putting this in any of your Apache configuration files:

          Code:
          ServerName foo.com
          And then restart Apache:

          Code:
          sudo service apache2 restart
          Sam
          samhobbs.co.uk

          Comment


            #6
            @Feathers McGraw,

            There`s still a small problem with a kernel added to the original kernel.

            Actually, have 3 kernels installed in Trusty 14.04.2 .

            - 3.15.10 ( some more numbers here........ )
            - 3.16.0.31
            - 3.19.2 ( this kernel is excellent but a vital part of hardware does not output to screen )

            Ran `sudo netstat -tulpn | grep :80` which gave me :

            Code:
            reel@BM2LTSR66RBex:/media/hd/home/reel$ sudo netstat -tulpn | grep :80
            sudo: unable to resolve host BM2LTSR66RBex
            [sudo] password for reel: 
            tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3459/tntnet     
            tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN      3511/vdradmind  
            tcp        0      0 0.0.0.0:8002            0.0.0.0:*               LISTEN      4708/lighttpd   
            tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      4901/shellinaboxd
            tcp6       0      0 :::80                   :::*                    LISTEN      3459/tntnet     
            tcp6       0      0 :::8008                 :::*                    LISTEN      4870/vdr        
            reel@BM2LTSR66RBex:/media/hd/home/reel$
            Port 80 seems to be busy . How do you solve this ?

            Concerning that `warning` message. In /etc/apache2/ i count 7 folders plus 3 files . Attempted to copy/paste to any folder/file but the os refused, so not clear on which folder /file to place `ServerName foo.com`in.
            Last edited by kdeuser; Mar 26, 2015, 04:59 AM.

            Comment


              #7
              The apache config files are owned by root, so you need to use sudo to edit them.

              Nano is quite a nice and easy commandline text editor, I can't remember if it's installed by default, but if not you can install it like this:

              Code:
              sudo apt-get update
              sudo apt-get install nano
              ...and then open the main apache config file using:

              Code:
              sudo nano /etc/apache2/apache2.conf
              Make your changes, then CTRL X to exit, and save when prompted.

              You might notice these lines at the bottom of the apache.conf file:

              Code:
              # Include generic snippets of statements
              IncludeOptional conf-enabled/*.conf
              
              # Include the virtual host configurations:
              IncludeOptional sites-enabled/*.conf
              These statements auto-load files like /etc/apache2/conf-enabled/foo.conf (related chunks of config) and /etc/apache2/sites-enabled/foo.com.conf (virtualhost files, which are config files for each individual website). So the modular way to do things is add files to /etc/apache2/conf-available/foo.conf and use the a2enconf command to create a symlink to the conf-enabled directory, e.g.:

              Code:
              sudo a2enconf foo
              BTW, the related command for virtualhost files is a2ensite, and the commands to un-symlink the files again are a2disconf and a2dissite respectively. You can see that for my Apache server, I added a files called /etc/apache2/conf-available/servername.conf and symlinked it to /etc/apache2/conf-enabled/servername.conf because I wanted to keep it separate:

              Code:
              sam@samhobbs:~$ ll /etc/apache2/conf-enabled
              total 8
              drwxr-xr-x 2 root root 4096 Apr  2  2014 ./
              drwxr-xr-x 8 root root 4096 Mar 11 12:56 ../
              lrwxrwxrwx 1 root root   30 Mar 25  2014 charset.conf -> ../conf-available/charset.conf
              lrwxrwxrwx 1 root root   40 Mar 25  2014 javascript-common.conf -> ../conf-available/javascript-common.conf
              lrwxrwxrwx 1 root root   44 Mar 25  2014 localized-error-pages.conf -> ../conf-available/localized-error-pages.conf
              lrwxrwxrwx 1 root root   46 Mar 25  2014 other-vhosts-access-log.conf -> ../conf-available/other-vhosts-access-log.conf
              lrwxrwxrwx 1 root root   33 Mar 25  2014 phpmyadmin.conf -> ../conf-available/phpmyadmin.conf
              lrwxrwxrwx 1 root root   31 Mar 25  2014 security.conf -> ../conf-available/security.conf
              lrwxrwxrwx 1 root root   36 Mar 25  2014 serve-cgi-bin.conf -> ../conf-available/serve-cgi-bin.conf
              lrwxrwxrwx 1 root root   33 Mar 25  2014 servername.conf -> ../conf-available/servername.conf
              servername.conf contains:
              Code:
              # added 2014.03.25 to suppress apache warning on reboot
              ServerName samhobbs
              You need to reload apache after making changes like this:

              Code:
              sudo service apache2 reload
              If you want to read about apache virtualhost files, you can check out this tutorial I wrote last year.

              Sam
              samhobbs.co.uk

              Comment


                #8
                forgot the other part of your question...

                Originally posted by kdeuser View Post
                Code:
                reel@BM2LTSR66RBex:/media/hd/home/reel$ sudo netstat -tulpn | grep :80 
                tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3459/tntnet
                Port 80 seems to be busy
                tntnet is (apparently) a C++ webserver. Unless you installed it yourself, I guess it was pulled in by some other package.

                Can you run this command? It should show us what installed tntnet:

                Code:
                apt-cache --installed rdepends tntnet
                Sam
                samhobbs.co.uk

                Comment


                  #9
                  Thanks for the explanation there but still seem to get errors .

                  I added the line `ServerName foo.com` to the very bottom of `apach2.conf via the `sudo nano /etc/apache2/apache2.conf` command.

                  Output :

                  Code:
                  reel@BM2LTSR66RBex:/media/hd/home/reel$ sudo service apache2 reload
                  sudo: unable to resolve host BM2LTSR66RBex
                  [sudo] password for reel: 
                  Reloading web server: apache2 failed!
                  Apache2 is not running ... (warning).
                  reel@BM2LTSR66RBex:/media/hd/home/reel$
                  Followed by the `apt-cache --installed rdepends tntnet` command :

                  Code:
                  reel@BM2LTSR66RBex:/media/hd/home/reel$ apt-cache --installed rdepends tntnet
                  tntnet
                  Reverse Depends:
                    tntnet-runtime
                  reel@BM2LTSR66RBex:/media/hd/home/reel$
                  Hope this helps.

                  Comment


                    #10
                    Ah, I forgot apache has to already be running to be reloaded. Since it didn't start, it isn't running. You will have to do:

                    Code:
                    sudo service apache2 start
                    ...but that won't work until apache can bind to port 80, which it can't do while tntnet is running.

                    Try this:

                    Code:
                    apt-cache --installed rdepends tntnet-runtime
                    (you get the idea, we're going to keep going until we find whatever pulled the package in - hopefully!)
                    samhobbs.co.uk

                    Comment


                      #11
                      Readout of `apt-cache --installed rdepends tntnet-runtime`:

                      Code:
                      reel@BM2LTSR66RBex:/media/hd/home/reel$ apt-cache --installed rdepends tntnet-runtime
                      tntnet-runtime
                      Reverse Depends:
                        tntnet
                        libtntnet12
                      reel@BM2LTSR66RBex:/media/hd/home/reel$

                      Comment


                        #12
                        I have a horrible feeling this is going to be one big depewndency loop, but let's see...

                        Code:
                        apt-cache --installed rdepends libtntnet12
                        samhobbs.co.uk

                        Comment


                          #13
                          Dependencies , oh not again......

                          Code:
                          reel@BM2LTSR66RBex:/media/hd/home/reel$ apt-cache --installed rdepends libtntnet12
                          libtntnet12
                          Reverse Depends:
                            tntnet-runtime
                            tntnet
                          reel@BM2LTSR66RBex:/media/hd/home/reel$
                          Seems futile .

                          Comment


                            #14
                            Ha! Well. I don't know how that got installed if you didn't install it yourself and there are no dependencies, unless you've been installing random packages from outside the package management system?

                            Try this and see if stuff breaks:

                            Code:
                            sudo service tntnet stop
                            samhobbs.co.uk

                            Comment


                              #15
                              Result :

                              Code:
                              reel@BM2LTSR66RBex:/media/hd/home/reel$ sudo service tntnet stop
                              sudo: unable to resolve host BM2LTSR66RBex
                              [sudo] password for reel: 
                              Stopping web server: tntnet.
                              reel@BM2LTSR66RBex:/media/hd/home/reel$
                              Have not knowingly installed dependencies.

                              Comment

                              Working...
                              X