Videos
Going back to absolute basics here. The answers on this page and a little googling have brought me to the following resolution to my issue. Steps to restart the apache service with Xampp installed:-
- Click the start button and type CMD (if on Windows Vista or later and Apache is installed as a service make sure this is an elevated command prompt)
- In the command window that appears type
cd C:\xampp\apache\bin(the default installation path for Xampp) - Then type
httpd -k restart
I hope that this is of use to others just starting out with running a local Apache server.
For frequent uses of this command I found it easy to add the location of C:\xampp\apache\bin to the PATH. Use whatever directory you have this installed in.
Then you can run from any directory in command line:
httpd -k restart
The answer above that suggests httpd -k -restart is actually a typo. You can see the commands by running httpd /?
I have used the Apache Lounge distribution indicated in the official Apache 2 documentation (https://httpd.apache.org/docs/2.4/platform/windows.html)
These are the steps to install Apache on Windows using Apache Lounge distribution:
- Download Apache 2.4.37 Win64 (https://www.apachelounge.com/download/)
- Create folder C:/Apache24
- Unzip httpd-2.4.37-win64-VC15.zip in folder C:/Apache24
Option 1: To run it from the console:
- Open Windows Power Shell
Execute httpd.exe
PS > C:\Apache24\bin\httpd.exeor
PS > cd C:\Apache24\bin PS > .\install.exeOpen http:\localhost or http:\127.0.0.1 in brwoser
The message It works! will be displayed
Option 2: To install it as a service:
- Open Windows Power Shell
Open Windows Power Shell as administrator
PS > Start-Process PowerShell -Verb RunAsInstall the service
PS > cd C:\Apache24\bin PS > .\httpd.exe -k installStart the service
PS > .\httpd.exe -k startor through the services administrator
PS > services.msc Select Apache2.4 > Right-click > StartOpen http:\localhost or http:\127.0.0.1 in brwoser
The message It works! will be displayed
Easy:
- Download from apache lounge https://httpd.apache.org/docs/2.4/platform/windows.html
- Go into downloaded zip folder and move the Apache24 folder to C:/
- Open terminal to C:/Apache24/bin and execute httpd.exe
done!
Now type "localhost" into your browser and a message "It works" should appear on screen.