在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
在mac os中直接提供了基于apache的站点功能,在系统偏好设置中的共享里,打开web共享即可。当然其他的则需要自己配置。具体可以参考 【 在Mac OS X中配置Apache + PHP + MySQL 】,大部分都已经没问题了,但中间有点没说清楚:系统默认共享和自己配置这两种方法的影响。即,在打开系统共享的情况下,按上文中的方法是没有异常的,但是如果手动通过sudo apachectl start启动apache的话,则有问题。 通过具体分析,主要是在默认的apache的主配置文件 /private/etc/apache2/httpd.conf中进行了限制。具体则是通过<IfDefine WEBSHARING_ON>来限制的,至于WEBSHARING_ON在那里定义,还没找到,但是可以肯定的是默认情况下不存在,只有启动系统的web共享,才会存在。 apache的documentroot的设置,我们知道mac os x有两个默认站点http://localhost/和http://localhost/~[username]/但是在httpd.conf中只是声明了前者,通过学习该配置文件,发现,后者则是通过嵌套包含的方式在定义的,具体的,在httpd中通过: Include /private/etc/apache2/extra/httpd-userdir.conf 包含了另外一个配置文件,该配置文件中定义了用户站点相关,具体就是后者。 此外,发现目录权限什么的都在httpd.conf或包含进去的其他conf中定义或限制。 ++++++++++++++++++++++++++++++++++++++++++++++ 二,httpd.conf相关htppd.conf中的几个字段的介绍: ServerRoot 服务器配置、日志、错误等的root目录, 貌似一般不更改 #
DocumentRoot 提供服务的目录,即存放响应页面等信息的目录 #
三,其它如果担心web共享不安全,可以修改 /etc/apache2/httpd.conf |
2022-07-29
2022-08-30
2022-08-17
2022-11-06
2022-08-18
请发表评论