How to Start Apache from Command Line
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.
Don’t forget to check out our site for more free how-to videos!
– our feed
– join us on facebook
– our group in Google+
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 2 — Open Services.msc
Now move on to the services window by opening up the run command, typing in services.msc and hitting the enter key.
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 6 — Locate httpd.exe
Over there in the bin directory, you can see the httpd.exe file.
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
Now let’s move to the configuration directory in the apache folder. Over there, let’s open the httpd.conf file in the notepad.
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.
Xem thêm bài viết khác: https://ftlinuxcourse.com/lap-trinh-linux
Xem thêm Bài Viết:
- Trải nghiệm mới hay ho với hướng dẫn cài Mac Os trên vmware
- Bật mí cách cài đặt ssl miễn phí lên Let’s Encrypt
- Tuyệt chiêu tạo usb boot kali linux đơn giản dành cho bạn
- Hướng dẫn chi tiết từ A – Z các bước cài đặt Python trên Windows 10
- Bật mí quy trình cài đặt Kali Linux trên Vmware đúng chuẩn và chi tiết