1、http://wmpublish.mp.sztv.com.cn:8026/wx/robots.txt ,响应成功,表明 Nginx 的配置是正确的
User-agent: *
Disallow: /
2、http://wmpublish.mp.sztv.com.cn:8026/v1/channel-app-sources?group_id=channel ,响应失败,没有指定输入文件
No input file specified.
3、在容器中运行命令,查看 Nginx 错误日志,如图1

cat /var/log/nginx/error.log
2018/09/28 03:27:00 [error] 464#464: *225 FastCGI sent in stderr: "Unable to open primary script: /sobey/www/channel-pub-api/api/web/index.php (No such file or directory)" while reading response header from upstream, client: 192.168.8.4, server: wmpublish.mp.sztv.com.cn, request: "GET /v1/channel-app-sources?filter[source_uuid]=27ba60d97ebc92f093502e4e12a37e7f&filter[status]=1&group_id=spider&filter[source]=spider HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "wmpublish.mp.sztv.com.cn:8026"
4、在容器中运行命令,查看文件内容,发现文件是存在的,如图2

cat /sobey/www/channel-pub-api/api/web/index.php
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
require __DIR__ . '/../../common/config/main.php',
require __DIR__ . '/../../common/config/main-local.php',
require __DIR__ . '/../config/main.php',
require __DIR__ . '/../config/main-local.php'
);
(new yii\web\Application($config))->run();5、执行命令:ps -u nginx,显示 nginx 用户下的所有进程,正常情况(开发环境),应该如下所示,如图3

ps -u nginx
PID TTY TIME CMD
477 ? 00:00:03 nginx
478 ? 00:00:05 nginx
479 ? 00:00:06 nginx
480 ? 00:00:04 nginx
4672 ? 00:00:00 php-fpm
4673 ? 00:00:00 php-fpm
4674 ? 00:00:00 php-fpm
4675 ? 00:00:00 php-fpm
4676 ? 00:00:00 php-fpm
4677 ? 00:00:00 php-fpm
4678 ? 00:00:00 php-fpm
4679 ? 00:00:00 php-fpm
4680 ? 00:00:00 php-fpm
4681 ? 00:00:00 php-fpm
4682 ? 00:00:00 php-fpm
4683 ? 00:00:00 php-fpm
4684 ? 00:00:00 php-fpm
4685 ? 00:00:00 php-fpm
4686 ? 00:00:00 php-fpm
4687 ? 00:00:00 php-fpm
4688 ? 00:00:00 php-fpm
4689 ? 00:00:00 php-fpm
4690 ? 00:00:00 php-fpm
4691 ? 00:00:00 php-fpm
6、执行命令:ps -u nginx,显示 nginx 用户下的所有进程,发现没有 php-fpm,如图4

ps -u nginx
PID TTY TIME CMD
463 ? 00:00:03 nginx
464 ? 00:00:05 nginx
465 ? 00:00:06 nginx
466 ? 00:00:04 nginx
7、最后分析结果,原因在于 9000 端口已经被占用,导致 php-fpm 启动失败,将占用 9000 端口的服务停止,则 php-fpm 启动成功。http://wmpublish.mp.sztv.com.cn:8026/v1/channel-app-sources?group_id=channel ,响应成功
10000获取渠道的应用的来源列表成功<_links>http://wmpublish.mp.sztv.com.cn:8026/v1/channel-app-sources?group_id=channel&per-page=1&page=1<_meta>0011
Linux 服务器运维、部署与线上故障排查
如果你的网站或后端服务部署在 Linux 服务器上,遇到访问异常、Nginx 配置问题、MySQL / Redis 异常、Docker 服务不可用、磁盘占满、CPU / 内存过高等问题,可以联系我做一次远程排查。
适合以下场景:
✅ 网站打不开或访问不稳定
✅ Nginx / PHP-FPM 配置异常
✅ MySQL / Redis 性能或连接问题
✅ Docker 服务部署与维护
✅ 服务器迁移与环境配置
✅ CPU / 内存 / 磁盘异常排查
服务内容:
✅ Linux 环境检查
✅ 网站部署与迁移
✅ Nginx / PHP-FPM / MySQL / Redis 排查
✅ Docker 配置与维护
✅ 服务器性能分析
✅ 长期远程运维支持
如需咨询,请联系我,并注明:Linux 运维咨询。
联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

发表回复