常用命令- Nginx 安装配置使用

本文详细介绍Nginx的基本操作步骤,包括启动、停止、重启、查看版本及配置文件编辑等,适合Nginx初学者快速上手。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

-----------------------------------------------Niginx-----------------------------------------------------

1、终端中输入:whereis nginx

(/usr/local/nginx/sbin)

2、cd /usr/local/nginx/sbin

3、启动 ./nginx

4、查看Nginx的版本号:nginx -V

5、停止 nginx -s stop

6、退出 nginx -s quit

7、重启加载配置 nginx -s reload

启动:

cd /usr/local/nginx/sbin

./nginx

查看进程:

[root@localhost nginx]# ps -ef | grep nginx
root       6142      1  0 02:27 ?        00:00:00 nginx: master process ./nginx
nobody     6143   6142  0 02:27 ?        00:00:00 nginx: worker process
root      17265   1550  0 05:14 pts/0    00:00:00 grep --color=auto nginx
 

查看配置文件:

[root@localhost conf]# cd /usr/local/nginx/conf
[root@localhost conf]# vi nginx.conf
    server {
        listen       80;
        server_name  localhost;
 

访问Niginx主页 http://192.168.231.138/

或者 curl 192.168.231.138:80


 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值