mac osx下配置apache
2015-09-15 14:33
513 查看
欢迎访问个人博客
基础
常见命令
//查看apache版本号 apachectl -v //检查apache配置文件是否正确 apachectl -t
环境
OSX yosemite 10.10.4apache Apache/2.4.10 (Unix)
安装步骤
第一步
sudo vim /etc/apache2/httpd.conf
将前面的#去掉
#LoadModule deflate_module libexec/apache2/mod_deflate.so #LoadModule userdir_module libexec/apache2/mod_userdir.so #LoadModule rewrite_module libexec/apache2/mod_rewrite.so #LoadModule php5_module libexec/apache2/libphp5.so #Include /private/etc/apache2/extra/httpd-userdir.conf #Include /private/etc/apache2/extra/httpd-vhosts.conf
第二步
创建根目录mkdir ~/Sites
将默认根目录下面的index.html拷贝到根目录下
cp /Library/WebServer/Documents/index.html.en ~/Sites/
第三步
修改Root文件位置sudo vim /etc/apache2/httpd.conf
修改如下,将“/Library/WebServer/Documents”改为你的文件根目录(Mac是用户名)
#DocumentRoot "/Library/WebServer/Documents" #<Directory "/Library/WebServer/Documents"> DocumentRoot "/Users/Mac/Sites" <Directory "/Users/Mac/Sites">
第四步
执行apachectl -t
如果出现错误
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Mac.local. Set the 'ServerName' directive globally to suppress this message
则将httpd.conf中的
#ServerName www.example.com:80
改为
ServerName localhost:80
相关文章推荐
- apache2.4 建虚拟目录
- 如何为Apache JMeter开发插件(一)
- apache 的常用:1反射赋值方法 2数组追加字符、填充fill、集合转化为数组
- apache虚拟目录配置
- 局域网中其他电脑访问我的电脑上的apache服务器
- CentOS6.5 PHP5.4.0+Apache2.4.1+MySQL5.5.21 编译安装
- Linux 安装 Apache
- apache和php扩展问题
- Apache Thrift的简单使用
- 在CentOS5.2+apache2.2下安装配置mod_ssl
- 在apache2.2 php5.3.6 mysql5.5下出现#1366号mysql错误解决办法
- Building a Movie Recommendation Service with Apache Spark & Flask - Part 2
- Building a Movie Recommendation Service with Apache Spark & Flask - Part 1
- windows xp 下Ubuntu虚拟机安装及Apache安装测试
- Apache CXF Tutorial – WS-Security with Spring
- Apache Camel异常处理
- Web Services Tutorial with Apache CXF
- CXF
- Create CXF Client
- nutch2.3 hadoop2.6.0 hbase0.98.8 分布式爬虫NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfigurati