Ubuntu Apache2 DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have a web server running Ubuntu 17.04 that I am attempting to set up with Apache
. Everything ran great until I decided to host two websites on a single machine through virtualHosts. Now apache
refuses to start up with even a single host enabled. Each time I attempt to start Apache
I get this error:
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf:
DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot.
None of my attempts to fix this have come to anything including:
apt purge apache2 && rm -r /etc/apache2
All line 80 of the error message tells me is DefaultRuntimeDir ${APACHE_RUN_DIR}
.
And at no time do I see where or what APACHE_RUN_DIR
is declared as.
Can someone help me out?
server apache2 directory
add a comment |
I have a web server running Ubuntu 17.04 that I am attempting to set up with Apache
. Everything ran great until I decided to host two websites on a single machine through virtualHosts. Now apache
refuses to start up with even a single host enabled. Each time I attempt to start Apache
I get this error:
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf:
DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot.
None of my attempts to fix this have come to anything including:
apt purge apache2 && rm -r /etc/apache2
All line 80 of the error message tells me is DefaultRuntimeDir ${APACHE_RUN_DIR}
.
And at no time do I see where or what APACHE_RUN_DIR
is declared as.
Can someone help me out?
server apache2 directory
add a comment |
I have a web server running Ubuntu 17.04 that I am attempting to set up with Apache
. Everything ran great until I decided to host two websites on a single machine through virtualHosts. Now apache
refuses to start up with even a single host enabled. Each time I attempt to start Apache
I get this error:
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf:
DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot.
None of my attempts to fix this have come to anything including:
apt purge apache2 && rm -r /etc/apache2
All line 80 of the error message tells me is DefaultRuntimeDir ${APACHE_RUN_DIR}
.
And at no time do I see where or what APACHE_RUN_DIR
is declared as.
Can someone help me out?
server apache2 directory
I have a web server running Ubuntu 17.04 that I am attempting to set up with Apache
. Everything ran great until I decided to host two websites on a single machine through virtualHosts. Now apache
refuses to start up with even a single host enabled. Each time I attempt to start Apache
I get this error:
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf:
DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot.
None of my attempts to fix this have come to anything including:
apt purge apache2 && rm -r /etc/apache2
All line 80 of the error message tells me is DefaultRuntimeDir ${APACHE_RUN_DIR}
.
And at no time do I see where or what APACHE_RUN_DIR
is declared as.
Can someone help me out?
server apache2 directory
server apache2 directory
edited Jun 20 '17 at 14:55
Grayson Kent
1,053414
1,053414
asked Jun 20 '17 at 13:29
timhydtimhyd
46113
46113
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
Apache2 uses /etc/apache2/envvars
to set environment variables. You can use this information to make sure the directory ${APACHE_RUN_DIR}
points to is valid.
I was experiencing the same issue while upgrading from 14.04 to 17.04.
Problem was: ${APACHE_RUN_DIR}
was set to /var/run/apache2
, but the apache2 folder was missing in /var/run
.
The fix for me was: mkdir /var/run/apache2
7
even if you created the folder or if the folder is already presented (like in my situation) you have to have to run the following command.source /etc/apache2/envvars
– Peshmerge
Oct 29 '17 at 23:17
you only need to run the envvares command if you are starting Apache without the startscript, if you are using init.d/system.d the file will be sourced automatically.
– Niyol
Oct 31 '17 at 10:00
@Peshmerge THanks! can you tell me how to retain it after reboot? it seems on reboot we have to manually execute that command everytime
– T.Todua
Oct 19 '18 at 16:28
add a comment |
The command
source /etc/apache2/envvars
sorted my problem out (after trying ALL the others).
To check whether all is well or not use the command
apache2 -S
I found that was quicker than using my DNS records.
I used thesource /etc/apache2/envvars
but after that my home directory changed from~
tohome
and when I wrote cd it showed-bash: cd: HOME not set
. When I entered the envvars one of the first lines is# this won't be correct after changing uid
andunset HOME
. Any idea how to fix this?
– Mihail Minkov
Mar 21 at 0:58
add a comment |
There is a missing update in "man apache2", at least for option -V;
Today, one should use either "apachectl" or "apache2ctl" instead of
"apache2" for at least some options, as stated in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879571
add a comment |
in my case it was regarding "Require all denied" line in apache2.conf file which (again) in my case was typed in as just "Require denied"
add a comment |
Reenebling php5.6
apache module helps to fix this problem.
Press Ctrl+Alt+T and type these:
sudo a2dismod php5.6
sudo a2enmod php5.6
Then restart apache2 service:
sudo service apache2 restart
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f927355%2fubuntu-apache2-defaultruntimedir-must-be-a-valid-directory-absolute-or-relative%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Apache2 uses /etc/apache2/envvars
to set environment variables. You can use this information to make sure the directory ${APACHE_RUN_DIR}
points to is valid.
I was experiencing the same issue while upgrading from 14.04 to 17.04.
Problem was: ${APACHE_RUN_DIR}
was set to /var/run/apache2
, but the apache2 folder was missing in /var/run
.
The fix for me was: mkdir /var/run/apache2
7
even if you created the folder or if the folder is already presented (like in my situation) you have to have to run the following command.source /etc/apache2/envvars
– Peshmerge
Oct 29 '17 at 23:17
you only need to run the envvares command if you are starting Apache without the startscript, if you are using init.d/system.d the file will be sourced automatically.
– Niyol
Oct 31 '17 at 10:00
@Peshmerge THanks! can you tell me how to retain it after reboot? it seems on reboot we have to manually execute that command everytime
– T.Todua
Oct 19 '18 at 16:28
add a comment |
Apache2 uses /etc/apache2/envvars
to set environment variables. You can use this information to make sure the directory ${APACHE_RUN_DIR}
points to is valid.
I was experiencing the same issue while upgrading from 14.04 to 17.04.
Problem was: ${APACHE_RUN_DIR}
was set to /var/run/apache2
, but the apache2 folder was missing in /var/run
.
The fix for me was: mkdir /var/run/apache2
7
even if you created the folder or if the folder is already presented (like in my situation) you have to have to run the following command.source /etc/apache2/envvars
– Peshmerge
Oct 29 '17 at 23:17
you only need to run the envvares command if you are starting Apache without the startscript, if you are using init.d/system.d the file will be sourced automatically.
– Niyol
Oct 31 '17 at 10:00
@Peshmerge THanks! can you tell me how to retain it after reboot? it seems on reboot we have to manually execute that command everytime
– T.Todua
Oct 19 '18 at 16:28
add a comment |
Apache2 uses /etc/apache2/envvars
to set environment variables. You can use this information to make sure the directory ${APACHE_RUN_DIR}
points to is valid.
I was experiencing the same issue while upgrading from 14.04 to 17.04.
Problem was: ${APACHE_RUN_DIR}
was set to /var/run/apache2
, but the apache2 folder was missing in /var/run
.
The fix for me was: mkdir /var/run/apache2
Apache2 uses /etc/apache2/envvars
to set environment variables. You can use this information to make sure the directory ${APACHE_RUN_DIR}
points to is valid.
I was experiencing the same issue while upgrading from 14.04 to 17.04.
Problem was: ${APACHE_RUN_DIR}
was set to /var/run/apache2
, but the apache2 folder was missing in /var/run
.
The fix for me was: mkdir /var/run/apache2
edited Sep 26 '17 at 11:01
Yaron
9,26971941
9,26971941
answered Sep 26 '17 at 8:27
NiyolNiyol
6112
6112
7
even if you created the folder or if the folder is already presented (like in my situation) you have to have to run the following command.source /etc/apache2/envvars
– Peshmerge
Oct 29 '17 at 23:17
you only need to run the envvares command if you are starting Apache without the startscript, if you are using init.d/system.d the file will be sourced automatically.
– Niyol
Oct 31 '17 at 10:00
@Peshmerge THanks! can you tell me how to retain it after reboot? it seems on reboot we have to manually execute that command everytime
– T.Todua
Oct 19 '18 at 16:28
add a comment |
7
even if you created the folder or if the folder is already presented (like in my situation) you have to have to run the following command.source /etc/apache2/envvars
– Peshmerge
Oct 29 '17 at 23:17
you only need to run the envvares command if you are starting Apache without the startscript, if you are using init.d/system.d the file will be sourced automatically.
– Niyol
Oct 31 '17 at 10:00
@Peshmerge THanks! can you tell me how to retain it after reboot? it seems on reboot we have to manually execute that command everytime
– T.Todua
Oct 19 '18 at 16:28
7
7
even if you created the folder or if the folder is already presented (like in my situation) you have to have to run the following command.
source /etc/apache2/envvars
– Peshmerge
Oct 29 '17 at 23:17
even if you created the folder or if the folder is already presented (like in my situation) you have to have to run the following command.
source /etc/apache2/envvars
– Peshmerge
Oct 29 '17 at 23:17
you only need to run the envvares command if you are starting Apache without the startscript, if you are using init.d/system.d the file will be sourced automatically.
– Niyol
Oct 31 '17 at 10:00
you only need to run the envvares command if you are starting Apache without the startscript, if you are using init.d/system.d the file will be sourced automatically.
– Niyol
Oct 31 '17 at 10:00
@Peshmerge THanks! can you tell me how to retain it after reboot? it seems on reboot we have to manually execute that command everytime
– T.Todua
Oct 19 '18 at 16:28
@Peshmerge THanks! can you tell me how to retain it after reboot? it seems on reboot we have to manually execute that command everytime
– T.Todua
Oct 19 '18 at 16:28
add a comment |
The command
source /etc/apache2/envvars
sorted my problem out (after trying ALL the others).
To check whether all is well or not use the command
apache2 -S
I found that was quicker than using my DNS records.
I used thesource /etc/apache2/envvars
but after that my home directory changed from~
tohome
and when I wrote cd it showed-bash: cd: HOME not set
. When I entered the envvars one of the first lines is# this won't be correct after changing uid
andunset HOME
. Any idea how to fix this?
– Mihail Minkov
Mar 21 at 0:58
add a comment |
The command
source /etc/apache2/envvars
sorted my problem out (after trying ALL the others).
To check whether all is well or not use the command
apache2 -S
I found that was quicker than using my DNS records.
I used thesource /etc/apache2/envvars
but after that my home directory changed from~
tohome
and when I wrote cd it showed-bash: cd: HOME not set
. When I entered the envvars one of the first lines is# this won't be correct after changing uid
andunset HOME
. Any idea how to fix this?
– Mihail Minkov
Mar 21 at 0:58
add a comment |
The command
source /etc/apache2/envvars
sorted my problem out (after trying ALL the others).
To check whether all is well or not use the command
apache2 -S
I found that was quicker than using my DNS records.
The command
source /etc/apache2/envvars
sorted my problem out (after trying ALL the others).
To check whether all is well or not use the command
apache2 -S
I found that was quicker than using my DNS records.
edited Oct 10 '18 at 6:30
Melebius
5,09352041
5,09352041
answered Oct 10 '18 at 4:22
ianmianm
6112
6112
I used thesource /etc/apache2/envvars
but after that my home directory changed from~
tohome
and when I wrote cd it showed-bash: cd: HOME not set
. When I entered the envvars one of the first lines is# this won't be correct after changing uid
andunset HOME
. Any idea how to fix this?
– Mihail Minkov
Mar 21 at 0:58
add a comment |
I used thesource /etc/apache2/envvars
but after that my home directory changed from~
tohome
and when I wrote cd it showed-bash: cd: HOME not set
. When I entered the envvars one of the first lines is# this won't be correct after changing uid
andunset HOME
. Any idea how to fix this?
– Mihail Minkov
Mar 21 at 0:58
I used the
source /etc/apache2/envvars
but after that my home directory changed from ~
to home
and when I wrote cd it showed -bash: cd: HOME not set
. When I entered the envvars one of the first lines is # this won't be correct after changing uid
and unset HOME
. Any idea how to fix this?– Mihail Minkov
Mar 21 at 0:58
I used the
source /etc/apache2/envvars
but after that my home directory changed from ~
to home
and when I wrote cd it showed -bash: cd: HOME not set
. When I entered the envvars one of the first lines is # this won't be correct after changing uid
and unset HOME
. Any idea how to fix this?– Mihail Minkov
Mar 21 at 0:58
add a comment |
There is a missing update in "man apache2", at least for option -V;
Today, one should use either "apachectl" or "apache2ctl" instead of
"apache2" for at least some options, as stated in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879571
add a comment |
There is a missing update in "man apache2", at least for option -V;
Today, one should use either "apachectl" or "apache2ctl" instead of
"apache2" for at least some options, as stated in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879571
add a comment |
There is a missing update in "man apache2", at least for option -V;
Today, one should use either "apachectl" or "apache2ctl" instead of
"apache2" for at least some options, as stated in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879571
There is a missing update in "man apache2", at least for option -V;
Today, one should use either "apachectl" or "apache2ctl" instead of
"apache2" for at least some options, as stated in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879571
answered Jun 26 '18 at 5:19
RocduferRocdufer
412
412
add a comment |
add a comment |
in my case it was regarding "Require all denied" line in apache2.conf file which (again) in my case was typed in as just "Require denied"
add a comment |
in my case it was regarding "Require all denied" line in apache2.conf file which (again) in my case was typed in as just "Require denied"
add a comment |
in my case it was regarding "Require all denied" line in apache2.conf file which (again) in my case was typed in as just "Require denied"
in my case it was regarding "Require all denied" line in apache2.conf file which (again) in my case was typed in as just "Require denied"
answered Jan 10 at 12:14
Гдето ЯкутскийГдето Якутский
12
12
add a comment |
add a comment |
Reenebling php5.6
apache module helps to fix this problem.
Press Ctrl+Alt+T and type these:
sudo a2dismod php5.6
sudo a2enmod php5.6
Then restart apache2 service:
sudo service apache2 restart
New contributor
add a comment |
Reenebling php5.6
apache module helps to fix this problem.
Press Ctrl+Alt+T and type these:
sudo a2dismod php5.6
sudo a2enmod php5.6
Then restart apache2 service:
sudo service apache2 restart
New contributor
add a comment |
Reenebling php5.6
apache module helps to fix this problem.
Press Ctrl+Alt+T and type these:
sudo a2dismod php5.6
sudo a2enmod php5.6
Then restart apache2 service:
sudo service apache2 restart
New contributor
Reenebling php5.6
apache module helps to fix this problem.
Press Ctrl+Alt+T and type these:
sudo a2dismod php5.6
sudo a2enmod php5.6
Then restart apache2 service:
sudo service apache2 restart
New contributor
edited 2 days ago
Olimjon
2,316724
2,316724
New contributor
answered 2 days ago
Vladimir ChVladimir Ch
1013
1013
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f927355%2fubuntu-apache2-defaultruntimedir-must-be-a-valid-directory-absolute-or-relative%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown