26

I have installed XAMPP on my Windows 7 machine and created a number of virtual servers. This part is straightforward enough.

Each time I add a new virtual server I am having to reboot my computer in order to reboot the Apache server, which is of course quite time consuming.

I have googled and found the correct console commands to use to reboot Apache, but absolutely non of the references that I have found actually tell you where to type the relevant commands! A certain level of knowledge is assumed.

So my question is - where do I actually type apache -k restart?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Username_null
  • 1,249
  • 2
  • 21
  • 29

2 Answers2

33

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:-

  1. 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)
  2. In the command window that appears type cd C:\xampp\apache\bin (the default installation path for Xampp)
  3. Then type httpd -k restart

I hope that this is of use to others just starting out with running a local Apache server.

Asim K T
  • 16,864
  • 10
  • 77
  • 99
Username_null
  • 1,249
  • 2
  • 21
  • 29
3

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 /?

Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
Mat Lipe
  • 725
  • 8
  • 14