将nginx添加到永久环境变量/etc/profile

在/etc/profile配置文件中加入

html 复制代码
vim /etc/profile
bash 复制代码
export NGINX_HOME=/usr/local/nginx
export PATH=$PATH:$NGINX_HOME/sbin
bash 复制代码
sed -i 'aexport NGINX_HOME=/usr/local/nginx' /etc/profile
sed -i 'aPATH=$PATH:$NGINX_HOME/sbin' /etc/profile

export NGINX_HOME=安装路径

export PATH=引用安装路径变量/sbin

添加完之后一定要重新执行配置文件。

bash 复制代码
source /etc/profile
bash 复制代码
sh /etc/profile
bash 复制代码
. /etc/profile
相关推荐
luck_bor7 分钟前
IO流知识点笔记
java·开发语言·笔记
大圣编程1 小时前
面向对象深度理解
java·开发语言·算法
影寂ldy1 小时前
C# const 常量 / readonly 只读 / static readonly
java·开发语言·c#
摇滚侠1 小时前
Maven 入门+高深 体系外 jar 包导入 172
java·maven·jar
做个文艺程序员1 小时前
第02篇:K8s 存储与配置管理:ConfigMap、Secret、PV/PVC 实战——Java SaaS 多租户配置最佳实践
java·容器·kubernetes
爱吃牛肉的大老虎1 小时前
Spring中用到的设计模式
java·spring·设计模式
Refrain_zc1 小时前
Android TV 语音消息实战:遥控器 PCM 录音失真修复与扬声器强制播放方案
java
Stick_ZYZ1 小时前
从“能调用工具”到“能稳定执行任务”:Agent 工程化的下一步
java·人工智能·后端·spring·ai
代码中介商1 小时前
C++四大设计模式:单例、工厂、观察者、策略
java·c++·设计模式
LIZHUOLONG11 小时前
linux 设备初始化
linux·运维·服务器