【centos7】一些常用工具的安装配置

nvm管理(node版本)软件

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
或者
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

安装完成之后触发配置

source ~/.bashrc

安装composer

全局安装
你可以将此文件放在任何地方。如果你把它放在系统的 PATH 目录中,你就能在全局访问它。 在类Unix系统中,你甚至可以在使用时不加 php 前缀。

你可以执行这些命令让 composer 在你的系统中进行全局调用:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

安装Redis5

wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar -zxvf redis-5.0.5.tar.gz
#进入解压好的目录并编译Redis
cd redis-5.0.5
make
#编译完成后进入src目录进行安装
cd src
# 如果安装到指定的目录则添加一个参数PREFIX
# make install PREFIX=/usr/local/redis
# 如果默认使用默认安装路径(/usr/local/bin)则直接使用如下命令
make install

设置redis开机启动

#将配置文件放入/etc/redis
mkdir /etc/redis
cp ~/redis-5.0.5/redis.conf /etc/redis
#systemctl添加redis
#在/lib/systemd/system目录下创建一个脚本文件redis.service,里面的内容如下:
[Unit]
Description=Redis
After=network.target

[Service]
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf  --daemonize no
ExecStop=/usr/local/bin/redis-cli -h 127.0.0.1 -p 6379 shutdown

[Install]
WantedBy=multi-user.target
#创建软链接
ln -s /lib/systemd/system/redis.service /etc/systemd/system/multi-user.target.wants/redis.service
#刷新配置
systemctl daemon-reload
#启动、重启、停止
systemctl start redis
systemctl restart redis
systemctl stop redis
#redis服务加入开机启动
systemctl enable redis
#禁止开机启动
systemctl disable redis
查看状态
systemctl status redis

安装supervisor

supervisor:要安装的软件的名称。
supervisord:装好supervisor软件后,supervisord用于启动supervisor服务。
supervisorctl:用于管理supervisor配置文件中program。

yum install epel-release
yum install supervisor

systemctl enable supervisord.service # 开机自启动
systemctl start supervisord.service # 启动supervisord服务
systemctl status supervisord.service # 查看supervisord服务状态

# 开启web服务:修改supervisord.conf ,inet_http_server节点取消注释。
vim /etc/supervisord.conf 
supervisorctl reload
[inet_http_server]   ; inet (TCP) server disabled by default
port=*:9001          ; (ip_address:port specifier, *:port for all iface)
username=root        ; (default is no username (open server))
password=root        ; (default is no password (open server))

ps -ef|grep supervisord # 查看是否存在supervisord进程
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小树ZW

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值