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. 生成树的计数(基尔霍夫矩阵):UVAoj 10766 Organising the Organisation SPOJ HIGH - Highways

    HIGH - Highways   In some countries building highways takes a lot of time... Maybe that's because th ...

  2. 【动态规划】Codeforces 711C Coloring Trees

    题目链接: http://codeforces.com/problemset/problem/711/C 题目大意: 给N棵树,M种颜色,已经有颜色的不能涂色,没颜色为0,可以涂色,每棵树I涂成颜色J ...

  3. 【单调队列】Vijos P1771 瑞士轮 (NOIP2011普及组第三题)

    题目链接: https://vijos.org/p/1771 题目大意: 给定2N个人(N<=100 000)和其初始分数.能力值(能力两两不同),比赛M次(M<=50),每次PK都是按分 ...

  4. 工资表的生成、显示、修改工资,应用transactionscope 分布式事务

    一: 二:SalarySheetDAL.cs using System; using System.Collections.Generic; using System.Linq; using Syst ...

  5. Socket(TCP)客户端请求和服务端监听和链接基础(附例子)

    一:基础知识回顾 一: Socket 类 实现 Berkeley 套接字接口. Socket(AddressFamily, SocketType,ProtocolType) 使用指定的地址族.套接字类 ...

  6. Android程序的入口点和全局变量设置--application

    首先看看 application的官方文档 我之前一直以为Android程序的入口点就是带MAIN和LAUNCHER的Activity的onCreate方法,看来我是错了~  原来真正的入口点是 Ap ...

  7. logback 配置详解(一)(转)

    转自:http://blog.csdn.net/haidage/article/details/6794509/ 一:根节点<configuration>包含的属性: scan: 当此属性 ...

  8. [转]【基于zxing的编解码实战】精简Barcode Scanner篇

    通过<[搞定条形码]zxing项目源码解读(2.3.0版本,Android部分)>的分析,现在可以实现最终目标了:精简Barcode Scanner并将其中的编码和解码分离为两个独立的部分 ...

  9. PHP开发安全之近墨者浅谈(转)

    ==过滤输入/输出转义 过滤是Web应用安全的基础.它是你验证数据合法性的过程.通过在输入时确认对所有的数据进行过滤,你可以避免被污染(未过滤)数据在你的程序中被误信及误用.大多数流行的PHP应用的漏 ...

  10. SPOJ 181 - Scuba diver 二维背包

    潜水员要潜水,给出n个气缸(1<=n<=1000),每个气缸中有氧气量为ti,氮气量为ai,气缸重量为wi(1<=ti<=21,1<=ai<=79,1<=wi ...