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-98791

a coder's questions

Martin Hope
a coder
Asked: 2025-02-13 06:12:29 +0800 CST

在 Windows Server 2022 中配置 RDP 以使用正确的安全证书

  • 5

正在修复针对 Server 2022 实例登录 RDP 时出现的“证书不是来自受信任的颁发机构”错误。它认为我正在使用自签名证书,但我有一个来自 InCommon 的有效证书。

在此处输入图片描述

如上所述,我从有效提供商处获得了正确的 PEM 编码安全证书。

我将此证书添加到控制台 - 远程桌面 - 证书:

在此处输入图片描述

重新启动以确保万无一失,但仍然收到相同的“证书不是来自受信任的认证机构”错误。

我遗漏了哪些步骤?

certificate
  • 1 个回答
  • 46 Views
Martin Hope
a coder
Asked: 2016-07-22 06:29:45 +0800 CST

更换现有 RAID 1 + RAID 5 设置上的所有驱动器 - 一次全部更换还是一次更换一个?

  • 1

我正在考虑升级 PowerEdge R720 中的硬盘驱动器,需要一些指导。

当前配置:

OS: CentOS 6.5
Drives: 
2 x 300gb drives (RAID 1)
4 x 600gb drives (RAID 5)

我有 6 个新的 1.2TB SAS 驱动器需要更换。

  1. 我可以在过去 600GB 驱动器的位置添加 1.2TB 驱动器吗?

  2. 由于#1 需要一段时间,是否可以在保留 RAID 配置的同时一次交换所有驱动器?所有数据都已经备份到其他地方,只是想知道是否一次将它们全部换掉会杀死现有的 RAID 配置,或者是否保存在 Perc H710 卡上。

hard-drive raid hardware-raid
  • 1 个回答
  • 1111 Views
Martin Hope
a coder
Asked: 2016-07-21 05:09:51 +0800 CST

pvs 未显示正确的可用空间

  • 5

最近在具有以下驱动器的 PowerEdge R320 上安装了 RHEL7:

2 x 300GB sas 15k
2 x 1TB sas 7.2k

在安装过程中设置 LVM 时,我特意留下了数百 GB 的空闲空间,以防以后需要扩展。

我现在看到我需要扩展安装期间创建的卷之一。

问题是 pvs 只显示我创建的内容,并没有显示任何可用的可用空间。

[user@box ~] pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               rhel_os
  PV Size               165.79 GiB / not usable 0   
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              42443
  Free PE               0
  Allocated PE          42443
  PV UUID               sDdEfu-qagM-qq35-OGfF-HpPw-Bizd-LcXazt

  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               rhel_data
  PV Size               139.71 GiB / not usable 4.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              35766
  Free PE               1
  Allocated PE          35765
  PV UUID               Jgjcad-idBE-wxXc-tGGf-SY8m-qb8T-nBi9ar

parted显示可用空间:

[user@box ~]# parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free                                                       
Model: DELL PERC H710 (scsi)
Disk /dev/sda: 299GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
        18.4kB  1049kB  1030kB           Free Space
 1      1049kB  301MB   300MB   primary  xfs          boot
 2      301MB   178GB   178GB   primary               lvm
        178GB   299GB   121GB            Free Space

和 /dev/sdb:

[user@box ~]# parted /dev/sdb
(parted) print free
Model: DELL PERC H710 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
        32.3kB  1049kB  1016kB           Free Space
 1      1049kB  150GB   150GB   primary               lvm
        150GB   1000GB  850GB            Free Space

1) 我需要做什么才能使用免费的 850GB?

2) 将来,我如何将所有可用空间放入物理卷中(从而更容易与 LVM 一起使用)?

redhat lvm rhel7 parted
  • 2 个回答
  • 13013 Views
Martin Hope
a coder
Asked: 2016-03-02 09:49:17 +0800 CST

EL6的三个实例,两个显示openssl的更新,第三个没有

  • 0

在修复DROWN时,我需要更新几个 EL6 服务器上的 openssl 包。SSLv2 很久以前就关闭了,但需要更新这些二进制文件。

我发现 yum update 在两台机器上显示了更新的 openssl 二进制文件,但不是第三台。所有三台机器上的存储库都是相同的。

yum 是否有理由对一个盒子而不是另一个盒子提供更新(再次假设两台机器的 repo 配置相同)?

centos6
  • 1 个回答
  • 52 Views
Martin Hope
a coder
Asked: 2016-02-29 05:23:56 +0800 CST

允许 httpd 在 /usr/bin/ 中运行 bash 脚本

  • 2

将系统从 CentOS6 迁移到 RHEL7,SELinux 运行 Enforced。php脚本调用以在/usr/bin/processdata.sh幕后生成一些数据。这在旧系统上运行良好,但在execSELinux 设置为启用时 php 调用阻塞。

这是 sh 权限

-rwxrwx--x. root root unconfined_u:object_r:bin_t:s0   /usr/bin/process_data.sh

在调用 php 页面的同时会看到此审计错误:

ausearch -l -i | grep httpd

type=SYSCALL msg=audit(02/27/2016 14:07:52.662:23480) : arch=x86_64 syscall=socket success=no exit=-97(Address family not supported by protocol) a0=inet6 a1=SOCK_DGRAM a2= ip a3=0x672e76656473626e items=0 ppid=15686 pid=3852 auid=unset uid=apache gid=apache euid=apache suid=apache fsuid=apache egid=apache sgid=apache fsgid=apache tty=(none) ses=unset comm= httpd exe=/usr/sbin/httpd subj=system_u:system_r:httpd_t:s0 key=(null) type=AVC msg=audit(02/27/2016 14:07:52.662:23480) : avc: denied { module_request }对于 pid=3852 comm=httpd kmod="net-pf-10" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system

这是我当前的 httpd 布尔值:

httpd_can_network_relay        (off  ,  off)  Allow httpd to can network relay
httpd_can_connect_mythtv       (off  ,  off)  Allow httpd to can connect mythtv
httpd_can_network_connect_db   (off  ,  off)  Allow httpd to can network connect db
httpd_use_gpg                  (off  ,  off)  Allow httpd to use gpg
httpd_dbus_sssd                (off  ,  off)  Allow httpd to dbus sssd
httpd_enable_cgi               (on   ,   on)  Allow httpd to enable cgi
httpd_verify_dns               (off  ,  off)  Allow httpd to verify dns
httpd_dontaudit_search_dirs    (off  ,  off)  Allow httpd to dontaudit search dirs
httpd_anon_write               (off  ,  off)  Allow httpd to anon write
httpd_use_cifs                 (off  ,  off)  Allow httpd to use cifs
httpd_enable_homedirs          (off  ,  off)  Allow httpd to enable homedirs
httpd_unified                  (off  ,  off)  Allow httpd to unified
httpd_mod_auth_pam             (off  ,  off)  Allow httpd to mod auth pam
httpd_run_stickshift           (off  ,  off)  Allow httpd to run stickshift
httpd_use_fusefs               (off  ,  off)  Allow httpd to use fusefs
httpd_can_connect_ldap         (off  ,  off)  Allow httpd to can connect ldap
httpd_can_network_connect      (on   ,   on)  Allow httpd to can network connect
httpd_mod_auth_ntlm_winbind    (off  ,  off)  Allow httpd to mod auth ntlm winbind
httpd_tty_comm                 (off  ,  off)  Allow httpd to tty comm
httpd_sys_script_anon_write    (off  ,  off)  Allow httpd to sys script anon write
httpd_graceful_shutdown        (on   ,   on)  Allow httpd to graceful shutdown
httpd_can_connect_ftp          (off  ,  off)  Allow httpd to can connect ftp
httpd_run_ipa                  (off  ,  off)  Allow httpd to run ipa
httpd_read_user_content        (off  ,  off)  Allow httpd to read user content
httpd_use_nfs                  (off  ,  off)  Allow httpd to use nfs
httpd_can_connect_zabbix       (off  ,  off)  Allow httpd to can connect zabbix
httpd_tmp_exec                 (off  ,  off)  Allow httpd to tmp exec
httpd_run_preupgrade           (off  ,  off)  Allow httpd to run preupgrade
httpd_manage_ipa               (off  ,  off)  Allow httpd to manage ipa
httpd_can_sendmail             (on   ,   on)  Allow httpd to can sendmail
httpd_builtin_scripting        (on   ,   on)  Allow httpd to builtin scripting
httpd_dbus_avahi               (off  ,  off)  Allow httpd to dbus avahi
httpd_can_check_spam           (off  ,  off)  Allow httpd to can check spam
httpd_can_network_memcache     (off  ,  off)  Allow httpd to can network memcache
httpd_can_network_connect_cobbler (off  ,  off)  Allow httpd to can network connect cobbler
httpd_use_sasl                 (off  ,  off)  Allow httpd to use sasl
httpd_serve_cobbler_files      (off  ,  off)  Allow httpd to serve cobbler files
httpd_execmem                  (off  ,  off)  Allow httpd to execmem
httpd_ssi_exec                 (off  ,  off)  Allow httpd to ssi exec
httpd_use_openstack            (off  ,  off)  Allow httpd to use openstack
httpd_enable_ftp_server        (off  ,  off)  Allow httpd to enable ftp server
httpd_setrlimit                (off  ,  off)  Allow httpd to setrlimit

我的 selinux 配置中有什么我没有看到的东西吗?

permissions
  • 2 个回答
  • 5214 Views
Martin Hope
a coder
Asked: 2016-02-03 12:08:53 +0800 CST

引导加载程序密码 - 在 /etc/grub.d/01_users 中找到的现有内容

  • 1

我需要设置引导加载程序密码,并且担心更改现有配置(每个警告可能使系统无法启动)。

RH 文档说要添加以下几行:

cat <<EOF
set superusers="john"
password john johnspassword
EOF

当前/etc/grub.d/01_users文件的顶部已经有这个:

#!/bin/sh -e
cat << EOF
if [ -f \${prefix}/user.cfg ]; then
  source \${prefix}/user.cfg
  if [ -n "\${GRUB2_PASSWORD}" ]; then
    set superusers="root"
    export superusers
    password_pbkdf2 root \${GRUB2_PASSWORD}
  fi
fi
EOF

我应该在现有 EOF 下方附加第一部分,完全替换现有内容,还是其他?

password
  • 1 个回答
  • 2544 Views
Martin Hope
a coder
Asked: 2015-12-22 11:19:21 +0800 CST

在 EL7 中设置引导加载程序密码

  • 2

使用本指南,我正在尝试将引导加载程序密码添加到 CentOS7 安装中。

出现提示时,输入选择的密码并将返回的密码哈希插入到 /etc/grub.d 下的相应 grub2 配置文件中,紧跟在超级用户帐户之后。(使用 grub2-mkpasswd-pbkdf2 的输出作为密码哈希值):

我已经创建了“superusers-accountpassword-hash” grub2-mkpasswd-pbkdf2,但没有看到在哪里添加这一行:

password_pbkdf2 superusers-accountpassword-hash

/etc/grub.d/ 中唯一的文件是二进制文件。该指南说不要使用 /etc/grub.cfg 因为它被覆盖grub2-mkconfig -o /boot/grub2/grub.cfg

password_pbkdf2指令去哪儿了?

centos7
  • 1 个回答
  • 393 Views
Martin Hope
a coder
Asked: 2015-12-19 13:06:35 +0800 CST

从 Apache 2.2 迁移到 2.4,忽略 ssl.conf

  • 2

我正在使用 Apache 2.4 推出 EL7 的测试安装。我将现有的复制/etc/httpd/conf.d/ssl.conf到新系统,设置 selinux,验证所有证书路径都是 kosher 并systemctl httpd start启动服务。Apache 运行无错误。

问题是我的 ssl.conf 文件被忽略了。我正在使用默认的 Apache 页面

我尝试移动/etc/httpd/conf.d/ssl.conf到/etc/httpd/conf.modules.d/(首先删除现有的 00-ssl.conf 文件),结果相同。

我在哪里弄错了?

编辑 1 错误日志显示:

AH01630: client denied by server configuration: /www/virtualhosts/example.com

我的 ssl 配置有这个:

DocumentRoot /www/virtualhosts/example.com

和

ll /www/virtualhosts/example.com
total 4
-rw-r--r--. 1 apache apache 21 Dec 18 14:32 index.php

index.php 包括:

<p>Hello World

我不知所措。

apache-2.4
  • 1 个回答
  • 820 Views
Martin Hope
a coder
Asked: 2015-12-19 11:48:27 +0800 CST

ValueError:类型 http_sys_content_t 无效,必须是文件或设备类型

  • 3

我需要在非默认 httpd 目录上设置 selinux 权限:/www/virtualhosts/site01等。

所以我发出:

[mybox]# semanage fcontext -a -t http_sys_content_t "/www(/.*)?"

并得到:

ValueError: Type http_sys_content_t is invalid, must be a file or device type

配置 selinux 以使用我的非默认 httpd 目录需要发生什么?

httpd
  • 1 个回答
  • 10338 Views
Martin Hope
a coder
Asked: 2015-12-09 09:48:30 +0800 CST

无法在 RHEL7 上安装 freetds

  • 0

我正在尝试在 RHEL7 中设置 php-mssql。 freetds在默认的 RHEL 存储库中不可用,所以我启用epel如下:

rpm -Uvh http://mirror.oss.ou.edu/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
yum install freetds

这产生:

Error: Package: freetds-0.91-2.el6.x86_64 (epel)
           Requires: libgnutls.so.26()(64bit)
Error: Package: freetds-0.91-2.el6.x86_64 (epel)
           Requires: libgnutls.so.26(GNUTLS_1_4)(64bit)

RHELgnutls-3.3.8-12.el7_1.1.x86_64默认安装。

有没有办法穿过树林?

centos7
  • 2 个回答
  • 8264 Views
Martin Hope
a coder
Asked: 2015-08-19 08:23:04 +0800 CST

通过 SSH 连接到 racadm,控制台为空白且无响应

  • 1

我在运行 CentOS 的 PowerEdge 服务器上安装了 DRAC5。我能够通过 SSH 连接到 DRAC 并发出 racadm 命令。

当我发出

connect com2

我短暂地看到一个提示:

在此处输入图像描述

一秒钟后,屏幕变为空白,我的退出键序列不起作用(其他任何事情都没有 - 屏幕对所有键都没有响应)。

在此处输入图像描述

关闭终端并重新登录 racadm 进行第二次尝试后connect com2,它显示:

connect: com2 port is currently in use

重置 racadm 后,我可以再次尝试连接 com2,但得到的结果与上述相同(空白/无响应屏幕)。

这是我的配置:

# racadm getconfig -g cfgSerial
cfgSerialBaudRate=57600
cfgSerialConsoleEnable=1
cfgSerialConsoleQuitKey=^q
cfgSerialConsoleIdleTimeout=300
cfgSerialConsoleNoAuth=0
cfgSerialConsoleCommand=
cfgSerialHistorySize=8192
cfgSerialCom2RedirEnable=1
cfgSerialTelnetEnable=0
cfgSerialSshEnable=1

我希望能够查看控制台以在加密系统上远程输入密码。

linux
  • 1 个回答
  • 1656 Views
Martin Hope
a coder
Asked: 2015-07-08 13:42:19 +0800 CST

提交有效主机名时,OpenManage 返回“主机名/IP 地址为空白”

  • 1

刚刚在 CentOS 6.5 系统上安装了 OpenManage 8。我访问登录页面https://1.2.3.4/1311并且加载没有问题。

我输入系统主机名 (my.domain.tld)、用户名和密码,然后单击提交。OpenManage 返回

Login failed.  
Hostname / IP address is Blank. 
Please enter a valid Hostname/IP address.

我尝试使用系统的 IP 地址,并验证我输入了有效的用户名和密码。

巧合的是,我可以单击管理 Web 服务器,并且能够使用相同的凭据登录(我没有被要求在该登录页面上输入主机名)。

当我在登录表单上绝对提交有效的主机名时,为什么 OpenManage 会抱怨缺少主机名?我已经重新启动了openmanage,并尝试重新启动服务器。同样的问题发生在多个浏览器和客户端(主机名空白)。

编辑:我刚刚删除/安装了 yum srvadmin-all,仍然遇到同样的问题。

centos
  • 1 个回答
  • 450 Views
Martin Hope
a coder
Asked: 2015-03-03 13:47:00 +0800 CST

Mime 类型接收为“text/html”,服务器配置为“text/javascript”发送

  • 3

firefox 和 chrome 都显示来自我的服务器的 javascript 文件作为 MIME 类型的 text/html 提供。javascript 文件具有 .js 扩展名。

首先,安装并激活 mime_module:

apachectl -M | grep mime
 mime_magic_module (shared)
 mime_module (shared)
Syntax OK

其次,我的 conf 文件中有这个:

AddType text/css .css
AddType text/javascript .js

我试着添加这个:

<Files "*.js">
    ForceType text/javascript
</Files>

并重新启动 apache,但 javascript 文件在 Chrome 和 Firefox 中仍显示为“text/html”。error.log 中没有显示任何内容,并且 access.log 没有返回任何有用的信息:

1.2.3.4 - - [03/Mar/2015:10:42:00 -0500] "GET /some/dir/js/app-min.js HTTP/1.1" 200 14642

这是其中一个 .js 文件的标头(如 Firefox 中所示)

Connection: close
Content-Type: text/html; charset=UTF-8
Server: Apache
Strict-Transport-Security: max-age=63072000; includeSubDomains
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: master-only
X-WebKit-CSP: default-src 'self'
X-XSS-Protection: 1; mode=block

该文件html在 Firefox 检查器中显示为类型。

这是我的笔记本电脑的 apache 实例提供的同一文件的标题:

Connection: Keep-Alive
Date: Tue, 03 Mar 2015 15:43:52 GMT
Keep-Alive: timeout=5, max=95
Server: Apache/2.4.7 (Ubuntu)

该文件js在 Firefox 检查器中显示为类型。请注意,Apache (2.4) 的本地实例没有响应Content-Type.

为什么主服务器无视 AddType?我已将此添加到 httpd.conf 和 ssl.conf(尽管我的站点强制为 443)。我已经重新启动了 apache(没有语法错误)。

centos
  • 2 个回答
  • 8775 Views
Martin Hope
a coder
Asked: 2015-02-18 11:12:10 +0800 CST

让 DEFLATE 在 Apache 2.2 上工作时遇到问题

  • 0

我发现我的服务器没有提供压缩页面。

使用这个答案,我在我的 httpd conf 文件中添加了以下内容:

# Declare a "gzip" filter, it should run after all internal filters like PHP or SSI
FilterDeclare  gzip CONTENT_SET

# "gzip" filter can change "Content-Length", can not be used with range requests
FilterProtocol gzip change=yes;byteranges=no

# Enable "gzip" filter if "Content-Type" contains "text/html", "text/css" etc.
FilterProvider gzip DEFLATE resp=Content-Type $text/html
FilterProvider gzip DEFLATE resp=Content-Type $text/css
FilterProvider gzip DEFLATE resp=Content-Type $text/javascript
FilterProvider gzip DEFLATE resp=Content-Type $application/javascript
FilterProvider gzip DEFLATE resp=Content-Type $application/x-javascript

# Add "gzip" filter to the chain of filters
FilterChain    gzip

接下来,我发出

apachectl configtest

这产生了这个错误:

无效的命令“FilterDeclare”,可能拼写错误或由未包含在服务器配置中的模块定义

这是来自的输出httpd -l

Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

我需要安装哪些模块才能使页面压缩正常工作?我正在运行 CentOS 6.6。

apache-2.2
  • 1 个回答
  • 1288 Views
Martin Hope
a coder
Asked: 2013-09-13 12:47:03 +0800 CST

带有 $servername 的 case 语句失败

  • 0

我正在一个独立系统上探索 puppet,并在复制 MySQL 的配置文件时遇到了困难。使用下面的清单,安装了 MySQL,但未复制 my.cnf 文件。

init.pp(主机名:dev_one.site.com)

class mysql {

  case $servername {
    "prod_one.site.com", "dev_one.site.com", "sandbox_one.site.com": {
      $conf_file    = 'my.cnf.one'
    }
    "prod_two.site.com", "dev_two.site.com", "sandbox_two.site.com": {
      $conf_file    = 'my.cnf.two'
    }
  }


  package { "mysql-server":
    ensure => present,
  }

  package { "mysql":
    ensure => present,
  }

  file { 'my.cnf':
    path    => '/etc/',
    ensure  => file,
    require => Package['mysql'],
    source  => "puppet:///modules/mysql/${conf_file}"
  }

  service { "mysqld":
    ensure => running,
    enable => true,
    require => Package["mysql-server"]
  }

}

结果如下:

[root@dev_one manifests]# puppet apply --verbose ./init.pp 
Info: Applying configuration version '1379018555'
Notice: /Stage[main]/Mysql/Package[mysql-server]/ensure: created
Notice: /Stage[main]/Mysql/Service[mysqld]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Mysql/Service[mysqld]: Unscheduling refresh on Service[mysqld]
Notice: Finished catalog run in 14.34 seconds

[root@dev_one manifests]# ll /etc/my*
total 0

没有错误,但 my.cnf 没有被复制。我究竟做错了什么?

mysql
  • 1 个回答
  • 124 Views
Martin Hope
a coder
Asked: 2013-09-13 07:41:13 +0800 CST

Puppet 通知:current_value 不存在,应该存在

  • 1

我正在尝试通过 puppet (v 3.2.4) 添加用户,并在 --noop 上收到此通知:

注意:/Stage[main]/Usergroup/Group[user_one]/ensure: current_value 不存在,应该存在(noop)

这是我的清单:

# usersgroups
class usergroup {

  group { "user_one":
      ensure => present,
      gid => 500,
  }
  group { "dev_website_1":
      ensure => present,
      gid => 501,
  }
  group { "dev_website_2":
      ensure => present,
      gid => 502,
  }

  user { "user_one":
      ensure => present,
      uid => 500,
      gid => 500,
      groups => ["dev_website_1", "dev_website_2"]
  }

}
include usergroup

我应该用“current_value => present”替换“ensure => present”吗

puppet
  • 1 个回答
  • 2498 Views
Martin Hope
a coder
Asked: 2013-09-05 08:09:57 +0800 CST

无效的包提供程序'pear'

  • 0

我正在创建一个清单以在 CentOS 6 机器上安装 LAMP。除了安装一些梨模块外,一切正常。发行时puppet /etc/puppet/modules/webserver/manifests/init.pp,我得到以下信息:

/etc/puppet/modules/webserver/manifests/init.pp:111 处的包提供程序“pear”无效

以下是清单的相关部分,包括底部的包含顺序:

class php {

  package {'php':
    ensure => present,  
    before => File['/etc/php.ini'],
  }

  file {'/etc/php.ini':
    ensure => file,
  }

  $packagelist = [
    "php-cli",
    "php-common",
    "php-devel",
    "php-gd",
    "php-ldap",
    "php-mbstring",
    "php-mssql",
    "php-mysql",
    "php-pear",
    "php-pecl-ssh2",
    "php-xml"
  ]

  package { $packagelist:
    ensure => installed,
    require => Package['php'],
    notify => Service['httpd'],
  }

class pear {
  package {
     "pear":
        ensure => installed,
        provider => 'pear';
     "pecl/zip":
        ensure => installed,
        provider => 'pear';
  }
}

include php
include pear

我可以注释掉include pear底部的那一行,其余的安装都没有问题。 rpm -qa | grep php-pear显示包 php-pear 已成功安装。pear在提示符处发出返回预期的 pear 帮助菜单。

如果我返回 init.pp 文件,取消注释include pear并重新运行puppet /etc/puppet/modules/webserver/manifests/init.pp,则会出现相同的错误。

是什么赋予了?

php
  • 1 个回答
  • 561 Views
Martin Hope
a coder
Asked: 2013-08-30 14:15:57 +0800 CST

清单文件未应用

  • 0

我在虚拟主机上安装了 puppet 以进行试驾。我正在使用 epel 的当前版本 2.6.18。为简单起见,此测试安装将使服务器和客户端在同一系统上运行。

安装 puppet 后,我​​跑去puppet master --mkusers启动服务器。都好。

--configtest 显示我的模块目录是默认/etc/puppet/modules文件夹。

我创建了文件夹结构 /etc/puppet/modules/ntp/manifests/,然后创建了一个 ntp.pp 文件,如下所示:

class ntp {
  package {'ntp':
    ensure => present
  }
  service {'ntp':
    ensure => running,
  }
}
include ntp

发出puppet --parseonly /etc/puppet/modules/ntp/manifests/ntp.pp干净的回报。没有错误。

接下来,我发出

puppet agent --test --server=`hostname

然后回来

info: Caching catalog for localhost.localdomain
info: Applying configuration version '1256130640'
notice: Finished catalog run in 1.23 seconds

我已通过检查确认尚未安装 ntprpm -qa ntp

发出puppet --configprint all确认上述模块路径。

我究竟做错了什么?

puppet
  • 1 个回答
  • 2032 Views
Martin Hope
a coder
Asked: 2012-10-10 07:52:54 +0800 CST

不正确的 MIME 类型 - 拉扯我的头发

  • 2

我遇到 Apache 错误标记 text/html 的 CSS 文件的问题。文件类型在浏览器中不匹配,被忽略导致显示失败。

我在 RHEL 5 服务器上使用 Apache 2.2.3。

我尝试将其添加到httpd.conf并重新加载配置service httpd reload:

AddType text/css .css

浏览器看到的没有变化。我的 css 文件仍在显示text/html(即使当我使用 php curl 来探测 mime 类型时。这没有区别,服务器正在发送text/html文件)

然后,我注释掉了 中的以下几行httpd.conf,以确保魔术不会发生一些古怪的事情:

LoadModule mime_magic_module modules/mod_mime_magic.so

<IfModule mod_mime_magic.c>
  MIMEMagicFile /usr/share/magic.mime
  MIMEMagicFile conf/magic
</IfModule>

一旦这些被搁置,我保存并重新加载配置。没变。.css 文件仍然以text/html.

虚拟主机标准配置:

<VirtualHost 1.2.3.4:80>
    ServerName my.site.com
    ServerAdmin [email protected]
    DocumentRoot /var/www/mysite/
    # Log info redacted #
</VirtualHost>

虚拟主机 SSL 配置:

<VirtualHost 1.2.3.4:443>

        ServerName my.site.com
        ServerAdmin [email protected]
        DocumentRoot /var/www/mysite/

        # Log info redacted #
        # SSL Certificate config redacted #

        <Files ~ "\.(cgi|shtml|phtml|php3?)$">
            SSLOptions +StdEnvVars
        </Files>

        SetEnvIf User-Agent ".*MSIE.*" \
                 nokeepalive ssl-unclean-shutdown \
                 downgrade-1.0 force-response-1.0

        CustomLog logs/ssl_request_log \
                  "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

这是我从 shell 得到的:

[boxor]# file --mime install.css
install.css: text/x-c; charset=us-ascii

这是我从 php 得到的:

$file = 'https://my.site.com/traq/install/install.css';
echo mime_content_type($file);

$file = $_SERVER['DOCUMENT_ROOT] . '/traq/install/install.css';
echo mime_content_type($file);

回报:

text/html; charset=UTF-8

text/plain

这三点都错了。

这是我的 apache 访问日志中的一行(添加了 Content-type):

1.2.3.4 - - [10/Oct/2012:08:32:38 -0400] "GET /traq/install//install.css HTTP/1.1" 200 2600 "http://my.site.com/traq/install/" "text/html" "Mozilla/5.0 blahblah Firefox/15.0.1"

同一页面中包含的不存在的 css 文件也作为“text/html”返回:

1.2.3.4 - - [10/Oct/2012:09:11:11 -0400] "GET /traq/install/idontexist.css HTTP/1.1" 200 2600 "http://my.site.com/traq/install/" "text/html" "Mozilla/5.0 blahblah Firefox/15.0.1"

所以...我在这里忽略了什么?

apache-2.2
  • 1 个回答
  • 4368 Views
Martin Hope
a coder
Asked: 2012-10-10 05:32:20 +0800 CST

xdg-mime 返回“xprop:无法打开显示‘’”

  • 0

我正在尝试追踪以 text/html 而不是 text/css 形式返回的特定 CSS 文件的问题。

file -mime install.css 返回一些不太有用的信息:

install.css: text/x-c; charset=us-ascii

所以我被鼓励改用 xdg-mime:

[box]# xdg-mime query filetype install.css
xprop:  unable to open display ''
usage:  xprop [-options ...] [[format [dformat]] atom] ...

我错过了什么?

linux
  • 1 个回答
  • 2264 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