macos 安装之后的配置
解除限值安装其他包
sudo spctl --master-disable
安装 xcode
xcode-select --install
安装 Homebrew
# 国内很慢的:
1.修改二进制文件下载使用国内源
临时替换
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
长期替换
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
2.安装:
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# 卸载
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
# 变量环境
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
# 配置生效
source ~/.bash_profile
source ~/.zshrc
配置 brew 源
# 检查
brew doctor
# 默认安装位置
/usr/local/Homebrew
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
brew update
brew upgrade
配置 zsh
brew install zsh zsh-completions
chsh -s /bin/zsh
# oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
shell 代理
# 需要重启
echo export ALL_PROXY=socks5://127.0.0.1:54321 >> ~/.bash_profile
echo export ALL_PROXY=socks5://127.0.0.1:54321 >> ~/.zshrc
安装软件
# 安装软件
# 开发软件
brew cask install shadowsocksx-ng
brew cask install iterm2
brew cask install phpstorm
brew cask install visual-studio-code
brew cask install sublime-text
brew cask install sourcetree
brew cask install filezilla
brew cask install sequel-pro
brew cask install dash
brew cask install typora
# 下载第三方应用
brew cask install sogouinput
brew cask install qq
brew cask install iina
brew cask install dingtalk
brew cask install alfred
brew cask install appcleaner
brew cask install cheatsheet
brew cask install onedrive
brew cask install google-chrome
brew cask install youdaodict
brew cask install youdaonote
brew cask install microsoft-office
brew cask install snipaste
brew cask install aliwangwang
brew cask install mos
brew cask install jietu
brew cask install neteasemusic
brew cask install youku
brew cask install qqlive
安装 php 开发环境 推荐mdserver(开源,但是问题比较多未修复) 先安装
brew install curl
安装之后新建一个站点配置文件(/Applications/mdserver/bin/openresty/nginx/conf)
; 配置模板,{}里面的就是需要改动的
; tmp_(你设置的域名).conf
; 在启动或停止时,会相应的创建删除
; 如果想配置自己
; own_(你的设置域名).conf
; 这样就不回删除你设置的配置
server {
listen {PORT};
server_name {SERVERNAME};
root {PATH};
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~ \.php {
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php{VERSION}-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_buffer_size 128k;
fastcgi_buffers 32 32k;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
}
配置php xdebug
[xdebug]
; 增加如下
xdebug.remote_host = localhost
xdebug.remote_port = 9100
xdebug.show_local_vars = 1
xdebug.remote_autostart= On
配置mysql
# 默认登录是root,密码root
# 也可以初始化密码
sudo /Applications/mdserver/bin/mysql/bin/mysql_secure_installation
配置命令行代理
# 编辑
nano ~/.zshrc
# 配置代理
alias goproxy='export http_proxy=http://127.0.0.1:54321 https_proxy=http://127.0.0.1:54321'
alias disproxy='unset http_proxy https_proxy'
# 生效
source ~/.zshrc
# 测试
curl cip.cc