S
S
slava kk2020-05-05 23:53:51
Apache HTTP Server
slava kk, 2020-05-05 23:53:51

Trouble starting apache2?

There is an error when starting apache2 on ubuntu. If we type "apache2" into the console, we get:

[Tue May 05 20:47:43.108133 2020] [core:warn] [pid 4944] 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


On the Internet I found that this problem is fixed by the following commands:
source /etc/apache2/envvars 
apache2 -V
service apache2 restart


Indeed, if you enter them into the console, the problem will disappear. But I need to use these commands in .sh file. And there are problems with their implementation.

Content of file.sh: Ran
source /etc/apache2/envvars
the script like this: bash file.sh
The script runs without errors, but the apache error does not go away. If, after the script has run, write "apache2" in the console, then we will get the above errors, i.e. nothing has changed.

How to use these commands in sh script?
Apache version: 2.4. Ubuntu: 18.04

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2020-05-06
@Rsa97

apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

Duc is written in English in white:
Syntax error on line 80 of the /etc/apache2/apache2.conf file: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

D
Dim Boy, 2020-05-05
@twix007

apache2.conf will we guess the config?

M
Mikhail Vasilyev, 2020-05-05
@vasilyevmn

Specify your version of puff.

sudo a2dismod php7.2
sudo a2enmod php7.2
sudo systemctl restart apache2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question