apache down!! please help

Discussion in 'Installation/Configuration' started by cjuk, May 21, 2016.

  1. cjuk

    cjuk New Member

    hi all,

    sorry this is my 1st post, so if its in the wrong place please move.
    im not a total noob, lol
    I had to do a restart to day and now i have no access to any of my sites or the ispconfig panel, mail and mysql seem ok.

    when i restart apache2 (service apache2 restart) i get this error
    when i went to take a look at the apache2 folder (/etc/apache2) that folder aint there, with some searching i found the apache2 folder in /etc/apparmor.d/apache2.

    im not sure how it got there i removed apparmor months ago after i installed debian.
    WHAT IV TRIED
    copyed the /etc/apparmor.d/apache2/envvars to /etc/apache2/envvars and edited
    Code:
    # for supporting multiple apache2 instances
    if [ "${APACHE_CONFDIR##/etc/apparmor.d/apache2-}" != "${APACHE_CONFDIR}" ] ; then
        SUFFIX="-${APACHE_CONFDIR##/etc/apparmor.d/apache2-}"
    else
        SUFFIX=
    fi
    to match the new apparom.d folder.
    it now looks like apache2 starts, but cant access my sites still.
    iv tried sudo a2ensite to enable sites but the list is empty the same for sudo a2enmod.
    im not at a total loss as to what to do next.

    Let me know what logs u need to see and any other info you need.


    thank you got your help
    cjuk
     
  2. sjau

    sjau Local Meanie Moderator

  3. cjuk

    cjuk New Member

    yes my envvar was the same as yours but i edited it to point to /etc/apparmor.d/apache2 as this is where i found apache2 had been moved to, (not moved by me) after editing the envvar apache2 would start but i cant load any of my sites or ispconfig site. both a2ensite and a2enmod show empty lists.

    also i for got to say im on debian 8.

    thanks for your time
     
  4. justinvirk

    justinvirk New Member

    The problem is because some configuration files are deleted, you have to reinstall it.

    REINSTALL APACHE2:

    To replace configuration files that have been deleted, without purging the package, you can do:

    sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2

    To fully remove the apache2 config files, you should:

    sudo apt-get purge apache2

    which will then let you reinstall it in the usual way with:

    sudo apt-get install apache2

    Purge is required to remove all the config files - if you delete the config files but only remove the package, then this is remembered & missing config files are not reinstalled by default.

    Then REINSTALL PHP5:

    apt-get purge libapache2-mod-php5 php5 && \
    apt-get install libapache2-mod-php5 php5
     
  5. cjuk

    cjuk New Member

    this didnt work sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2 got this error

    Code:
    May 22 11:02:39 bluestone systemd[1]: Starting LSB: Apache2 web server...
    May 22 11:02:39 bluestone apache2[26951]: Starting web server: apache2 failed!
    May 22 11:02:39 bluestone apache2[26951]: The apache2 configtest failed. ... (warning).
    May 22 11:02:39 bluestone apache2[26951]: Output of config test was:
    May 22 11:02:39 bluestone apache2[26951]: AH00534: apache2: Configuration error: No MPM loaded.
    May 22 11:02:39 bluestone apache2[26951]: Action 'configtest' failed.
    May 22 11:02:39 bluestone apache2[26951]: The Apache error log may have more information.
    May 22 11:02:39 bluestone systemd[1]: apache2.service: control process exited, code=exited status=1
    May 22 11:02:39 bluestone systemd[1]: Failed to start LSB: Apache2 web server.
    May 22 11:02:39 bluestone systemd[1]: Unit apache2.service entered failed state.
    
    can i just
    1,backup my /etc/apparmor.d/apache2/sites-available
    2,purge apache2
    3,then reinstall apache2
    4,copy back my sites-available folder to apache2 new install folder (/etc/apache2)
    5,run a2ensite and a2enmod to enable sites and mods
    I just dont understand WHY apache2 got moved to the apparmor.d folder as i said be for i removed this months ago.
    Thank you for ur help and time

    UPDATE> i did steps 1-5 above and a2ensite shows my ispconfig but non of my other 10 sites and i still cant acces my site/ispconfig, im thinking a full os reinstall, tho i really dont want to do that as other parts of the sever are working ok (email, ssh, nfs shairs, openvpn)

    i really would like to
    1 know why this happend
    2 know how to stop it happening again
    3 know how to fix this so if it does happen again i can fix it.

    so like i say if u need any logs or configs info please ask and maybe we can sort this out togather :)

    thanks for any help people
     
    Last edited: May 22, 2016
  6. cjuk

    cjuk New Member

    i just fort i have daily backups of all the server can i just do a restore and all deleted config files will be replaced, if im correct ?

    UPDATE> scrap that plan the backups show apache2 is in the apparmor folder so same problem

     
    Last edited: May 22, 2016

Share This Page