A recent update made my server on my lan inaccessible on port 80. I was able to ssh into it on 22, and nmap revealed that it was listening on 22, 443, 3306 and 10000. However, NOT 80. A great deal of cat on various .conf files failed to turn up an answer.

Finally after many hours, the first reply in this post: by Florian Diesch revealed the first step in ferreting out the problem.

His suggestion to place another server on that machine like this: sudo python -m SimpleHTTPServer 80, revealed that there was not really a problem with apache2, just that one of the conf files was broken.

Before having port 80 available at all, I could not get systemctl status apache2.service to work at all, however after getting some listening going on for port 80 with the python snippet above, I got this result:

systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
Active: failed (Result: exit-code) since Tue 2017-06-13 20:40:43 EDT; 
39s ago
 Docs: man:systemd-sysv-generator(8)
 Process: 4411 ExecStart=/etc/init.d/apache2 start (code=exited, 

 Jun 13 20:40:43 s2 apache2[4411]:  * The apache2 configtest failed.
 Jun 13 20:40:43 s2 apache2[4411]: Output of config test was:
 Jun 13 20:40:43 s2 apache2[4411]: AH00526: Syntax error on line 5 of 
 Jun 13 20:40:43 s2 apache2[4411]: order not allowed here
 Jun 13 20:40:43 s2 apache2[4411]: Action 'configtest' failed.
 Jun 13 20:40:43 s2 apache2[4411]: The Apache error log may have more 

Several more lines followed, but the salient point was phpmyadmin.conf and "order not allowed here".

I edited phpmyadmin.conf and found this:

    Alias /phpmyadmin /usr/share/phpmyadmin

    Order Deny, Allow
    Deny from all
    Allow from
    Allow from 192.1.0
    Allow from 192.1.1

    <Directory /usr/share/phpmyadmin>
         various configs .....

I proceeded to comment out with # the line with "Order", save the conf file and then test again. Each time the error would show again with the offending line number incremented by one. When I had every one of those five lines before the first configuration block commented out, everything worked again. Neither my son nor I could figure out how the error appeared because neither of us had edited the file.

However, I finally remember that earlier that day, I had ssh'd into the server and did an update/upgrade cycle. That is the only possible source of these five lines getting into the phpmyadmin.conf file.

I must admit I was totally stumped by finding out that was the source of the problem. It was actually killing the apache2 service completely for port 80. I finally realize the apache2.conf file itself was including the other files as it loaded, thereby introducing the problem conf file.

12 hours of troubleshooting, but finally got it working after following many many rabbits down various holes from a LOT of searches.

Hope someone else may benefit from these revelations.

  • What's the question ? – Soren A Jun 14 '17 at 10:31
  • Op was just sharing info to help others. – EODCraft Staff Jun 14 '17 at 10:40

Order, alloe and deny are obviosly not allowed in that place. They can only be used with some modules (https://httpd.apache.org/docs/2.2/howto/access.html)

Before your update, the then version of apache might have ignored or warned about the error. The new version choose to fail. When you have problems like this, always run the apache configtest program, and if the error isn't obvious, look the directives up in the Apache manual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.