在命令行任何目录启动Apache服务器 [英] Start an apache server in any directory from command line
问题描述
我希望能够从从命令行启动Apache服务器,输入类似 Apache站点文件夹
或的Apache。 --port = 2000
I want to be able to start an apache server from the command line, typing something like apache site-folder
or apache . --port=2000
这应阅读和使用的.htaccess
文件。
我知道蟒蛇-m SimpleHTTPServer
和它靠近我需要什么,但并不完全。
I know about python -m SimpleHTTPServer
and it's close to what I need, but not quite.
的理想解决方案:
- 贡献一个伟大的命令行界面的apache本身
- 编写一个简单的命令行工具,包装/ apache的包含(或其它)
- 链接到文档上的Apache现有的CLI
我只是想键入命令<名录及GT; --port = 8000 - 其他选项
命令名称也可能是帕什
在某些时候,我可能要在生产中使用这个。它应该是很容易的过程发送到后台,再停止该实例或所有实例,如永远
At some point I may want to use this in production. It should be easy to send the process to the background, and then stop that instance or all instances, like forever
相关链接:<一个href=\"http://httpd.apache.org/docs/2.4/programs/httpd.html\">http://httpd.apache.org/docs/2.4/programs/httpd.html
这应该只有一个命令,任何人都可以安装,可直接使用脚本
It should be only one command for anyone to install the script for immediate use
推荐答案
与故宫安装 - 这在这里带有节点: http://nodejs.org/
Use pache
Install with npm - which comes with node here: http://nodejs.org/
sudo npm install pache -g
在当前目录下运行,在3000端口:
Run on current dir, port 3000:
pache
或指定目录和端口:
pache site-directory 2000
这篇关于在命令行任何目录启动Apache服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!