How to Start Apache from Command Line

preview_player
Показать описание
Learn how to disable apache service. Furthermore, learn how to re-enable it with the help of command line by changing the httpd configuration file.

In this tutorial, we will guide you on how to start apache from command line. In this tutorial, we will teach you how to check whether the apache service is working or not. Furthermore, we will teach you how to work with apache in the command line, how to make changes to the httpd configuration file, etc.

Step 1 -- type localhost

Follow this detailed step by step guide in order to learn how to start apache from command line.
First of all, open up the browser and in the address bar, type localhost before you hit the "enter" key. With that done, you will see "it works" being displayed on your screen. This means that the apache services are running.

Step 3 -- Stop apache service

With that done the services window will open up. Over there, let's stop the Apache service for now.

Step 4 -- Check if apache is running

Now let's go back to the browser and refresh the page. You will notice that this time, the localhost page doesn't open up. This means that the apache server has stopped.

Step 5 -- Open command prompt

Now let's open up the command prompt. With that done, let's go to the bin directory in the apache folder.

Step 7 -- Resume service

If we type httpd and hit the enter key, you will see that the service starts but prompts an error in the process. The error is displayed because the domain name used is not a qualified one. None the less, the service has started.

Step 8 -- Open config file

Step 9 -- Make changes to config file

Over there, find the "localhost:80" text in the notepad and remove the hash from the beginning of that line. With that done, save the file and close the notepad.

Step 10 -- Apache will start

Now let's go back to the command prompt, type httpd once again and hit the enter key.
With that done, you will see that the apache has started in command line without prompting any error.

Step 11 -- Check if apache is working

In the browser, let's refresh the page again and you will see this web page will open up. This means that you have successfully started the apache server from the command line.
Рекомендации по теме
Комментарии
Автор

❗ Subscribe To Our Main YouTube Channel

howtechweb
Автор

Thank you my brother. I'm from Brazil and your help got me out of a big problem.

TubaDcPm
Автор

Thanks bro. Tjat's what i've been looking for

johnsonabiaeme
Автор

thank you so much for all the information, it helped me a lot in a problem that I was having

marcellasilvasanches
Автор

The solution was very very simple. You get the error message when you manually try to start the webserver by "httpd -k start", but no service was defined yet.

just do a "httpd -k install" and the windows service is added to the registry. after that, the "httpd -k start" works without error message.

manjukarthik
Автор

Hi, I don't know where my brother got this Apache HTTP Server test page powered by centos. The problem is I can't open some website because this webpage from Apache blocking the webpage. I can't find it on my computer, there is no Apache2 installed..will it be solve if i download and uninstall apache? thanks advance

edwinpatenio
Автор

same for meee will this help me to open local host ? we 3 have same problem when we type local host in cmd says this error what we have to do? and i cant find appache 32

nick-mory
Автор

Dear 
I don, t know why apache web server dosen, t start  i tried to start service using ( start all services ) it did not work then i go to apache  > services > start/resume service  also no way 
i tried to start it using services .msc  i always get a message ( window couldn.t start the wampapache on local computer for more information review the sysatem eventlog  if this is a non microsoft service  contact the service vendow and refer to service -specific  error code1  ) i tried alot to start apache using service.msc but it did not work and i always get this message  need your help with this problem 
Thank you

حنسافر
Автор

You don't need to type localhost in cmd. It's the server address (just like yotube[dot]com) so it can't be opened directly from cmd. You can only open localhost from yor browser (e.g. firefox ot chrome)

badew
Автор

if you can't open localhost when you type it in your browser's address bar, that's another story) You need to set up apache first

badew
Автор

have you installed apache? this video shows how to do it /watch?v=SwbJppuPADE

badew
join shbcf.ru