首先祝大家新年快乐!已经很久没更新了,新的一年新的开始哈哈~
由于电脑装的东西比较杂,希望把 Mac 整得干净些,所以元旦把电脑重置了一下,然后就是必装软件都补上了。列个清单:(主要参考 awesome-mac)
- 终端 iterm2
- 浏览器 Chrome
- JDK, IDEA
- 视频播放器 iina
- Host 编辑 SwitchHosts
- 解压软件 theunarchiver
- 截图 jietu.qq.com
- 挂载 NTFS 文件系统 mounty
- 菜单栏时间日历 Day-O
- Finder 直达终端 FinderGo
- 干净卸载工具 appcleaner
临时科学上网方法:
ssh -fC2qTnN -D 127.0.0.1:9999 -p <22远程端口> user@IPf 后台运行, C 压缩, 2: 版本 2 协议, q 静默模式, T 禁用伪终端分配, n 阻止从 stdin 读取, N 不执行远程命令, D 绑定本地地址, p 端口 默认 22 可不写.然后在 SwitchyOmega 配置 socks5 127.0.0.1:9999
SSH SOCKS5 代理
然后是 HomeBrew 的安装了,打开链接按提示安装:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 之后配置镜像,要不然每次都会在 brew update 等待:
homebrew 镜像, homebrew bottles 环境变量
1 2 3 4 5 6 7 8git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git brew update 然后将这句添加到 ~/.profile 里(再在 ~/.zshrc 或 ~/.bashrc 里 加上 <code>source ~/.profile</code>): export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
接下来安装 Nginx, MySQL, PHP:
macOS使用Homebrew搭建PHP环境
brew install phpbrew services start phpbrew install mysqlbrew services start mysqlbrew install nginxbrew services start nginx
上面命令都是用当前账号启动的 PHP/Nginx/MySQL, 装完 MySQL 后会提示没有设置密码,按照提示的命令执行 mysql_secure_installation 就好。然后 Nginx 是普通用户启动的,默认是 8080 端口,不是 80.
下载WordPress 在本地搭个演示环境。首先在 /usr/local/etc/nginx/servers 新建个 .conf 文件,文件名任意,内容:
在Nginx上为WordPress固定链接配置Rewrite
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25server { listen 8080; #普通用户没有权限监听 80 所以默认是 8080 server_name local.blog; #站点域名 需要编辑 hosts 加上 root /Users/youthlin.chen/www/local.blog/; #站点目录 index index.html index.htm index.php; location ~ [^/]\.php(/|$) { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } if (!-e $request_filename) { rewrite (.*) /index.php; #固定链接 } location ~ /.well-known { allow all; } location ~ /\. { deny all; } }
Reader Echoes
5 comments