Mac下homebrew安装

Mac下homebrew安装需要替换国内镜像 usr bin ruby e curl fsSLhttps cdn jsdelivr net gh ineo6 homebrew install install 该脚本用了中科大镜像加速访问 仅修改仓库地址部分 不会产生安全隐患 关于中科大所提供的 Homebrew 镜像服务 https lug ustc edu cn wiki mirrors help brew git 以下是中科大的 Homebrew 安装帮助 Homebrew

需要替换国内镜像

/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)" 

该脚本用了中科大镜像加速访问,仅修改仓库地址部分,不会产生安全隐患。 关于中科大所提供的 Homebrew 镜像服务 https://lug.ustc.edu.cn/wiki/mirrors/help/brew.git

Mac下homebrew安装

以下是中科大的Homebrew安装帮助  Homebrew 源使用帮助 — USTC Mirror Help 文档Mac下homebrew安装http://mirrors.ustc.edu.cn/help/brew.git.html#homebrew-linuxbrew

设置环境变量

echo ‘eval “$(/opt/homebrew/bin/brew shellenv)”‘ >> /Users/zhangweijing/.zprofile

eval “$(/opt/homebrew/bin/brew shellenv)”

替换核心库

需要更改 Homebrew 的安装源,将其替换成国内镜像。

这里用的是由中科大负责托管维护的 Homebrew 镜像。其中,前两个为必须配置的项目,后两个可按需配置。

若用户设置了环境变量 HOMEBREW_BREW_GIT_REMOTE,则每次运行 brew update 时将会自动设置远程。 推荐用户将环境变量 HOMEBREW_BREW_GIT_REMOTE 加入 shell 的 profile 设置中。

# 对于 bash 用户 
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> ~/.bash_profile
# 对于 zsh 用户 
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> ~/.zshrc
  • 替换brew.git
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" brew update

重置为官方地址:

unset HOMEBREW_BREW_GIT_REMOTE git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew 

备注

重置回默认远程后,用户应该删除 shell 的 profile 设置中的环境变量 HOMEBREW_BREW_GIT_REMOTE 以免运行 brew update 时远程再次被更换。

若之前使用的 git config url.<URL>.insteadOf URL 的方式设置的镜像,请手动删除 config 文件(一般为 ~/.gitconfig 或仓库目录下的 .git/config)中的对应字段。

  • 替换 homebrew-core.git:

若用户设置了环境变量 HOMEBREW_CORE_GIT_REMOTE,则每次运行 brew update 时将会自动设置远程。 推荐用户将环境变量 HOMEBREW_CORE_GIT_REMOTE 加入 shell 的 profile 设置中。

# 对于 bash 用户 echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"' >> ~/.bash_profile # 对于 zsh 用户 echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"' >> ~/.zshrc //export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" brew update

重置为官方地址:

unset HOMEBREW_CORE_GIT_REMOTE brew tap --custom-remote homebrew/core https://github.com/Homebrew/homebrew-core
  • Homebrew Cask 源

使用 USTC 镜像安装,或将已安装的仓库远程替换为 USTC 镜像:

brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.ustc.edu.cn/homebrew-cask.git
  • Homebrew Bottles 源

 请在运行 brew 前设置环境变量 HOMEBREW_BOTTLE_DOMAIN,值为 https://mirrors.ustc.edu.cn/homebrew-bottles 。

# 对于 zsh 用户 echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"' >> ~/.zshrc

brew update

brew安装supervisor

1、安装:brew install supervisor

2、自动随系统启动:brew services start supervisor

停止supervisor:brew services stop supervisor

3、手动启动 supervisord -c /usr/local/etc/supervisord.ini

4、启动命令行supervisorctl -c /usr/local/etc/supervisord.ini   进入supervisor 可以使用supervisor 的命令

5、主配置文件 /usr/local/etc/supervisord.ini 这个文件是在安装完成后就有的,这个时候需要根据配置文件里的说明添加守护的进程的配置文件

6、守护的进程的配置文件  

先在/usr/local/etc/    下创建文件夹supervisor.d

mkdir /usr/local/etc/supervisor.d/

7、vim /usr/local/etc/supervisor.d/horizon.ini 

8、这个时候就可以根据需要的配置去配置具体的需要守护的进程的参数

这里以laravel horizon为例做一下说明

文件名/usr/local/etc/supervisor.d/horizon.ini

[program:horizon]  //守护的进程的名称

process_name=%(program_name)s //supervisord进程名称

command=php /Users/zhangdengke/eclipse-workspace/project_mqs/wwwroot/artisan  horizon  //守护的进程的执行命令

autostart=true //自动启动

autorestart=true //自动重启

user=zhangdengke //执行的用户名

redirect_stderr=true //是否打印错误日志(在命令行中还是在日志中)

stdout_logfile=/Users/zhangdengke/eclipse-workspace/project_mqs/logs/horizon.log  //记录日志位置

到此supervisor的程序安装和配置已经完成。

macOS如果是通过homebrew安装的话,默认的supervisor的配置是在下面的路径:

/opt/homebrew/etc/supervisord.conf 

默认的配置在

[include]

files = /opt/homebrew/etc/supervisor.d/*.ini

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/233229.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • python3.7安装pycrypto

    python3.7安装pycrypto首先直接打开 cmd 注意不是打开 python 也不用切换到 python 命令行直接输入 pip3installp 我这里安装过了 所以提示我已经安装过 如果未安装则提示安装成功然后找到你的 python 包的安装目录 也就是上面我们提示的 c users 杨 appdata local programs python python37 lib sit

    2025年6月16日
    3
  • Fatal error: require(): Failed opening required ‘/www/wwwroot/xxxxxx/public/../thinkphp/start.php

    Fatal error: require(): Failed opening required ‘/www/wwwroot/xxxxxx/public/../thinkphp/start.php项目场景:在CentOS8中安装了宝塔,配置thinkphp5.1版本环境时出了问题,在此之前网站虚拟域名成功配置,能够访问站点创建成功的页面问题描述:在访问tp5默认页面时报错Warning:require():open_basedirrestrictionineffect.File(/home/wwwroot/xxxxxx/thinkphp/start.php)isnotwithintheallowedpath(s):(/home/wwwroot/xxxxxx/pub

    2022年8月22日
    5
  • 微信多业务 – 消息转发多业务

    微信多业务 – 消息转发多业务

    2021年9月7日
    52
  • latex的参考文献写法标准_endnote怎么修改参考文献编号格式

    latex的参考文献写法标准_endnote怎么修改参考文献编号格式LaTeX参考文献的排版与引用​ 在论文写作的过程中,为了体现论文的科学性、严谨性和规范性,我们常常需要引用大量的参考文献来引证自己的观点。参考文献(Reference)往往都是放在论文的最后,记录了所引用论文的标题、作者、期刊或会议、出版时间等信息,文中还需要明确有顺序的进行引用标注。​ 本篇将介绍LaTeX常用的参考文献排版与引用方式,所用到的宏包都要写在\documentclass命令之后和\begin{docuemnt}之前,在本文中,我们会用的宏包文件有:\usepackag

    2025年10月13日
    2
  • python爬虫实战项目,做完直接进阶

    python爬虫实战项目,做完直接进阶

    2021年11月11日
    53
  • 前后端分离 vue spring boot_springbootvue集成

    前后端分离 vue spring boot_springbootvue集成源码链接:https://pan.baidu.com/s/1E0e72K6P3_xtkFscL6iEtQ提取码:t2te一、环境、工具jdk1.8mavenspring-bootideaVSVodevue二、搭建后台spring-boot框架步骤:1、new-project选择SpringInitializrnext2、创建项目文件结构以…

    2022年8月22日
    9

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号