Ubuntu Apache2 DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRootCan't start apache2?Apache2 giving SSLcertificateFile errorapache broke after upgradingwhile configuring apache2 server in ubuntu 12.04ltsLAMP server - Apache errorapache2 -V getting error messagesWhere is apache2.conf in ubuntu 16.04Apache2 syntax error AH00526 - while creating forward proxy vhost fileUbuntu 16.04, Apache, certbot, how to?Failed to start apache

What Brexit solution does the DUP want?

Is there a minimum number of transactions in a block?

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

Patience, young "Padovan"

The use of multiple foreign keys on same column in SQL Server

Download, install and reboot computer at night if needed

What is GPS' 19 year rollover and does it present a cybersecurity issue?

A function which translates a sentence to title-case

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

XeLaTeX and pdfLaTeX ignore hyphenation

Why is an old chain unsafe?

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

New order #4: World

Need help identifying/translating a plaque in Tangier, Morocco

Non-Jewish family in an Orthodox Jewish Wedding

How to make payment on the internet without leaving a money trail?

Why don't electron-positron collisions release infinite energy?

Are tax years 2016 & 2017 back taxes deductible for tax year 2018?

How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?

A Journey Through Space and Time

How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?

Motorized valve interfering with button?

When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?

How does one intimidate enemies without having the capacity for violence?



Ubuntu Apache2 DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot


Can't start apache2?Apache2 giving SSLcertificateFile errorapache broke after upgradingwhile configuring apache2 server in ubuntu 12.04ltsLAMP server - Apache errorapache2 -V getting error messagesWhere is apache2.conf in ubuntu 16.04Apache2 syntax error AH00526 - while creating forward proxy vhost fileUbuntu 16.04, Apache, certbot, how to?Failed to start apache






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








9















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?










share|improve this question






























    9















    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?










    share|improve this question


























      9












      9








      9


      3






      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?










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 20 '17 at 14:55









      Grayson Kent

      1,053414




      1,053414










      asked Jun 20 '17 at 13:29









      timhydtimhyd

      46113




      46113




















          5 Answers
          5






          active

          oldest

          votes


















          6














          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






          share|improve this answer




















          • 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


















          6














          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.






          share|improve this answer

























          • 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


















          4














          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






          share|improve this answer






























            0














            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"






            share|improve this answer






























              0














              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





              share|improve this answer










              New contributor




              Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.




















                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
                );



                );













                draft saved

                draft discarded


















                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









                6














                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






                share|improve this answer




















                • 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















                6














                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






                share|improve this answer




















                • 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













                6












                6








                6







                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






                share|improve this answer















                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







                share|improve this answer














                share|improve this answer



                share|improve this answer








                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












                • 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













                6














                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.






                share|improve this answer

























                • 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















                6














                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.






                share|improve this answer

























                • 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













                6












                6








                6







                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.






                share|improve this answer















                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.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Oct 10 '18 at 6:30









                Melebius

                5,09352040




                5,09352040










                answered Oct 10 '18 at 4:22









                ianmianm

                6112




                6112












                • 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
















                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











                4














                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






                share|improve this answer



























                  4














                  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






                  share|improve this answer

























                    4












                    4








                    4







                    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






                    share|improve this answer













                    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







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jun 26 '18 at 5:19









                    RocduferRocdufer

                    412




                    412





















                        0














                        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"






                        share|improve this answer



























                          0














                          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"






                          share|improve this answer

























                            0












                            0








                            0







                            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"






                            share|improve this answer













                            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"







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jan 10 at 12:14









                            Гдето ЯкутскийГдето Якутский

                            12




                            12





















                                0














                                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





                                share|improve this answer










                                New contributor




                                Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                Check out our Code of Conduct.
























                                  0














                                  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





                                  share|improve this answer










                                  New contributor




                                  Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                  Check out our Code of Conduct.






















                                    0












                                    0








                                    0







                                    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





                                    share|improve this answer










                                    New contributor




                                    Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.










                                    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






                                    share|improve this answer










                                    New contributor




                                    Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.









                                    share|improve this answer



                                    share|improve this answer








                                    edited 2 days ago









                                    Olimjon

                                    2,316724




                                    2,316724






                                    New contributor




                                    Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.









                                    answered 2 days ago









                                    Vladimir ChVladimir Ch

                                    1013




                                    1013




                                    New contributor




                                    Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.





                                    New contributor





                                    Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.






                                    Vladimir Ch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.



























                                        draft saved

                                        draft discarded
















































                                        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.




                                        draft saved


                                        draft discarded














                                        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





















































                                        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







                                        Popular posts from this blog

                                        Tamil (spriik) Luke uk diar | Nawigatjuun

                                        Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                                        Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?