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. 数据结构(Splay平衡树):HDU 1890 Robotic Sort

    Robotic Sort Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  2. 后缀自动机(SAM):SPOJ Longest Common Substring II

    Longest Common Substring II Time Limit: 2000ms Memory Limit: 262144KB A string is finite sequence of ...

  3. zoj 3672 Gao The Sequence

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4915题意:a[k]-一个任意的数,这个数要等于a[1]~a[k]每个数减去任意 ...

  4. c#反序列化

    C#序列化(转载) 2011-03-15  |  凯之风  |  转藏(2) 序列化有下列要求: A> 只序列化PUBLIC的成员变量和属性 B> 类必须有默认识构造函数 C> 如果 ...

  5. bzoj 1093 [ZJOI2007]最大半连通子图(scc+DP)

    1093: [ZJOI2007]最大半连通子图 Time Limit: 30 Sec  Memory Limit: 162 MBSubmit: 2286  Solved: 897[Submit][St ...

  6. First Record

    今天我在博客园安家了! R Python Scala hadoop Spark MachineLearning

  7. C++ 路径中\\与/

    windows默认使用\\ linux默认使用/ 可以都用/

  8. Spring Boot 启动原理分析

    https://yq.aliyun.com/articles/6056 转 在spring boot里,很吸引人的一个特性是可以直接把应用打包成为一个jar/war,然后这个jar/war是可以直接启 ...

  9. Android 省市县 三级联动(android-wheel的使用)[转]

    转载:http://blog.csdn.net/lmj623565791/article/details/23382805 今天没事跟群里面侃大山,有个哥们说道Android Wheel这个控件,以为 ...

  10. Android图片框架---Glide

    Glide *** 使用* 一.添加依赖* compile 'com.github.bumptech.glide:glide:3.7.0'* compile 'com.android.support: ...