Shark Deng

Interactive Designer @Shanju Design in Shanghai

touched caffe / mxnet / python / wordpress / bootstrap / Arduino / Raspberry Pi / webgl / three.js / PIXI / 3dMax

Email

Github

Mac – 重装apache

2019-11-19 03:09:30

Mac自带apache2.4.27版本(稍老)

文件地址:

/usr/sbin/httpd(系统基本功能,不允许删除)

/usr/share/httpd(网络共享,没试过删除)

/usr/libexec/apache2(不允许删除)

/private/etc/apache2

/private/var/log/apache2

/etc/apache2(可删)

/library/webserver网站目录

 

所以推测,mac自带的apache是删不掉的。弄坏了怎么办?

方法一: brew install httpd会另装一个,我版本是httpd2.4.29

用httpd -v查看版本。

 

brew装的地址:

/usr/local/Cellar/httpd运行

/usr/local/var/www网站目录

/usr/local/var/log/httpd

/usr/local/var/cache/httpd

/usr/local/var/run/httpd

/usr/local/etc/httpd配置文件

1)修改监听端口

默认8080端口被占用,不知为甚么,在httpd.conf修改端口,localhost即通。

2)解析php

httpd没有libphp7.so

复制/usr/libexec/apache2/libphp7.so  到/usr/local/lib/httpd/modules

在httpd.conf添加两句话:

LoadModule php7_module /lib/httpd/modules/libphp7.so

AddType application/x-httpd-php .php

方法二:mac系统重装(没试)

 

 



——By SharkDeng
如果你喜欢我的文章,欢迎红包赞赏

Leave a Reply

Your email address will not be published. Required fields are marked *