mac 配置本地apache

简介: 1、mac本身自带apache服务器,只需要修改3个文件的配置即可 2、打开finder前往文件夹 输入/etc 找到apache2文件夹下的httpd.conf 修改文件中的代码为 #AllowOverride none #Require all denied #.

1、mac本身自带apache服务器,只需要修改3个文件的配置即可
2、打开finder前往文件夹 输入/etc 找到apache2文件夹下的httpd.conf

修改文件中的代码为

#AllowOverride none
#Require all denied
#2017-05-26 
Require all granted
AllowOverride all

AllowOverride all
Allow from all


Include /private/etc/apache2/extra/httpd-vhosts.conf
注:找到这行代码 把注释取消掉
3、在apache2 中extra文件夹下打开httpd-vhosts.conf

修改文件中的代码为

#ServerAdmin webmaster@mysite.local
DocumentRoot "/Users/xiekai/xn/"
ServerName w.xn.com
ServerAlias www.dummy-host.example.com
ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
#DocumentRoot "/Users/teenker/xiekai/dev/"
#ServerName w.www.xiekai.com


<Directory /Users/xiekai/xn/>
    Options All
    Allow from All
    AllowOverride All
</Directory>

4、在etc文件夹下打开hosts文件
修改如下

127.0.0.1 w.xn.com //自己配的地址
255.255.255.255 broadcasthost
::1 localhost
0.0.0.0 account.jetbrains.com
5、sudo apachectl restart
重启服务即可 或者重启电脑

网上资料 http://blog.csdn.net/simplty/article/details/43021375

相关文章
|
5月前
配置MAC地址表
配置MAC地址表
配置MAC地址表
|
5月前
|
Linux 网络安全 Apache
CentOS 7.2配置Apache服务httpd(上)
CentOS 7.2配置Apache服务httpd(上)
434 1
|
4月前
|
开发工具 git 开发者
「Mac畅玩鸿蒙与硬件3」鸿蒙开发环境配置篇3 - DevEco Studio插件安装与配置
本篇将专注于如何在 DevEco Studio 中安装和配置必要的插件,以增强开发功能和提升效率。通过正确配置插件,开发流程能够得到简化,开发体验也会更加顺畅。
209 1
「Mac畅玩鸿蒙与硬件3」鸿蒙开发环境配置篇3 - DevEco Studio插件安装与配置
|
5月前
|
Java Shell 应用服务中间件
Mac系统下配置环境变量:Javajdk、maven、tomcat 环境变量配置及对应配置文件
这篇文章介绍了如何在Mac系统下配置Java JDK、Maven和Tomcat的环境变量,包括配置文件的选择、解决环境变量在zsh shell中无效的问题、查看和设置系统环境变量的方法,以及JDK和Maven的下载、配置和测试步骤。
1957 1
Mac系统下配置环境变量:Javajdk、maven、tomcat 环境变量配置及对应配置文件
|
5月前
|
存储 分布式计算 druid
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
77 1
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
|
5月前
|
缓存 前端开发 应用服务中间件
CORS跨域+Nginx配置、Apache配置
CORS跨域+Nginx配置、Apache配置
375 7
|
5月前
|
消息中间件 分布式计算 druid
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(二)
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(二)
73 2
|
5月前
apache+tomcat配置多站点集群的方法
apache+tomcat配置多站点集群的方法
78 4
|
5月前
|
存储 消息中间件 druid
大数据-151 Apache Druid 集群模式 配置启动【上篇】 超详细!
大数据-151 Apache Druid 集群模式 配置启动【上篇】 超详细!
139 1
|
5月前
|
负载均衡 应用服务中间件 Apache
Tomcat负载均衡原理详解及配置Apache2.2.22+Tomcat7
Tomcat负载均衡原理详解及配置Apache2.2.22+Tomcat7
94 3

推荐镜像

更多