摘要:本開發(fā)環(huán)境,全部基于安裝。制作全新安裝啟動(dòng)盤。插上盤,在終端執(zhí)行是你的盤盤符,根據(jù)實(shí)際情況來。安裝開發(fā)常用的包軟件安裝開發(fā)包升級(jí)一下系統(tǒng)自帶的安裝常用軟件是個(gè)很不錯(cuò)的東西,推薦必須安裝。
OS X Mavericks用了一年的Mac OS X了,之前不熟悉這個(gè)系統(tǒng),用的是系統(tǒng)自帶的PHP 以及DMG包安裝的MySQL,時(shí)間長(zhǎng)了,慢慢覺得MacBook的速度跟不上了,雖然關(guān)機(jī)次數(shù)不多,但是每次開機(jī),或者喚醒電腦的時(shí)候,系統(tǒng)明顯有一定時(shí)間的卡頓。特別表現(xiàn)在開機(jī)的時(shí)候。完全可以去泡一個(gè)來一桶了。 因此干掉MD101上的光驅(qū),換上256G的Sandisk SSD, 干掉原廠的2G * 2,換上8G * 2 。 速度應(yīng)該是杠杠的了,至少可以再服役2年吧。
趁著這次加硬盤的機(jī)會(huì),就準(zhǔn)備徹底重做開發(fā)環(huán)境。現(xiàn)在對(duì)Mac也有了一定的了解,特地記錄一下本次的開發(fā)環(huán)境安裝詳情,給自己一個(gè)備忘,希望也可以幫助到剛接觸Mac環(huán)境的同學(xué)們。本開發(fā)環(huán)境,全部基于HomeBrew安裝。
主要軟件版本:PHP5.5.14,Nginx 1.6.0,MySQL5.6.19
重新安裝系統(tǒng),在蘋果商店下載好OS X Mavericks安裝文件,然后準(zhǔn)備一支16G的USB3.0 U盤。制作OS X Mavericks 全新安裝啟動(dòng)U盤。
插上U盤,在終端執(zhí)行:sudo /Applications/Install OS X Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/untitled --applicationpath /Applications/Install OS X Mavericks.app --nointeraction
untitled 是你的u盤盤符,根據(jù)實(shí)際情況來。
Erasing Disk: 0%… 10%… 20%… 30%…100%… >Copying installer files to disk… Copy complete. Making disk bootable… Copying boot files… >Copy complete. >Done.
看到上面的信息說明啟動(dòng)盤制作成功。 安裝起來so easy :)
Brew安裝完成系統(tǒng)之后, 暫時(shí)還沒有去遷移文件,由于本人喜好攝影,有大量RAW格式的原圖在Aperture 的照片庫(kù)中,尼康D800一張RAW文件有40M左右,到時(shí)候遷移照片庫(kù)和照片流希望不要掉坑里了。 等開發(fā)環(huán)境搞定再說了,更新OS X系統(tǒng)到10.9.4 ,然后安裝最新的Xcode, 以及在商店買過的軟件。確定系統(tǒng)無問題了,進(jìn)入下一步...
Brew 是 Mac 下面的包管理工具,通過 Github 托管適合 Mac 的編譯配置以及 Patch,可以方便的安裝開發(fā)工具。 Mac 自帶ruby 所以安裝起來很方便,同時(shí)它也會(huì)自動(dòng)把git也給你裝上。官方網(wǎng)站: http://brew.sh 。
安裝完成之后,建議執(zhí)行一下自檢,brew doctor如果看到Your system is ready to brew. 那么你的brew已經(jīng)可以開始使用了。
安裝:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
自檢:
brew doctor
常用命令: (所有軟件以PHP5.5為例子)
brew update #更新brew可安裝包,建議每次執(zhí)行一下 brew search php55 #搜索php5.5 brew tap josegonzalez/php #安裝擴(kuò)展brew tap #查看安裝的擴(kuò)展列表 brew install php55 #安裝php5.5 brew remove php55 #卸載php5.5 brew upgrade php55 #升級(jí)php5.5 brew options php55 #查看php5.5安裝選項(xiàng) brew info php55 #查看php5.5相關(guān)信息 brew home php55 #訪問php5.5官方網(wǎng)站 brew services list #查看系統(tǒng)通過 brew 安裝的服務(wù) brew services cleanup #清除已卸載無用的啟動(dòng)配置文件 brew services restart php55 #重啟php-fpm
注意:brew services 相關(guān)命令最好別經(jīng)常用了,提示會(huì)被移除
? ~ brew services restart php55 Warning: brew services is unsupported and will be removed soon. You should use launchctl instead. Please feel free volunteer to support it in a tap. Stopping `php55`... (might take a while) ==> Successfully stopped `php55` (label: homebrew.mxcl.php55) ==> Successfully started `php55` (label: homebrew.mxcl.php55)Oh My Zsh
ohmyzsh & iTerm2兩個(gè)神器,在Mac os x下是一定要裝的. 兩組配合起來使用,加上插件。簡(jiǎn)直是神一樣的存在。 秒殺梅西,內(nèi)馬爾啊:) Oh 猛戳到官網(wǎng)
安裝 oh my zsh
curl -L http://install.ohmyz.sh | sh
設(shè)置默認(rèn)shell
查看系統(tǒng)支持的shell列表,Mac 10.9.4 自帶了 zsh 5.0.2,Linux上得安裝。
cat /etc/shells # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using # one of these shells. /bin/bash /bin/csh /bin/ksh /bin/sh /bin/tcsh /bin/zsh zsh --version zsh 5.0.2 (x86_64-apple-darwin13.0) chsh -s /bin/zsh
homebrew-cask雖然Mac自帶了zsh,如果你想要最新版的zsh,那么你用 brew install zsh安裝一個(gè)最新的吧。/usr/local/bin/zsh --version zsh 5.0.5 (x86_64-apple-darwin13.3.0) 區(qū)別也不會(huì)很大, 默認(rèn)的版本已經(jīng)很新了。
安裝cask:
brew tap phinze/homebrew-cask && brew install brew-cask
cask常用命令:
brew cask search #列出所有可以被安裝的軟件 brew cask search php #查找所有和php相關(guān)的應(yīng)用 brew cask list #列出所有通過cask安裝的軟件 brew cask info phpstorm #查看 phpstorm 的信息 brew cask uninstall qq #卸載 QQ
這里談?wù)刢ask對(duì)比Mac App Store的優(yōu)勢(shì):
對(duì)常用軟件支持更全面(特別是開發(fā)者),cask里面會(huì)給你一些驚喜;
軟件更新速度快,一般都是最新版本 Store上很久很久才會(huì)更新版本;
命令安裝感覺比打開Store方便,另外Store在國(guó)內(nèi)的速度也是XXOO。
iTerm2安裝iTerm2:
brew cask install iterm2
安裝開發(fā)常用的包&軟件上面提過的神器組合,更多使用方法請(qǐng)參考iTerm2官方文檔, 這里就不詳細(xì)說明了。
安裝開發(fā)包
brew install wget watch tmux cmake openssl imagemagick graphicsmagick gearman geoip readline autoconf multitail source-highlight autojump zsh-completions sshfs
升級(jí)一下系統(tǒng)自帶的vim
brew install ctags macvim --env-std --override-system-vim
安裝常用軟件
brew cask install alfred appcleaner firefox google-chrome phpstorm sublime-text sequel-pro sketch mplayerx thunder qq
MySQL PHP Nginx Redis MemcacheAlfred 是個(gè)很不錯(cuò)的東西,推薦必須安裝。它默認(rèn)搜索目錄不包含brew cask安裝的軟件,因此手動(dòng)將/opt/homebrew-cask添加到Alfred的搜索目錄
前面做了這么多的準(zhǔn)備工作,其實(shí) zsh iTerm2 brew 等等這些由于篇幅以及能力有限,一時(shí)半會(huì)也講不完,更多選擇,更多歡樂,就在Google search,現(xiàn)在才入正題。come on :)
安裝MySQL
brew install mysql
MySQL開機(jī)啟動(dòng):
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
安裝完成之后開啟MySQL安全機(jī)制:
/usr/local/opt/mysql/bin/mysql_secure_installation
根據(jù)終端提示,輸入root密碼,然后依次確認(rèn)一些安全選項(xiàng)。具體信息可以參考外國(guó)友人的這篇文章
#查看一下MySQL運(yùn)行情況 ? ~ ps aux | grep mysql calvin 1695 0.0 0.5 2719864 90908 ?? S 1:38上午 0:00.31 /usr/local/Cellar/mysql/5.6.19/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.6.19 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.6.19/lib/plugin --bind-address=127.0.0.1 --log-error=/usr/local/var/mysql/CalvinsMacBook-Pro.local.err --pid-file=/usr/local/var/mysql/CalvinsMacBook-Pro.local.pid --socket=/tmp/mysql.sock --port=3306 calvin 1323 0.0 0.0 2444628 1020 ?? S 1:38上午 0:00.04 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --bind-address=127.0.0.1 --datadir=/usr/local/var/mysql #測(cè)試連接MySQL mysql -uroot -p Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 23 Server version: 5.6.19-log Homebrew Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type "help;" or "h" for help. Type "c" to clear the current input statement. mysql>
安裝phpmyadmin
brew install phpmyadmin
安裝PHP
添加brew的PHP擴(kuò)展庫(kù):
brew update brew tap homebrew/dupes brew tap josegonzalez/homebrew-php
可以使用brew options php55命令來查看安裝php5.5的選項(xiàng),這里我用下面的選項(xiàng)安裝:
brew install php55 --with-fpm --with-gmp --with-imap --with-tidy --with-debug --with-mysql --with-libmysql
PHP編譯過程中如果遇到configure: error: Cannot find OpenSSL"s
錯(cuò)誤,執(zhí)行xcode-select --install 重新安裝一下Xcode Command Line Tools 在GitHub HomeBrew上有關(guān)于這個(gè)討論:
For future reference of anybody looking for Command Line Tools with Xcode 5, open up a Terminal window and type xcode-select --install. A window will appear informing you command line tools are required. Click Install and you should be good to go
等待PHP編譯完成,開始安裝PHP常用擴(kuò)展,擴(kuò)展安裝過程中brew會(huì)自動(dòng)安裝依賴包,例如php55-pdo-pgsql 會(huì)自動(dòng)裝上postgresql,這里我安裝以下PHP擴(kuò)展:
brew install php55-apcu php55-gearman php55-geoip php55-gmagick php55-imagick php55-intl php55-mcrypt php55-memcache php55-memcached php55-mongo php55-opcache php55-pdo-pgsql php55-phalcon php55-redis php55-sphinx php55-swoole php55-uuid php55-xdebug;
擴(kuò)展里面提一下php55-phalcon 和 php55-swoole. 一個(gè)是C語(yǔ)言寫的PHP框架,安裝來個(gè)人摸索熟悉一下,還沒有真正的使用過,大致看了一下文檔,感覺非常吊炸天。目前公司的項(xiàng)目是基于Yii2的,也看看這個(gè)框架。 另外一個(gè)swoole是國(guó)產(chǎn)的PHP高性能網(wǎng)絡(luò)通信框架,貌似不錯(cuò),可能在項(xiàng)目中會(huì)考慮用到它。
由于Mac自帶了php和php-fpm,因此需要添加系統(tǒng)環(huán)境變量PATH來替代自帶PHP版本。
echo "export PATH="$(brew --prefix php55)/bin:$PATH"" >> ~/.bash_profile #for php echo "export PATH="$(brew --prefix php55)/sbin:$PATH"" >> ~/.bash_profile #for php-fpm echo "export PATH="/usr/local/bin:/usr/local/sbib:$PATH"" >> ~/.bash_profile #for other brew install soft source ~/.bash_profile
測(cè)試一下效果:
#brew安裝的php 他在/usr/local/opt/php55/bin/php php -v PHP 5.5.14 (cli) (built: Jul 16 2014 15:43:06) (DEBUG) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans #Mac自帶的PHP /usr/bin/php -v PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies #brew安裝的php-fpm 他在/usr/local/opt/php55/sbin/php-fpm php-fpm -v PHP 5.5.14 (fpm-fcgi) (built: Jul 16 2014 15:43:12) (DEBUG) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans #Mac自帶的php-fpm /usr/sbin/php-fpm -v PHP 5.4.24 (fpm-fcgi) (built: Jan 19 2014 21:32:57) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
修改php-fpm配置文件,vim /usr/local/etc/php/5.5/php-fpm.conf,找到pid相關(guān)大概在25行,去掉注釋 pid = run/php-fpm.pid, 那么php-fpm的pid文件就會(huì)自動(dòng)產(chǎn)生在/usr/local/var/run/php-fpm.pid,下面要安裝的Nginx pid文件也放在這里。
#測(cè)試php-fpm配置 php-fpm -t php-fpm -c /usr/local/etc/php/5.5/php.ini -y /usr/local/etc/php/5.5/php-fpm.conf -t #啟動(dòng)php-fpm php-fpm -D php-fpm -c /usr/local/etc/php/5.5/php.ini -y /usr/local/etc/php/5.5/php-fpm.conf -D #關(guān)閉php-fpm kill -INT `cat /usr/local/var/run/php-fpm.pid` #重啟php-fpm kill -USR2 `cat /usr/local/var/run/php-fpm.pid` #也可以用上文提到的brew命令來重啟php-fpm,不過他官方不推薦用這個(gè)命令了 brew services restart php55 #還可以用這個(gè)命令來啟動(dòng)php-fpm launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist
啟動(dòng)php-fpm之后,確保它正常運(yùn)行監(jiān)聽9000端口:
lsof -Pni4 | grep LISTEN | grep php php-fpm 30907 calvin 9u IPv4 0xf11f9e8e8033a2a7 0t0 TCP 127.0.0.1:9000 (LISTEN) php-fpm 30917 calvin 0u IPv4 0xf11f9e8e8033a2a7 0t0 TCP 127.0.0.1:9000 (LISTEN) php-fpm 30918 calvin 0u IPv4 0xf11f9e8e8033a2a7 0t0 TCP 127.0.0.1:9000 (LISTEN) php-fpm 30919 calvin 0u IPv4 0xf11f9e8e8033a2a7 0t0 TCP 127.0.0.1:9000 (LISTEN) #正常情況,會(huì)看到上面這些進(jìn)程
PHP-FPM開機(jī)啟動(dòng):
ln -sfv /usr/local/opt/php55/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php55.plist
安裝php composer
brew install composer #檢查一下情況 composer --version Composer version 1.0.0-alpha8 2014-01-06 18:39:59
redis memcached這些軟件brew 已經(jīng)自動(dòng)依賴安裝上,如果想開機(jī)自動(dòng)啟動(dòng),或者查看使用說明 brew info redis即可。另外,composer的中文文檔:猛戳這里
安裝Nginx
brew install nginx --with-http_geoip_module
Nginx啟動(dòng)關(guān)閉命令:
#測(cè)試配置是否有語(yǔ)法錯(cuò)誤 nginx -t #打開 nginx sudo nginx #重新加載配置|重啟|停止|退出 nginx nginx -s reload|reopen|stop|quit #也可以使用Mac的launchctl來啟動(dòng)|停止 launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Nginx開機(jī)啟動(dòng)
ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Nginx監(jiān)聽80端口需要root權(quán)限執(zhí)行,因此:
sudo chown root:wheel /usr/local/Cellar/nginx/1.6.0_1/bin/nginx sudo chmod u+s /usr/local/Cellar/nginx/1.6.0_1/bin/nginx
配置nginx.conf
創(chuàng)建需要用到的目錄:
mkdir -p /usr/local/var/logs/nginx mkdir -p /usr/local/etc/nginx/sites-available mkdir -p /usr/local/etc/nginx/sites-enabled mkdir -p /usr/local/etc/nginx/conf.d mkdir -p /usr/local/etc/nginx/ssl sudo mkdir -p /var/www sudo chown :staff /var/www sudo chmod 775 /var/www
vim /usr/local/etc/nginx/nginx.conf 輸入以下內(nèi)容:
worker_processes 1; error_log /usr/local/var/logs/nginx/error.log debug; pid /usr/local/var/run/nginx.pid; events { worker_connections 256; } http { include mime.types; default_type application/octet-stream; log_format main "$remote_addr - $remote_user [$time_local] "$request" " "$status $body_bytes_sent "$http_referer" " ""$http_user_agent" "$http_x_forwarded_for""; access_log /usr/local/var/logs/access.log main; sendfile on; keepalive_timeout 65; port_in_redirect off; include /usr/local/etc/nginx/sites-enabled/*; }
設(shè)置nginx php-fpm配置文件
vim /usr/local/etc/nginx/conf.d/php-fpm #proxy the php scripts to php-fpm location ~ .php$ { try_files $uri = 404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_intercept_errors on; include /usr/local/etc/nginx/fastcgi.conf; }
nginx虛擬主機(jī)準(zhǔn)備工作
#創(chuàng)建 info.php index.html 404.html 403.html文件到 /var/www 下面 vi /var/www/info.php vi /var/www/index.html vi /var/www/403.html vi /var/www/404.html
創(chuàng)建默認(rèn)虛擬主機(jī)default
vim /usr/local/etc/nginx/sites-available/default輸入:
server { listen 80; server_name localhost; root /var/www/; access_log /usr/local/var/logs/nginx/default.access.log main; location / { index index.html index.htm index.php; autoindex on; include /usr/local/etc/nginx/conf.d/php-fpm; } location = /info { allow 127.0.0.1; deny all; rewrite (.*) /.info.php; } error_page 404 /404.html; error_page 403 /403.html; }
創(chuàng)建ssl默認(rèn)虛擬主機(jī)default-ssl
vim /usr/local/etc/nginx/sites-available/default-ssl輸入:
server { listen 443; server_name localhost; root /var/www/; access_log /usr/local/var/logs/nginx/default-ssl.access.log main; ssl on; ssl_certificate ssl/localhost.crt; ssl_certificate_key ssl/localhost.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { include /usr/local/etc/nginx/conf.d/php-fpm; } location = /info { allow 127.0.0.1; deny all; rewrite (.*) /.info.php; } error_page 404 /404.html; error_page 403 /403.html; }
創(chuàng)建phpmyadmin虛擬主機(jī)
vim /usr/local/etc/nginx/sites-available/phpmyadmin #輸入以下配置 server { listen 306; server_name localhost; root /usr/local/share/phpmyadmin; error_log /usr/local/var/logs/nginx/phpmyadmin.error.log; access_log /usr/local/var/logs/nginx/phpmyadmin.access.log main; ssl on; ssl_certificate ssl/phpmyadmin.crt; ssl_certificate_key ssl/phpmyadmin.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { index index.html index.htm index.php; include /usr/local/etc/nginx/conf.d/php-fpm; } }
設(shè)置SSL
mkdir -p /usr/local/etc/nginx/ssl openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=State/L=Town/O=Office/CN=localhost" -keyout /usr/local/etc/nginx/ssl/localhost.key -out /usr/local/etc/nginx/ssl/localhost.crt openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=State/L=Town/O=Office/CN=phpmyadmin" -keyout /usr/local/etc/nginx/ssl/phpmyadmin.key -out /usr/local/etc/nginx/ssl/phpmyadmin.crt
創(chuàng)建虛擬主機(jī)軟連接,開啟虛擬主機(jī)
ln -sfv /usr/local/etc/nginx/sites-available/default /usr/local/etc/nginx/sites-enabled/default ln -sfv /usr/local/etc/nginx/sites-available/default-ssl /usr/local/etc/nginx/sites-enabled/default-ssl ln -sfv /usr/local/etc/nginx/sites-available/phpmyadmin /usr/local/etc/nginx/sites-enabled/phpmyadmin
啟動(dòng)|停止Nginx
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
接下來你可以通過下面這些連接訪問:
設(shè)置快捷服務(wù)控制命令
http://localhost/ -> index.html
http://localhost/info -> info.php via phpinfo();
http://localhost/404 -> 404.html
https://localhost/ -> index.html(SSL)
https://localhost/info -> info.php via phpinfo();(SSL)
https://localhost/404 -> 404.html(SSL)
https://localhost:306 -> phpmyadmin(SSL)
為了后面管理方便,將命令 alias 下,vim ~/.bash_aliases 輸入一下內(nèi)容:
alias nginx.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist" alias nginx.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist" alias nginx.restart="nginx.stop && nginx.start" alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist" alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist" alias php-fpm.restart="php-fpm.stop && php-fpm.start" alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" alias mysql.restart="mysql.stop && mysql.start" alias redis.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist" alias redis.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist" alias redis.restart="redis.stop && redis.start" alias memcached.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist" alias memcached.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist" alias memcached.restart="memcached.stop && memcached.start"
#讓快捷命令生效 echo "[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases" >> ~/.bash_profile source ~/.bash_profile #創(chuàng)建站點(diǎn)目錄到主目錄,方便快捷訪問 ln -sfv /var/www ~/htdocs
有時(shí)間會(huì)進(jìn)一步整理一下,感覺有點(diǎn)亂,第一次在segmentfault上碼字,寫到一半的時(shí)候不小心滑一下觸摸板,瀏覽器后退了,雖然有提示不要離開,點(diǎn)擊了不離開之后,Safari白屏。 然后還特地去吐了個(gè)槽, 害我白白又浪費(fèi)很久來寫這個(gè)博客。希望能幫助到剛剛接觸Mac的同學(xué)。enjoy Mac‘s development EVN :)
參考資料:Install Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X Mavericks using Homebrew
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/20792.html
摘要:本開發(fā)環(huán)境,全部基于安裝。制作全新安裝啟動(dòng)盤。插上盤,在終端執(zhí)行是你的盤盤符,根據(jù)實(shí)際情況來。安裝開發(fā)常用的包軟件安裝開發(fā)包升級(jí)一下系統(tǒng)自帶的安裝常用軟件是個(gè)很不錯(cuò)的東西,推薦必須安裝。 用了一年的Mac OS X了,之前不熟悉這個(gè)系統(tǒng),用的是系統(tǒng)自帶的PHP 以及DMG包安裝的MySQL,時(shí)間長(zhǎng)了,慢慢覺得MacBook的速度跟不上了,雖然關(guān)機(jī)次數(shù)不多,但是每次開機(jī),或者喚醒電...
摘要:既然是從零開始,那么就把作為統(tǒng)一的安裝工具。下面附上安裝方法安裝好之后,就可以開始搭建環(huán)境了。環(huán)境安裝比較簡(jiǎn)單安裝好之后,首先要啟動(dòng)服務(wù)。和一起安裝,我們先去安裝,再做相關(guān)配置。成功解析還差一步,就是修改配置文件。 既然是從零開始,那么就把 homebrew 作為統(tǒng)一的安裝工具。如果你不知道 homebrew 是什么東東,移步這里。下面附上 homebrew 安裝方法: /usr/bi...
摘要:既然是從零開始,那么就把作為統(tǒng)一的安裝工具。下面附上安裝方法安裝好之后,就可以開始搭建環(huán)境了。環(huán)境安裝比較簡(jiǎn)單安裝好之后,首先要啟動(dòng)服務(wù)。和一起安裝,我們先去安裝,再做相關(guān)配置。成功解析還差一步,就是修改配置文件。 既然是從零開始,那么就把 homebrew 作為統(tǒng)一的安裝工具。如果你不知道 homebrew 是什么東東,移步這里。下面附上 homebrew 安裝方法: /usr/bi...
閱讀 1876·2021-09-24 09:48
閱讀 3220·2021-08-26 14:14
閱讀 1674·2021-08-20 09:36
閱讀 1460·2019-08-30 15:55
閱讀 3627·2019-08-26 17:15
閱讀 1425·2019-08-26 12:09
閱讀 606·2019-08-26 11:59
閱讀 3323·2019-08-26 11:57