乐趣区

mac小技巧

Mac 安装 mysql 后配置文件
Mac 安装 mysql 后配置文件
mysql -u root -proot 本机 mysql 账号密码
关于 zsh 终端的一个坑
修改完 ~/.bash_profile 添加全局变量后,用 zsh 终端重新打开,还是找不到命令。解决办法,在 ~/.zshrc 里添加
source ~/.bash_profile
即每次打开终端,自动执行一遍配置文件,就能找到对应命令了
Mac 自带 apache 的使用
sudo apachectl start // 启动
sudo apachectl stop // 停止
配置文件目录
/etc/apache2/httpd.conf
站点根目录
/Library/WebServer/Documents/
Mac 安装 nginx
安装
brew install nginx
安装完提示
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx now and restart at login:
brew services start nginx
Or, if you don’t want/need a background service you can just run:
nginx
根据提示,直接输入 nginx 命令就可以打开服务器了。
站点根目录在 /usr/local/var/www。配置文件在 /usr/local/etc/nginx/nginx.conf。
Mac 使用小技巧
在终端打开访达,直接运行 open 命令即可。比如想往一个目录复制文件,在命令行里 cd 到路径后,通过 open 命令打开访达,复制文件更方便
open . // 打开当前目录

退出移动版