os mac apache+php+mysql環境配置

來源:互聯網
上載者:User

標籤:

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.10/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環境配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.