AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-379699

Berlin's questions

Martin Hope
Berlin
Asked: 2017-07-25 16:10:08 +0800 CST

如果 url/file 不存在,nginx 提供与本地服务器不同的文件名

  • 1

如果文件不存在,有没有办法app-*.js在其他文件夹中服务器另一个文件,例如:

转到网址:http ://www.example.com/assets/build/app/app-48fee50a26.js

我收到以下错误消息:

[error] 17788#17788: *1 open() "/var/app/assets/build/app/app-48fee50a26.js" failed (2: No such file or directory), client: , server: , request: "GET /assets/build/app/app-48fee50a26.js HTTP/1.1", host:""

我想在同一文件夹中提供任何其他 js 文件/var/app/assets/build/app/,但其他文件的名称可以不断更改,例如app-62a5962b0a11.js. 我在想app\-(.*)\.js。

以下所有示例均无效:

server {
        listen 80 default_server;
        root /var/app;

        location /assets/build/app/app\-(.*)\.js {
                try_files $uri $uri/ /assets/build/app/app\-(.*)\.js;
        }
}

server {
        listen 80 default_server;
        root /var/app;

        location /assets/build/app/app\-(.*)\.js {
                try_files $uri $uri/ /var/app/assets/build/app/app\-(.*)\.js;
        }
}


Also not working without regex to the location of the other file.

server {
        listen 80 default_server;
        root /var/app;

        location /assets/build/app/app\-(.*)\.js {
                try_files $uri $uri/ /var/app/assets/build/app/app-62a5962b0a11.js;
        }
}

server {
        listen 80 default_server;
        root /var/app;

        location /assets/build/app/app\-(.*)\.js {
                try_files $uri $uri/ /assets/build/app/app-62a5962b0a11.js;
        }
}
nginx
  • 1 个回答
  • 1390 Views
Martin Hope
Berlin
Asked: 2017-07-21 04:02:33 +0800 CST

检查单个 PHP-FPM 进程的平均内存使用情况

  • 2

我尝试了以下命令来检查单个 PHP-FPM 进程的平均内存使用情况

ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'

我得到了一个错误awk: cmd. line:1: fatal: division by zero attempted

而这个命令

total=0; for i in `ps -C php-fpm -o rss=`; do total=$(($total+$i)); done; echo "Memory usage: $total kb";
Memory usage: 0 kb

ps -ef | grep php
root       9435      1  0 11:42 ?        00:00:00 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
somename+   9438   9435  0 11:42 ?        00:00:00 php-fpm: pool somename-1
somename+   9439   9435  0 11:42 ?        00:00:01 php-fpm: pool somename-1 
...
...
linux
  • 2 个回答
  • 11664 Views
Martin Hope
Berlin
Asked: 2017-01-13 02:40:01 +0800 CST

mysql-community-client 需要 libncurses.so.6()(64bit)

  • 0

我一直在尝试安装mysql-community-client-5.7.17-1.fc25.x86_64.rpm并且CentOS Linux release 7.3.1611RPM 抱怨libncurses.so.6()(64bit)

rpm -Uvh mysql-community-client-5.7.17-1.fc25.x86_64.rpm

warning: mysql-community-client-5.7.17-1.fc25.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
        libncurses.so.6()(64bit) is needed by mysql-community-client-5.7.17-1.fc25.x86_64
        libstdc++.so.6(GLIBCXX_3.4.20)(64bit) is needed by mysql-community-client-5.7.17-1.fc25.x86_64
        libstdc++.so.6(GLIBCXX_3.4.21)(64bit) is needed by mysql-community-client-5.7.17-1.fc25.x86_64
        libtinfo.so.6()(64bit) is needed by mysql-community-client-5.7.17-1.fc25.x86_64

-

CentOS Linux release 7.3.1611 (Core)
Derived from Red Hat Enterprise Linux 7.3 (Source)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)
cpe:/o:centos:centos:7 
centos mysql
  • 1 个回答
  • 2270 Views
Martin Hope
Berlin
Asked: 2016-12-20 15:28:48 +0800 CST

systemd 的 mysqld.service - 无法解析资源值,忽略:40000 - LimitMEMLOCK

  • 1

当我为 MYSQL 5.7mysql systemd[1]: [/usr/lib/systemd/system/mysqld.service:39] Failed to parse resource value, ignoring: 40000设置限制时,我在使用 mysql 5.7 的 Centos 7 上遇到了这个错误。LimitMEMLOCK

LimitMEMLOCK=40000
  1. 为什么不能为 设置数字限制LimitMEMLOCK?
  2. 目的是LimitMEMLOCK什么?
  3. 是唯一的灵魂LimitMEMLOCK=infinity吗?

*

#cat /etc/*-release
CentOS Linux release 7.3.1611 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)

*

service mysqld status
Redirecting to /bin/systemctl status  mysqld.service
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2016-12-19 23:21:24 UTC; 9s ago
 Main PID: 11170 (mysqld)
   CGroup: /system.slice/mysqld.service
           └─11170 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

mysql systemd[1]: Starting MySQL Server...
mysql mysqld_pre_systemd[11143]: /usr/sbin/restorecon:  Warning no default label for /mnt/data/mysql
mysql systemd[1]: Started MySQL Server.
mysql systemd[1]: [/usr/lib/systemd/system/mysqld.service:39] Failed to parse resource value, ignoring: 40000

在其他 Centos 7 版本 ( CentOS Linux release 7.2.1511 (Core))mysqld.service上使用LimitMEMLOCK=40000.

cat /etc/*-release
CentOS Linux release 7.2.1511 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.2.1511 (Core)
CentOS Linux release 7.2.1511 (Core)
mysql centos7 systemd
  • 1 个回答
  • 2435 Views
Martin Hope
Berlin
Asked: 2016-12-20 08:08:37 +0800 CST

Centos 7 上的 Mysql 5.7 - cpio:读取失败 - 没有这样的文件或目录

  • 1

我尝试在 centos 7 上安装 mysql 5.7,但出现以下错误,

我能够在不同的机器上多次成功安装 centos 7,但这是我第一次遇到这个问题。

知道为什么会发生以及如何解决吗?

# cat /etc/*-release
CentOS Linux release 7.3.1611 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)

*

# yum install cpio -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.heanet.ie
 * extras: ftp.heanet.ie
 * updates: ftp.heanet.ie
Package cpio-2.11-24.el7.x86_64 already installed and latest version
Nothing to do  

*

# rpm  -U /tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm
error: unpacking of archive failed on file /usr/bin/mysqladmin;585801cb: cpio: read failed - No such file or directory
error: mysql-community-client-5.7.16-1.el7.x86_64: install failed

*

* remote_file[/tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm] action create (up to date)
* rpm_package[mysql-community-client-5.7.16-1.el7.x86_64.rpm] action install
================================================================================
Error executing action `install` on resource 'rpm_package[mysql-community-client-5.7.16-1.el7.x86_64.rpm]'
================================================================================


Chef::Exceptions::Exec
----------------------
rpm  -U /tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm returned 1, expected 0


Resource Declaration:
---------------------

 24:        rpm_package pkg do
 25:         source "/tmp/#{pkg}"
 26:         action :install
 27:         end
 28:



Compiled Resource:
------------------

rpm_package("mysql-community-client-5.7.16-1.el7.x86_64.rpm") do
  provider Chef::Provider::Package::Rpm
  action [:install]
  retries 0
  retry_delay 2
  package_name "mysql-community-client-5.7.16-1.el7.x86_64.rpm"
  source "/tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm"
  version "5.7.16-1.el7"
  recipe_name "mysql57_centos7"
end

ERROR: rpm_package[mysql-community-client-5.7.16-1.el7.x86_64.rpm] had an error: Chef::Exceptions::Exec: rpm  -U /tmp/mysql-community-client-5.7.16-1.el7.x86_64.rpm returned 1, expected 0
FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
centos mysql centos7 cpio
  • 1 个回答
  • 2616 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve