0

My problem originated from my website not loading on a almost-fresh install of Debian and an ISPConfig server, Apache and MariaDB only. It would resolve, but not loaded after site loaded once completely. Running apache2ctl status indicated returned that many of the Apache workers were stuck in "L" or logging state. I emptied all the logs, but to no avail. Randomly, I just ran apache2 on the terminal and saw a bunch of warnings indicating that none of the variables specified in /etc/apache2/envvars were set.

I generally use service apache2 restart to restart Apache. After searching the web, I found that sometimes one command may not load the envvars file. So I tried restarting with: service apache2 restart apache2ctl restart /etc/init.d/apache2 restart

None of these load the envvars. Sourcing the file (source /etc/apache2/envvars), makes it work, but only for a while, and then it stops working for a reason I can't determine. Checking the restart script, it seems envvars are accounted for.

Ideally I would not have to aplly the temporary fix by sourcing the file every time. Why is it not automatically running?

ashraj98
  • 163
  • 2
  • 8

3 Answers3

1

you may have to do:

apache2ctl stop && apache2ctl start

or

/etc/init.d/apache2 stop && /etc/init.d/apache2 start

as only "restart" doesn't seem to load the envvars file that is generated from envvars-std.in.

Castaglia
  • 3,349
  • 3
  • 21
  • 42
user340874
  • 11
  • 2
0

I can confirm this bug since I have exactly the same problem with my webserver. Once in a while I need to do source /etc/apache2/envvars in order to get it working again. I also use apache2 in conjunction with mariadb on Debian (Jessie).

Does anyone know how this could happen and what can be done about it to fix the problem? The weird thing is, I don't have this problem on other webservers.

Luna
  • 1
  • Since this is more of a "me, too!" it belongs more as a comment than as an answer/solution to the OP's posting. – Castaglia Feb 21 '16 at 19:57
0

My fix was to change from #!/bin/sh to #!/bin/bash inside /etc/init.d/apache2 . This might help you as well :)