LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-06-2018, 12:10 PM   #1
myregm
LQ Newbie
 
Registered: Aug 2018
Posts: 2

Rep: Reputation: Disabled
Apache2 - AH00111: Config variable ${APACHE_RUN_DIR} is not defined


Hi. I've some problems with apache2.
When I enter
Code:
service apache2 start
this error appears:
Quote:
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
I tried to enter
Code:
apache2
and this error apears:
Quote:
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
In line 80 of /etc/apache2/apache2.conf I have this:
Quote:
DefaultRuntimeDir ${APACHE_RUN_DIR}
I searched on the net to find out where ${APACHE_RUN_DIR} is pointing to but didn't get anything.

Can you please help me?

update:
I've find out where ${APACHE_RUN_DIR} is pointing to. It's
Quote:
/var/run/apache2
I already have this directory but it's empty. Should it be empty? What do you think my problem is?

Last edited by myregm; 08-06-2018 at 12:27 PM.
 
Old 08-06-2018, 12:51 PM   #2
myregm
LQ Newbie
 
Registered: Aug 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
I have solved it by:
Quote:
sudo a2dismod php7.2
sudo a2enmod php7.2
sudo systemctl restart apache2
visit
https://www.tecmint.com/install-diff...ons-in-ubuntu/
for more info.
 
Old 10-17-2018, 02:50 AM   #3
pegr69
LQ Newbie
 
Registered: Oct 2018
Posts: 1

Rep: Reputation: Disabled
Use the new apache2ctl script and all will be fine(should be at least).
 
Old 04-03-2019, 06:57 AM   #4
jee.
LQ Newbie
 
Registered: Apr 2019
Posts: 1

Rep: Reputation: Disabled
@myregm That was not the solution

@myregm That was not the solution of the problem.

Basically you tried to start Apache with an unsupported command that failed with a syntax error. That was the problem.
The supported commands are /etc/init.d/apache2, apachectl and apache2ctl. Do not use the "apache2" command.

By disabling and re-enabling the php module nothing actually changed since that only deleted and recreated a symlink.

When you started Apache server using a supported method the problem went away. Running a valid command was the actual solution as @pegr69 pointed out.

You can see the error by simply running "apache2 -S". This command is safe and won't interfere with your running Apache server.

(see: /usr/share/doc/apache2/README.Debian.gz)
 
Old 04-14-2019, 11:29 PM   #5
gbell12
LQ Newbie
 
Registered: Aug 2015
Posts: 11

Rep: Reputation: Disabled
Quote:
You can see the error by simply running "apache2 -S". This command is safe and won't interfere with your running Apache server.
Meaning, you'll see the same error, but safely because -S just dumps. Probably not useful, since he was getting that error anyway.

But wait, what if you need the functionality of apache2 -S?

jee. points us to /usr/share/doc/apache2/README.Debian.gz, which says, deep down in the FAQ:

Quote:
8) Message "apache2: bad user name ${APACHE_RUN_USER}" when starting apache2
directly

Use apache2ctl (it accepts all the same options as apache2).
Ah, so apache2ctl is what we should be using for everything! A bit odd that there's an available apache2, but "don't use it!" Turns out apache2ctl wraps apache2.
 
Old 03-09-2021, 05:05 PM   #6
Psype
LQ Newbie
 
Registered: Mar 2021
Posts: 1

Rep: Reputation: Disabled
Hi guys, sorry for digging, but I found a kind of solution (if you only manage one instance of Apache2)

I added that line right before DefaultRuntimeDir in /etc/apache2/apache2.conf :

Code:
SetEnvIf APACHE_RUN_DIR ^$ APACHE_RUN_DIR=/var/run/apache2
DefaultRuntimeDir ${APACHE_RUN_DIR}
... So if somehow it works again, it won't go in the SetEnvIf...
Of course you might need mod_setenvif I guess.

Cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to find out in which file variable has been defined. manoj.linux Linux - Enterprise 1 12-05-2014 10:01 AM
Common Lisp: Variable Defined but Not Used hydraMax Programming 2 11-10-2013 02:13 AM
[SOLVED] CATALINA_HOME environment variable has not been defined. Aquarius_Girl Linux - Software 3 11-23-2012 04:05 AM
Get value for variable name defined as string webquinty Programming 4 11-18-2009 05:30 AM
Replace variable with user defined variable ce124 Programming 10 04-13-2007 09:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration