How to auto-start a service (apache2) with Linux Mint












10















(Strangley) My installed Apache2 does not start up when logging in to Linux Mint.



Running this command gets it going:



sudo service apache2 start


How should I attempt to start up this service upon each login?










share|improve this question























  • You could place that command in ~/.xinitrc, which will be run at startup.

    – n0pe
    Mar 8 '12 at 19:25






  • 1





    @MaxMackie On the contrary, ~/.xinitrc is run at login time, which isn't right. Apache needs to be started by root at boot time.

    – Gilles
    Mar 8 '12 at 23:23











  • @Gilles, right I forgot about that, thanks for correcting. However, why does apache need to be started at boot? Wouldn't login accomplish roughly the same thing?

    – n0pe
    Mar 8 '12 at 23:54











  • @MaxMackie Not if you don't log in immediately after boot, obviously. Also Apache doesn't run as you, so you'd have to grant it privileges. It should start at part of the boot scripts, and normally does.

    – Gilles
    Mar 8 '12 at 23:57











  • @Gilles right. Thanks for shedding light on that.

    – n0pe
    Mar 9 '12 at 0:32
















10















(Strangley) My installed Apache2 does not start up when logging in to Linux Mint.



Running this command gets it going:



sudo service apache2 start


How should I attempt to start up this service upon each login?










share|improve this question























  • You could place that command in ~/.xinitrc, which will be run at startup.

    – n0pe
    Mar 8 '12 at 19:25






  • 1





    @MaxMackie On the contrary, ~/.xinitrc is run at login time, which isn't right. Apache needs to be started by root at boot time.

    – Gilles
    Mar 8 '12 at 23:23











  • @Gilles, right I forgot about that, thanks for correcting. However, why does apache need to be started at boot? Wouldn't login accomplish roughly the same thing?

    – n0pe
    Mar 8 '12 at 23:54











  • @MaxMackie Not if you don't log in immediately after boot, obviously. Also Apache doesn't run as you, so you'd have to grant it privileges. It should start at part of the boot scripts, and normally does.

    – Gilles
    Mar 8 '12 at 23:57











  • @Gilles right. Thanks for shedding light on that.

    – n0pe
    Mar 9 '12 at 0:32














10












10








10


7






(Strangley) My installed Apache2 does not start up when logging in to Linux Mint.



Running this command gets it going:



sudo service apache2 start


How should I attempt to start up this service upon each login?










share|improve this question














(Strangley) My installed Apache2 does not start up when logging in to Linux Mint.



Running this command gets it going:



sudo service apache2 start


How should I attempt to start up this service upon each login?







linux-mint startup






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 '12 at 19:21









eoinoceoinoc

71661528




71661528













  • You could place that command in ~/.xinitrc, which will be run at startup.

    – n0pe
    Mar 8 '12 at 19:25






  • 1





    @MaxMackie On the contrary, ~/.xinitrc is run at login time, which isn't right. Apache needs to be started by root at boot time.

    – Gilles
    Mar 8 '12 at 23:23











  • @Gilles, right I forgot about that, thanks for correcting. However, why does apache need to be started at boot? Wouldn't login accomplish roughly the same thing?

    – n0pe
    Mar 8 '12 at 23:54











  • @MaxMackie Not if you don't log in immediately after boot, obviously. Also Apache doesn't run as you, so you'd have to grant it privileges. It should start at part of the boot scripts, and normally does.

    – Gilles
    Mar 8 '12 at 23:57











  • @Gilles right. Thanks for shedding light on that.

    – n0pe
    Mar 9 '12 at 0:32



















  • You could place that command in ~/.xinitrc, which will be run at startup.

    – n0pe
    Mar 8 '12 at 19:25






  • 1





    @MaxMackie On the contrary, ~/.xinitrc is run at login time, which isn't right. Apache needs to be started by root at boot time.

    – Gilles
    Mar 8 '12 at 23:23











  • @Gilles, right I forgot about that, thanks for correcting. However, why does apache need to be started at boot? Wouldn't login accomplish roughly the same thing?

    – n0pe
    Mar 8 '12 at 23:54











  • @MaxMackie Not if you don't log in immediately after boot, obviously. Also Apache doesn't run as you, so you'd have to grant it privileges. It should start at part of the boot scripts, and normally does.

    – Gilles
    Mar 8 '12 at 23:57











  • @Gilles right. Thanks for shedding light on that.

    – n0pe
    Mar 9 '12 at 0:32

















You could place that command in ~/.xinitrc, which will be run at startup.

– n0pe
Mar 8 '12 at 19:25





You could place that command in ~/.xinitrc, which will be run at startup.

– n0pe
Mar 8 '12 at 19:25




1




1





@MaxMackie On the contrary, ~/.xinitrc is run at login time, which isn't right. Apache needs to be started by root at boot time.

– Gilles
Mar 8 '12 at 23:23





@MaxMackie On the contrary, ~/.xinitrc is run at login time, which isn't right. Apache needs to be started by root at boot time.

– Gilles
Mar 8 '12 at 23:23













@Gilles, right I forgot about that, thanks for correcting. However, why does apache need to be started at boot? Wouldn't login accomplish roughly the same thing?

– n0pe
Mar 8 '12 at 23:54





@Gilles, right I forgot about that, thanks for correcting. However, why does apache need to be started at boot? Wouldn't login accomplish roughly the same thing?

– n0pe
Mar 8 '12 at 23:54













@MaxMackie Not if you don't log in immediately after boot, obviously. Also Apache doesn't run as you, so you'd have to grant it privileges. It should start at part of the boot scripts, and normally does.

– Gilles
Mar 8 '12 at 23:57





@MaxMackie Not if you don't log in immediately after boot, obviously. Also Apache doesn't run as you, so you'd have to grant it privileges. It should start at part of the boot scripts, and normally does.

– Gilles
Mar 8 '12 at 23:57













@Gilles right. Thanks for shedding light on that.

– n0pe
Mar 9 '12 at 0:32





@Gilles right. Thanks for shedding light on that.

– n0pe
Mar 9 '12 at 0:32










5 Answers
5






active

oldest

votes


















12














Debian (Ubuntu/Linux Mint)




rcconf (CLI-GUI)



sudo apt-get install rcconf
sudo rcconf


update-rc.d



sudo update-rc.d -f apache2 add


or



sudo update-rc.d apache2 defaults


RedHat/Fedora/CentOS



chkconfig



sudo chkconfig --add apache2


or



sudo chkconfig -- level 35 apache2 on





share|improve this answer


























  • Apache was already checked when I ran rcconf.

    – eoinoc
    Jun 24 '12 at 6:52











  • Running the update-rc.d command lead to an error: update-rc.d: warning: apache2 start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5).

    – eoinoc
    Jun 24 '12 at 6:53













  • Have you given update-rc.d apache2 defaults or update-rc.d -f apache2 add 3 5

    – earthmeLon
    Jun 24 '12 at 20:35






  • 1





    Thanks, but neither worked. First resulted in an "already exists" warning, the second resulted in warning: apache2 start runlevel arguments (none) do not batch LSB default-Start values (2 3 4 5).

    – eoinoc
    Jun 27 '12 at 19:38



















6














Since Mint is based on Ubuntu, and Ubuntu has switched to Upstart, the Upstart Cookbook has all of the info for having a service start on boot, or at any specified runlevel.



This site
Gives a detailed cookbook for starting Apache at boot.






share|improve this answer


























  • That page talks about placing a bash script in /etc/init.d/apache2. But that file is full of a much more complicated bash script already, which must have been placed there by Apache itself.

    – eoinoc
    Jun 24 '12 at 6:50



















3














Another cause of the same problem is the priority of the apache links in rc[0-6].d. Mine were S90 and K09, and Apache wouldn't start at boot. Setting the priorities at their defaults, 20, worked for me. The existing links need to be removed first.



sudo update-rc.d -f apache2 remove
sudo update-rc.d apache2 defaults





share|improve this answer































    2














    At shutdown, I saw an error:




    Syntax error on line 230 of /etc/apach2/apache.conf
    ....
    /etc/apache/sites-enables/mysite: No such file or directory




    The thing was, mysite was symlinked to a file in my home folder.



    That normally shouldn't be a problem, I thought.



    But as far as I know, my home partition is encrypted. Therefore, I'm guessing that Apache could not read the virtual site file when it was loading. The file wasn't accessible until I type in my password.



    A complex situation, and took months to work it out :)






    share|improve this answer
























    • So how did you work it out?

      – Jonas Äppelgran
      Dec 2 '17 at 23:10



















    0














    A new answer updated in 2019:




    sudo systemctl start httpd



    sudo systemctl enable httpd




    The systemctl command is a new tool to control the systemd system and service. This is the replacement of old SysV init system management. Most of modern Linux operating systems are using this new tool. If you are working with CentOS 7, Ubuntu 16.04 or later or Debian 9 system. They have opted systemd now.



    The enabled service autostarts on system boot. This is the similar option for systemd than chkconfig for the SysV init.





    share








    New contributor




    rauldeng 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: "106"
      };
      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: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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%2funix.stackexchange.com%2fquestions%2f33793%2fhow-to-auto-start-a-service-apache2-with-linux-mint%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









      12














      Debian (Ubuntu/Linux Mint)




      rcconf (CLI-GUI)



      sudo apt-get install rcconf
      sudo rcconf


      update-rc.d



      sudo update-rc.d -f apache2 add


      or



      sudo update-rc.d apache2 defaults


      RedHat/Fedora/CentOS



      chkconfig



      sudo chkconfig --add apache2


      or



      sudo chkconfig -- level 35 apache2 on





      share|improve this answer


























      • Apache was already checked when I ran rcconf.

        – eoinoc
        Jun 24 '12 at 6:52











      • Running the update-rc.d command lead to an error: update-rc.d: warning: apache2 start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5).

        – eoinoc
        Jun 24 '12 at 6:53













      • Have you given update-rc.d apache2 defaults or update-rc.d -f apache2 add 3 5

        – earthmeLon
        Jun 24 '12 at 20:35






      • 1





        Thanks, but neither worked. First resulted in an "already exists" warning, the second resulted in warning: apache2 start runlevel arguments (none) do not batch LSB default-Start values (2 3 4 5).

        – eoinoc
        Jun 27 '12 at 19:38
















      12














      Debian (Ubuntu/Linux Mint)




      rcconf (CLI-GUI)



      sudo apt-get install rcconf
      sudo rcconf


      update-rc.d



      sudo update-rc.d -f apache2 add


      or



      sudo update-rc.d apache2 defaults


      RedHat/Fedora/CentOS



      chkconfig



      sudo chkconfig --add apache2


      or



      sudo chkconfig -- level 35 apache2 on





      share|improve this answer


























      • Apache was already checked when I ran rcconf.

        – eoinoc
        Jun 24 '12 at 6:52











      • Running the update-rc.d command lead to an error: update-rc.d: warning: apache2 start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5).

        – eoinoc
        Jun 24 '12 at 6:53













      • Have you given update-rc.d apache2 defaults or update-rc.d -f apache2 add 3 5

        – earthmeLon
        Jun 24 '12 at 20:35






      • 1





        Thanks, but neither worked. First resulted in an "already exists" warning, the second resulted in warning: apache2 start runlevel arguments (none) do not batch LSB default-Start values (2 3 4 5).

        – eoinoc
        Jun 27 '12 at 19:38














      12












      12








      12







      Debian (Ubuntu/Linux Mint)




      rcconf (CLI-GUI)



      sudo apt-get install rcconf
      sudo rcconf


      update-rc.d



      sudo update-rc.d -f apache2 add


      or



      sudo update-rc.d apache2 defaults


      RedHat/Fedora/CentOS



      chkconfig



      sudo chkconfig --add apache2


      or



      sudo chkconfig -- level 35 apache2 on





      share|improve this answer















      Debian (Ubuntu/Linux Mint)




      rcconf (CLI-GUI)



      sudo apt-get install rcconf
      sudo rcconf


      update-rc.d



      sudo update-rc.d -f apache2 add


      or



      sudo update-rc.d apache2 defaults


      RedHat/Fedora/CentOS



      chkconfig



      sudo chkconfig --add apache2


      or



      sudo chkconfig -- level 35 apache2 on






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jun 24 '12 at 20:38

























      answered Mar 24 '12 at 5:01









      earthmeLonearthmeLon

      8101514




      8101514













      • Apache was already checked when I ran rcconf.

        – eoinoc
        Jun 24 '12 at 6:52











      • Running the update-rc.d command lead to an error: update-rc.d: warning: apache2 start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5).

        – eoinoc
        Jun 24 '12 at 6:53













      • Have you given update-rc.d apache2 defaults or update-rc.d -f apache2 add 3 5

        – earthmeLon
        Jun 24 '12 at 20:35






      • 1





        Thanks, but neither worked. First resulted in an "already exists" warning, the second resulted in warning: apache2 start runlevel arguments (none) do not batch LSB default-Start values (2 3 4 5).

        – eoinoc
        Jun 27 '12 at 19:38



















      • Apache was already checked when I ran rcconf.

        – eoinoc
        Jun 24 '12 at 6:52











      • Running the update-rc.d command lead to an error: update-rc.d: warning: apache2 start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5).

        – eoinoc
        Jun 24 '12 at 6:53













      • Have you given update-rc.d apache2 defaults or update-rc.d -f apache2 add 3 5

        – earthmeLon
        Jun 24 '12 at 20:35






      • 1





        Thanks, but neither worked. First resulted in an "already exists" warning, the second resulted in warning: apache2 start runlevel arguments (none) do not batch LSB default-Start values (2 3 4 5).

        – eoinoc
        Jun 27 '12 at 19:38

















      Apache was already checked when I ran rcconf.

      – eoinoc
      Jun 24 '12 at 6:52





      Apache was already checked when I ran rcconf.

      – eoinoc
      Jun 24 '12 at 6:52













      Running the update-rc.d command lead to an error: update-rc.d: warning: apache2 start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5).

      – eoinoc
      Jun 24 '12 at 6:53







      Running the update-rc.d command lead to an error: update-rc.d: warning: apache2 start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5).

      – eoinoc
      Jun 24 '12 at 6:53















      Have you given update-rc.d apache2 defaults or update-rc.d -f apache2 add 3 5

      – earthmeLon
      Jun 24 '12 at 20:35





      Have you given update-rc.d apache2 defaults or update-rc.d -f apache2 add 3 5

      – earthmeLon
      Jun 24 '12 at 20:35




      1




      1





      Thanks, but neither worked. First resulted in an "already exists" warning, the second resulted in warning: apache2 start runlevel arguments (none) do not batch LSB default-Start values (2 3 4 5).

      – eoinoc
      Jun 27 '12 at 19:38





      Thanks, but neither worked. First resulted in an "already exists" warning, the second resulted in warning: apache2 start runlevel arguments (none) do not batch LSB default-Start values (2 3 4 5).

      – eoinoc
      Jun 27 '12 at 19:38













      6














      Since Mint is based on Ubuntu, and Ubuntu has switched to Upstart, the Upstart Cookbook has all of the info for having a service start on boot, or at any specified runlevel.



      This site
      Gives a detailed cookbook for starting Apache at boot.






      share|improve this answer


























      • That page talks about placing a bash script in /etc/init.d/apache2. But that file is full of a much more complicated bash script already, which must have been placed there by Apache itself.

        – eoinoc
        Jun 24 '12 at 6:50
















      6














      Since Mint is based on Ubuntu, and Ubuntu has switched to Upstart, the Upstart Cookbook has all of the info for having a service start on boot, or at any specified runlevel.



      This site
      Gives a detailed cookbook for starting Apache at boot.






      share|improve this answer


























      • That page talks about placing a bash script in /etc/init.d/apache2. But that file is full of a much more complicated bash script already, which must have been placed there by Apache itself.

        – eoinoc
        Jun 24 '12 at 6:50














      6












      6








      6







      Since Mint is based on Ubuntu, and Ubuntu has switched to Upstart, the Upstart Cookbook has all of the info for having a service start on boot, or at any specified runlevel.



      This site
      Gives a detailed cookbook for starting Apache at boot.






      share|improve this answer















      Since Mint is based on Ubuntu, and Ubuntu has switched to Upstart, the Upstart Cookbook has all of the info for having a service start on boot, or at any specified runlevel.



      This site
      Gives a detailed cookbook for starting Apache at boot.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Mar 8 '12 at 20:55

























      answered Mar 8 '12 at 19:57









      bsdbsd

      7,92942132




      7,92942132













      • That page talks about placing a bash script in /etc/init.d/apache2. But that file is full of a much more complicated bash script already, which must have been placed there by Apache itself.

        – eoinoc
        Jun 24 '12 at 6:50



















      • That page talks about placing a bash script in /etc/init.d/apache2. But that file is full of a much more complicated bash script already, which must have been placed there by Apache itself.

        – eoinoc
        Jun 24 '12 at 6:50

















      That page talks about placing a bash script in /etc/init.d/apache2. But that file is full of a much more complicated bash script already, which must have been placed there by Apache itself.

      – eoinoc
      Jun 24 '12 at 6:50





      That page talks about placing a bash script in /etc/init.d/apache2. But that file is full of a much more complicated bash script already, which must have been placed there by Apache itself.

      – eoinoc
      Jun 24 '12 at 6:50











      3














      Another cause of the same problem is the priority of the apache links in rc[0-6].d. Mine were S90 and K09, and Apache wouldn't start at boot. Setting the priorities at their defaults, 20, worked for me. The existing links need to be removed first.



      sudo update-rc.d -f apache2 remove
      sudo update-rc.d apache2 defaults





      share|improve this answer




























        3














        Another cause of the same problem is the priority of the apache links in rc[0-6].d. Mine were S90 and K09, and Apache wouldn't start at boot. Setting the priorities at their defaults, 20, worked for me. The existing links need to be removed first.



        sudo update-rc.d -f apache2 remove
        sudo update-rc.d apache2 defaults





        share|improve this answer


























          3












          3








          3







          Another cause of the same problem is the priority of the apache links in rc[0-6].d. Mine were S90 and K09, and Apache wouldn't start at boot. Setting the priorities at their defaults, 20, worked for me. The existing links need to be removed first.



          sudo update-rc.d -f apache2 remove
          sudo update-rc.d apache2 defaults





          share|improve this answer













          Another cause of the same problem is the priority of the apache links in rc[0-6].d. Mine were S90 and K09, and Apache wouldn't start at boot. Setting the priorities at their defaults, 20, worked for me. The existing links need to be removed first.



          sudo update-rc.d -f apache2 remove
          sudo update-rc.d apache2 defaults






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 22 '13 at 17:26









          htoiphtoip

          1457




          1457























              2














              At shutdown, I saw an error:




              Syntax error on line 230 of /etc/apach2/apache.conf
              ....
              /etc/apache/sites-enables/mysite: No such file or directory




              The thing was, mysite was symlinked to a file in my home folder.



              That normally shouldn't be a problem, I thought.



              But as far as I know, my home partition is encrypted. Therefore, I'm guessing that Apache could not read the virtual site file when it was loading. The file wasn't accessible until I type in my password.



              A complex situation, and took months to work it out :)






              share|improve this answer
























              • So how did you work it out?

                – Jonas Äppelgran
                Dec 2 '17 at 23:10
















              2














              At shutdown, I saw an error:




              Syntax error on line 230 of /etc/apach2/apache.conf
              ....
              /etc/apache/sites-enables/mysite: No such file or directory




              The thing was, mysite was symlinked to a file in my home folder.



              That normally shouldn't be a problem, I thought.



              But as far as I know, my home partition is encrypted. Therefore, I'm guessing that Apache could not read the virtual site file when it was loading. The file wasn't accessible until I type in my password.



              A complex situation, and took months to work it out :)






              share|improve this answer
























              • So how did you work it out?

                – Jonas Äppelgran
                Dec 2 '17 at 23:10














              2












              2








              2







              At shutdown, I saw an error:




              Syntax error on line 230 of /etc/apach2/apache.conf
              ....
              /etc/apache/sites-enables/mysite: No such file or directory




              The thing was, mysite was symlinked to a file in my home folder.



              That normally shouldn't be a problem, I thought.



              But as far as I know, my home partition is encrypted. Therefore, I'm guessing that Apache could not read the virtual site file when it was loading. The file wasn't accessible until I type in my password.



              A complex situation, and took months to work it out :)






              share|improve this answer













              At shutdown, I saw an error:




              Syntax error on line 230 of /etc/apach2/apache.conf
              ....
              /etc/apache/sites-enables/mysite: No such file or directory




              The thing was, mysite was symlinked to a file in my home folder.



              That normally shouldn't be a problem, I thought.



              But as far as I know, my home partition is encrypted. Therefore, I'm guessing that Apache could not read the virtual site file when it was loading. The file wasn't accessible until I type in my password.



              A complex situation, and took months to work it out :)







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Aug 13 '12 at 18:05









              eoinoceoinoc

              71661528




              71661528













              • So how did you work it out?

                – Jonas Äppelgran
                Dec 2 '17 at 23:10



















              • So how did you work it out?

                – Jonas Äppelgran
                Dec 2 '17 at 23:10

















              So how did you work it out?

              – Jonas Äppelgran
              Dec 2 '17 at 23:10





              So how did you work it out?

              – Jonas Äppelgran
              Dec 2 '17 at 23:10











              0














              A new answer updated in 2019:




              sudo systemctl start httpd



              sudo systemctl enable httpd




              The systemctl command is a new tool to control the systemd system and service. This is the replacement of old SysV init system management. Most of modern Linux operating systems are using this new tool. If you are working with CentOS 7, Ubuntu 16.04 or later or Debian 9 system. They have opted systemd now.



              The enabled service autostarts on system boot. This is the similar option for systemd than chkconfig for the SysV init.





              share








              New contributor




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

























                0














                A new answer updated in 2019:




                sudo systemctl start httpd



                sudo systemctl enable httpd




                The systemctl command is a new tool to control the systemd system and service. This is the replacement of old SysV init system management. Most of modern Linux operating systems are using this new tool. If you are working with CentOS 7, Ubuntu 16.04 or later or Debian 9 system. They have opted systemd now.



                The enabled service autostarts on system boot. This is the similar option for systemd than chkconfig for the SysV init.





                share








                New contributor




                rauldeng 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







                  A new answer updated in 2019:




                  sudo systemctl start httpd



                  sudo systemctl enable httpd




                  The systemctl command is a new tool to control the systemd system and service. This is the replacement of old SysV init system management. Most of modern Linux operating systems are using this new tool. If you are working with CentOS 7, Ubuntu 16.04 or later or Debian 9 system. They have opted systemd now.



                  The enabled service autostarts on system boot. This is the similar option for systemd than chkconfig for the SysV init.





                  share








                  New contributor




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










                  A new answer updated in 2019:




                  sudo systemctl start httpd



                  sudo systemctl enable httpd




                  The systemctl command is a new tool to control the systemd system and service. This is the replacement of old SysV init system management. Most of modern Linux operating systems are using this new tool. If you are working with CentOS 7, Ubuntu 16.04 or later or Debian 9 system. They have opted systemd now.



                  The enabled service autostarts on system boot. This is the similar option for systemd than chkconfig for the SysV init.






                  share








                  New contributor




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








                  share


                  share






                  New contributor




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









                  answered 9 mins ago









                  rauldengrauldeng

                  1




                  1




                  New contributor




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





                  New contributor





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






                  rauldeng 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 Unix & Linux Stack Exchange!


                      • 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%2funix.stackexchange.com%2fquestions%2f33793%2fhow-to-auto-start-a-service-apache2-with-linux-mint%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

                      Entries order in /etc/network/interfaces

                      新発田市

                      Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)