简体   繁体   English

Bash (OSX) / 超快的 apache 服务器

[英]Bash (OSX) / extra quick apache server

I have discovered drupal console couple of weeks ago.几周前我发现了 drupal 控制台。 Under the osx terminal, I can launch any drupal website using the following command : drupal server.在 osx 终端下,我可以使用以下命令启动任何 drupal 网站:drupal server。 Apache will then locally host the current folder and I can navigate the drupal site locally on my web browser.然后 Apache 将在本地托管当前文件夹,我可以在我的 Web 浏览器上本地导航 drupal 站点。 (by default http://127.0.0.1:8088/ ) No need of create host.conf or such things, it's super quick. (默认http://127.0.0.1:8088/ )不需要创建 host.conf 或类似的东西,它超级快。

Is there any way to do it without drupal?有没有没有drupal的方法? Can I host any folder with a single command line?我可以使用单个命令行托管任何文件夹吗?

Thanks a lot for your response.非常感谢您的回复。

Pierre皮埃尔

Thanks a lot Siguza and Lin.非常感谢 Siguza 和 Lin。 Both answer are great.两个答案都很棒。 I copy them below for possible apprentice like me who read that post...我将它们复制到下面以供像我这样阅读该帖子的可能的学徒使用...

solution 1:解决方案1:

php -S 127.0.0.1:8080 is the simplest I can think of. php -S 127.0.0.1:8080 是我能想到的最简单的。 Also look at man httpd and man nc.也看看 man httpd 和 man nc。 – Siguza 9 hours ago – Siguza 9 小时前

solution 2:解决方案2:
With some work, using Apache vhosts conf and dnsmasq, you can create a local hosted website just by creating a new folder and the given folder name will be the website address you can access (of course, you need Apache running first).通过一些工作,使用 Apache vhosts conf 和 dnsmasq,您可以创建一个本地托管网站,只需创建一个新文件夹,给定的文件夹名称将是您可以访问的网站地址(当然,您需要先运行 Apache)。 Here is a tutorial I found, fourkitchens.com/blog/article/… – Lin 2 hours ago这是我找到的教程,fourkitchens.com/blog/article/... – Lin 2 小时前

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM