Apache Webserver not starting

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.6
Webmin version 2.105
Usermin version 2.005
Virtualmin version 7.9.0
Theme version 21.09.5

hello, Apache Webserver not starting…when i go to /var/log/apache2/error.log i find it run the Command line: '/usr/sbin/apache2 then AH00493: SIGUSR1 received. Doing graceful restart and then AH00020: Configuration Failed, exiting after (AH00016: Configuration Failed)
when i run “/usr/sbin/apache2” i get this [core:warn] [pid 6311] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
and thats what on line 80 is DefaultRuntimeDir ${APACHE_RUN_DIR}
what should i do??

The first thing that comes to mind is did you add a domain or make any configuration or web site changes? At this point we don’t know if this is a new install or if it was working and got broken

hello, thanks for repondin @ID10T i did move a new server by using restore
and i tried How To Fix "DefaultRuntimeDir must be a valid directory" Error in Apache2 on Ubuntu Server | DeviceTests but it aint workin…

I believe that indicates you have restored Apache configuration from an old version of Ubuntu? You probably just need to remove that variable and replace it with the right value (whatever would have been set in /etc/default/apache2 on the old system, probably).

I’m only vaguely recalling the situation, but I know I have historically be very angry at Ubuntu for adding invalid syntax to the Apache config file and requiring it be pre-processed on service start. It’s ugly. One of many dumb things Ubuntu has done over the years.

But, it’s possible they still do this and the pre-processing isn’t happening in your case for some reason. I dunno. It hasn’t come up lately, so I just kind of assumed/hoped they realized what a dumbass idea that was.

hi @Joe but i did restore 4 website normally and the last one caused this! (and the 5 website was in the same server before)
and how do i know the right value that was set on the old server?
alos when i check /etc/default/apache2 by “sudo nano /etc/default/apache2” cuz i cant find it in webmin the file is empty is that normal?

look at the error

try sudo nano /etc/apache2/apache2.conf instead and see what line 80 is

hi @jimr1 and same line DefaultRuntimeDir ${APACHE_RUN_DIR}
i tried everything, but nothing work? what should i do? :confused:

As I said:

On the old system. Your new system won’t have it.

This is nonsense:

It means nothing to Apache. I explained how it got there. And, as I said, you need to get rid of it. I don’t know what the DefaultRuntimeDir is supposed to be on Ubuntu 20.04. Probably /var/run/apache2, but I’m guessing.

As I said:

On the old system. Your new system won’t have it.

yes i get it, but i cant even find /etc/default/apache2 to compare them…

I don’t know that’s the file. But, it’s defined somewhere on the old system (so you could use grep to find it in the /etc dir). But, it’s also probably fine to just leave it at the compiled in default and comment out the whole danged line. I don’t have it defined explicitly on my systems (but I don’t use/like Ubuntu, and this kind of nonsense is why).

1 Like

if anyone having this issue, u just have to change the website SSL, and thats it…

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.