How you would configure a Unix Web server to automatically start on reboot?

Webserver- apache Web server os-centos Using Wget command I have downloaded the apache Web server.

For example In Windows, for the same situation I would install the apache tomcat with windows service. And in services I mark the run config as automatically. So that for if main windows server gets reboot. The apache tomcat will automatically gets up and run.

I need to achieve this in redhat and centos with apache webserver

closed as unclear what you're asking by Rui F Ribeiro, mdpc, Kusalananda, Anthony Geoghegan, G-Man Jun 17 '17 at 5:26

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Almost all webservers will automatically start based on the service manager of host linux; what is your situation exactly? which server? which ubuntu? did you installed from repository? – RYN Jun 16 '17 at 18:11
  • If it's correctly installed from Centos packages, they should already include a script which starts it when the system boots. If you compiled it from source yourself, you need to deploy the integration scripts yourself as well. – tripleee Jun 16 '17 at 18:36
  • Depending upon the RHEL version, it is either chkconfig httpd on or systemctl enable httpd to make it automatically start on reboot. Assuming they were installed via yum. – KevinO Jun 16 '17 at 18:50

I don't really understand your question since it is written quite poorly but I'll try to help.

Run the following code to enable the httpd service to run on startup

sudo systemctl enable httpd

Run the following code to start the httpd service this time since it hasn't been probably activated yet

sudo systemctl start httpd

Not the answer you're looking for? Browse other questions tagged or ask your own question.