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.
Answer from Username_null on Stack OverflowVideos
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 /?
What about apache debug mode (-X) ?
apache2 -X -d. -f.htaccess -C"PidFile `mktemp`" -C"Listen 1025"
-C"ErrorLog /dev/stdout" -C"DocumentRoot `pwd`"
to put it in the background once started you may use Ctrl^Z then type "bg"
Using the the FOREGROUND flag, wrapping it up in a shell script:
#!/bin/sh
if [ $# -ne 2 ]; then
echo "$0 <port> <dir>"
exit 10
fi
/usr/sbin/apache2 -DFOREGROUND -d. -f.htaccess -C"PidFile `mktemp`" \
-C"Listen $1" -C"ErrorLog /dev/stdout" -C"DocumentRoot $2" -e debug
call it "pache", chmod +x, then you can run
./pache 1026 /tmp/webroot
http-server is a much better simple http server than pache, it's what I use currently! :)
Use [pache][1]
Install with npm - which comes with node here: http://nodejs.org/
sudo npm install pache -gRun on current dir, port 3000:
pacheOr specify directory and port:
pache site-directory 2000[1]: https://github.com/devinrhode2/pache