markdown 在Mac上使用httpd / apachectl

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 在Mac上使用httpd / apachectl相关的知识,希望对你有一定的参考价值。

### Check if apache is running:
There are a couple of different ways.   

#### `netstat -at | grep LISTEN | grep *.http`   
You should see something like:
```sh
10:54:12  ~/Sites/
 => netstat -at | grep LISTEN | grep *.http
tcp46      0      0  *.http                 *.*                    LISTEN  
```

If there are no results, apache isn't running.

#### `ps aux | grep httpd`   

You should see something like:
```sh
 10:45:57  ~/Sites/  
 => ps aux | grep httpd
noxlady           2795   0.0  0.0  4278260    816 s005  S+   10:46AM   0:00.00 grep httpd
noxlady           2775   0.0  0.0  4549224   1148   ??  S    10:45AM   0:00.00 /usr/local/opt/httpd/bin/httpd -k start
noxlady           2774   0.0  0.0  4549224   1168   ??  S    10:45AM   0:00.00 /usr/local/opt/httpd/bin/httpd -k start
noxlady           2773   0.0  0.0  4549224   1184   ??  S    10:45AM   0:00.00 /usr/local/opt/httpd/bin/httpd -k start
noxlady           2772   0.0  0.0  4549224   1196   ??  S    10:45AM   0:00.00 /usr/local/opt/httpd/bin/httpd -k start
noxlady           2771   0.0  0.0  4549224   1184   ??  S    10:45AM   0:00.00 /usr/local/opt/httpd/bin/httpd -k start
root              2760   0.0  0.2  4549248  26528   ??  Ss   10:45AM   0:00.04 /usr/local/opt/httpd/bin/httpd -k start
```

If all you see is:
```sh
10:45:40  ~/Sites/
 => ps aux | grep httpd
noxlady           2728   0.0  0.0  4277236    800 s005  S+   10:45AM   0:00.00 grep httpd
```    
then apache isn't running (it's just finding the search you just ran).

### Start apache
`sudo apachectl start`
(Oddly, this seems to work when restart doesn't...)

### Restart apache
`sudo apachectl -k restart`

### Stop apache
`sudo apachectl -k stop`

以上是关于markdown 在Mac上使用httpd / apachectl的主要内容,如果未能解决你的问题,请参考以下文章

markdown 使用Homebrew安装的pg和openssl在Mac上构建pgmodeler

Mac OS Sierra 上的 Apache:非法指令:4 $HTTPD

markdown 如何在Mac上录制屏幕

markdown 如何在Mac上更新Geth?

markdown 在Mac上全球下载Composer

mac-httpd