1。启用系统自带的apache 服务

打开终端(terminal)

#sudo apachectl start

#sudo vi /etc/apache2/httpd.conf

修改

LoadModule php5_module libexec/apache2/libphp5.so

//开启php

/*****如果访问403****/

<Directory />

AllowOverride none

Order allow,deny

Allow from all

#   Require all denied

Require all granted

</Directory>

/****修改Require all granted*****/

Include /Volumes/App/webserver/vhosts/*.conf

引入虚拟主机的文件。

#wq  //保存退出

#vi /Volumes/App/webserver/vhosts/sv1.conf

<VirtualHost *:80>

ServerAdmin www.sv1.com

DocumentRoot "/Volumes/App/webserver/wwwroot/sv1/wwwroot"

ServerName www.sv1.com

ErrorLog "/Volumes/App/webserver/log/apache2/sv1-error_log"

CustomLog "/Volumes/App/webserver/log/apache2/sv1-access_log" common

</VirtualHost>

#sudo vi /etc/hosts

#sudo apachectl restart   //重启

2。mysql

添加brew

参考:http://brew.sh/index_zh-cn.html

打开终端窗口, 粘贴以上脚本。

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$brew install mysql
$unset TMPDIR
$mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/Volumes/App/webserver/mysqldata --tmpdir=/tmp/
$mysql.server start
$mysqladmin -u root password 'newpassword'

拷贝:/usr/local/var/mysql/下的文件到   /Volumes/App/webserver/mysqldata

修改/usr/local/Cellar/mysql/5.6.10/homebrew.mxcl.mysql.plist

<string>--datadir=/Volumes/App/webserver/mysqldata</string>

数据库目录文件位置。

$sudo cp /usr/local/Cellar/mysql/5.6./homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
$launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

/*  ~ 标记为当前用户目录 */

http://mac.pcbeta.com/thread-138241-1-1.html

os mac apache+php+mysql环境配置的更多相关文章

  1. mac上搭建mysql环境配置和Navicat连接mysql

    mac上搭建mysql环境配置 1.下载mysql for mac: https://downloads.mysql.com/archives/community/ 注意:mysql版本要和你的MAC ...

  2. Apache+php+mysql环境配置

    Apache+PHP+MySQL环境搭建 标题格式 正文格式 阶段性完成格式 正文中强调格式 ————————————————————————————— 前语:本文是从我写过的doc文档迁移过来的,由 ...

  3. windows 7 64bit 下apache php mysql 环境配置

    在64位环境下安装apache,php和配置过程 准备好安装包.(64位版本) Apache 下载地址:http://www.apachelounge.com/download/ Php 下载地址:h ...

  4. Apache+Django+Mysql环境配置

    环境要求:Apache:2.2  Mysql:5.5 Django:1.5 python:2.7 首先下载mod_wsgi-win32-ap22py27-3.3.so 下载下来后,改名成mod_wsg ...

  5. windows下apache+php+mysql 环境配置方法

    一 准备 1 下载apache http://httpd.apache.org/download.cgi#apache24 httpd-2.2.22-win32-x86-openssl-0.9.8t. ...

  6. center os7.2 apache+php+mysql环境配置并设置https访问

    本人阿里云购买的center os7.2系统,小程序只支持https,因此需要配置https 安装apache yum -y install httpd systemctl start httpd a ...

  7. 在Mac上安装mysql并配置环境(详细篇)

    在Mac上安装mysql并配置环境(详细篇) 1.下载mysql mysql官网 这一步根据自己电脑架构选择,分为arm和x86 下载完成之后打开就可以 接下来运行安装就可以,一直下一步,设置完密码就 ...

  8. Ubuntu+Apache+PHP+Mysql环境搭建(完整版)(转)

    http://www.2cto.com/os/201505/401588.html Ubuntu+Apache+PHP+Mysql环境搭建(完整版) 一.操作系统Ubuntu 14.04 64位,阿里 ...

  9. mac电脑使用,开发环境配置指南

    mac电脑使用,开发环境配置指南 前端工具链,mac下都很好用 用brew来装软件 用brew cask来装应用 Introduction · macOS Setup Guidehttp://sour ...

随机推荐

  1. 树状数组(二维):COGS 1532 [IOI2001]移动电话

    1532. [IOI2001]移动电话 ★☆   输入文件:mobilephones.in   输出文件:mobilephones.out   简单对比 时间限制:5 s   内存限制:256 MB ...

  2. 数学概念——F 概率(经典问题)birthday paradox

    F - 概率(经典问题) Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit S ...

  3. 慕课python3.5学习笔记

    本文章中有部分代码为python2 慕课python入门 慕课python进阶 布尔值 布尔值可以用and.or和not运算. and运算是与运算,只有所有都为 True,and运算结果才是 True ...

  4. Swift3.0已出坑-适配iOS10,项目迁移Swift3.0问题总结。

    http://www.jianshu.com/p/27fd2a2b32e4 Yes表示swift版本为2.3 NO表示swift版本为3.0

  5. halt和shutdown 的区别

    1.halt -h 标准情况下是关机 但是要手动关闭电源 .有些发行版增强了halt脚本 使其可以关闭电源 halt执行时﹐杀死应用进程﹐执行sync系统调用﹐文件系统写操作完成后就会停止内核. 2. ...

  6. hnsd11348tree(并查集)

    Problem description A graph consists of a set of vertices and edges between pairs of vertices. Two v ...

  7. Qt 学习之路:视图选择 (QItemSelectionModel)

    选择是视图中常用的一个操作.在列表.树或者表格中,通过鼠标点击可以选中某一项,被选中项会变成高亮或者反色.在 Qt 中,选择也是使用了一种模型.在 model/view 架构中,这种选择模型提供了一种 ...

  8. Android(java)学习笔记237:多媒体之图形的变化处理

    1.图形的缩放 (1)布局文件activity_main.xml如下: <LinearLayout xmlns:android="http://schemas.android.com/ ...

  9. Android中使用HttpGet和HttpPost访问HTTP资源

    需求:用户登录(name:用户名,pwd:密码) (一)HttpGet :doGet()方法//doGet():将参数的键值对附加在url后面来传递 public String getResultFo ...

  10. Asp.net Core 部署到Azure.cn的一个小问题

    前一段尝试在azure.cn上部署Aps.net Core未成功,报503错误!在网上查到是Azure.cn的问题,未能完美支持Asp.net Core! Asp.net Core发表正式版了,又尝试 ...