freeCodeCamp/guide/chinese/miscellaneous/how-to-run-apache-server-on.../index.md

21 lines
1.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: How to Run Apache Server on a Mac Os X E1 Captain
localeTitle: 如何在Mac Os X E1 Captain上运行Apache服务器
---
[Apache](http://www.apache.org/)服务器预先在Mac OS X上构建无需安装第三方工具WAMPLAMPMAMP和XAMPP即可在Mac上运行Apache服务器。
当您考虑在Mac OS X E1 Captain / OS X Yosemite上运行[Apache](http://www.apache.org/)服务器时它与早期版本有很大不同。在这里您应该从终端窗口早期的GUI选项中进行勾选因为系统控制窗口中的Web服务器已经启动。
在终端窗口输入:
```
httpd -v
```
它提供服务器版本和构建日期。
这里http代表超文本传输协议d代表Daemon这是一个使用多任务的软件程序也用于Mac OS X. `httpd`是Apache超文本传输协议HTTP服务器程序。它旨在作为独立的守护程序进程运行。类型
```
sudo apachectl start
```
在您的终端窗口上,然后转到您的浏览器并键入`http://localhost` `It works!`在您的浏览器上。