我正在尝试解决我的 HTTPD 被拒绝访问绑定自定义端口的问题,我认为这与 SELinux 有关。在进行一些谷歌搜索时,我遇到了一些帖子,其中用户输入semanage
后跟标志和命令来查看某些数据。在关注这些帖子时,我也输入了semanage
,但它不在我的系统上。
结果yum list *semanage*
:
Installed Packages
libsemanage.x86_64 | 2.0.43-4.el6 | @anaconda-CentOS-201106060106.x86_64/6.0
Available Packages
libsemanage-devel.x86_64 | 2.0.43-4.el6 | base
libsemanage-python.x86_64 | 2.0.43-4.el6 | base
libsemanage-static.x86_64 | 2.0.43-4.el6 | base
Run Code Online (Sandbox Code Playgroud)
二进制文件是否在这些其他软件包之一中可用?
是否可以在更新时为 YUM 指定一个镜像?我注意到在我的 CentOS 6.2 服务器上,YUM 需要一分钟才能响应给定的命令。我做了一些谷歌搜索,发现 YUM 从 timedhosts.txt 文件中读取,所以我查看了内容,它非常讨厌。有 49 行,其中 32 行的值为 99999999999,我认为这是超时。
我必须有一种方法来指定一个我知道会闪电般快速的镜子(来自 SoCal 我想使用http://mirrors.usc.edu/。
令人惊讶的是,找不到任何关于如何通过semanage port
. 这是我尝试过的排列列表:
semanage port -d -t http_port_t -p tcp 0-60000
semanage port -d -t http_port_t -p tcp [1-60000]
semanage port -d -t http_port_t -p tcp 1,60000
semanage port -d -t http_port_t -p tcp 1-60000
semanage port -d -t http_port_t -p tcp 1 60000
semanage port -d -t http_port_t -p tcp 1,60000
semanage port -d -t http_port_t -p tcp <60000
semanage port -d -t http_port_t -p tcp '1-60000'
semanage port -d -t http_port_t -p tcp '1,60000'
semanage port …
Run Code Online (Sandbox Code Playgroud) 我为 postfix 虚拟邮箱创建了一个虚拟邮件用户,gid/uid 为 5555,但现在我创建的每个新用户都从 > 5555 开始,是否可以重置自动编号,以便普通用户回到 100 岁以下?我知道这看起来很迂腐,但我是强迫症,并且 5555 应该表示“特殊”用户,就像 65534 对匿名 NFS 用户所做的那样。
- 更新 -
确认 ssgelm 的解决方案有效。我更改/etc/login.defs
并将 UID_MAX 和 GID_MAX 设置为 5000,所有新用户现在都在低 500(预期行为)中获得 uids/gids。
在CentOS 6.5上运行 nginx 1.0.15。我有三台上游服务器并且一切正常,但是当我模拟中断并关闭其中一台上游服务器时,我注意到响应时间有相当大的延迟(额外的 5-7 秒)。当我将宕机的服务器重新联机时,延迟就消失了。另外,我注意到的另一个奇怪的事情是,如果我只是在模拟中断服务器上停止 httpd 服务,响应时间是正常的,只有在服务器完全关闭时才会出现延迟。
这是我的conf:
upstream prod_example_com {
server app-a-1:51000;
server app-a-2:51000;
server app-a-3:51000;
}
server {
# link: http://wiki.nginx.org/MailCoreModule#server_name
server_name example.com www.example.com *.example.com;
#-----
# Upstream logic
#-----
set $upstream_type prod_example_com;
#-----
include include.d/common.conf;
# Configure logging
access_log /var/log/nginx/example/access/access.log access;
error_log /var/log/nginx/example/error.log error;
location / {
# link: http://wiki.nginx.org/HttpProxyModule#proxy_pass
proxy_pass http://$upstream_type$request_uri;
# link: http://wiki.nginx.org/HttpProxyModule#proxy_set_header
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
# link: http://wiki.nginx.org/HttpProxyModule#proxy_pass
proxy_pass …
Run Code Online (Sandbox Code Playgroud) 我正在编译 php 扩展(memcached 和 xdebug),当我运行 make install 时,它们会继续安装到 /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626 中。所以有几个问题:
no-debug-non-zts-20090626 甚至是什么意思,为什么它是默认值?
编辑 php.ini 文件并将 extension_dir 指令设置为上述目录是一种好习惯吗?或者我应该用 PREFIX=/usr/local/php/extensions 编译每个模块?因此,当我进行安装时,它们会被放入自定义扩展目录中,然后我可以将 extension=/usr/local/php/extensions/memcached.so 行添加到我的 .ini 文件中。
编译新模块时是否存在风险,它会进入与问题 #1 中的目录不同的目录?
我有一个在子网上运行的本地 NTP 服务器,以保持其他子网节点同步,而不需要每个节点都与上游服务器同步。但是,在check_ntp_time
为 Nagios实施插件时,我注意到一个令人沮丧的问题,即 nagios 不断报告本地节点与本地 ntp 服务器同步的严重错误。
这是本地 ntp 服务器上的 ntp 配置,注意上游服务器条目和限制条目,根据我的研究,这使节点成为本地节点可以与之同步的 ntp 服务器。
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod limited nomodify notrap nopeer noquery
restrict -6 default kod limited nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but …
Run Code Online (Sandbox Code Playgroud) 当 postfix 尝试连接到 opendkim 的 unix 套接字时,我收到了拒绝错误,实际错误:
Sep 24 15:41:43 service-a-4 postfix/cleanup[17414]: warning: connect to Milter service unix:var/run/opendkim/opendkim.sock: Permission denied
Run Code Online (Sandbox Code Playgroud)
根据postfix 文档,默认情况下 postfix 以“chroot 模式”运行,因此 postfix 被锁定到 /var/spool/postfix/,并且根据postfix 文档,如果在“chroot 模式”下运行,则所有 milter(套接字)引用是相对的(相对于 /var/spool/postfix)。
所以我的配置看起来像:
# /etc/opendkim.conf
Socket local:/var/spool/postfix/var/run/opendkim/opendkim.sock
# /etc/postfix/main.cf
smtpd_milters = unix:/var/run/opendkim/opendkim.sock
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试发送测试电子邮件时,出现权限被拒绝错误,因此我尝试了一些权限测试:
# Correctly lists the socket file
sudo su -s /bin/bash postfix -c "ls /var/spool/postfix/var/run/opendkim/opendkim.sock"
Run Code Online (Sandbox Code Playgroud)
但是当我尝试作为后缀连接时,没有任何反应:
# Does not work
sudo su -s /bin/bash postfix -c "nc -U -D /var/spool/postfix/var/run/opendkim/opendkim.sock"
# Does work (as …
Run Code Online (Sandbox Code Playgroud) 我有以下设置
2 x linode vps
1 x lab (physical) running 4 vps
Run Code Online (Sandbox Code Playgroud)
我的目标是让所有节点都像在同一个 LAN 上一样。这将允许我更改 IPTable 规则,只允许本地流量,而不是必须为每个需要访问目标节点上的端口的服务器添加一个新的 IPTable 条目。
我已经做了一些初步的研究和测试,但似乎无法找到我想要完成的最佳解决方案。在我开始配置实际的生产 VPS 之前,我一直在练习我的两个实验室 VPS,它们驻留在不同的子网上。
实验室机器有两个物理网卡;eth0 和 eth1。eth1 被设置为向 VPS 提供虚拟网卡的桥梁。
设置如下
service-a-1 (physical node):
eth0: 192.168.0.1
eth1: br0
br0: 192.168.0.2
service-a-2 (vps):
eth0: 192.168.0.3
eth0:0 10.0.0.1, 255.255.192.0
eth0:1 10.0.1.1, 255.255.192.0, gw 10.0.0.1
service-a-3 (vps):
eth0: 192.168.0.4
eth0:0 10.0.64.1, 255.255.192.0
eth0:1 10.0.65.1, 255.255.192.0, gw 10.0.64.1
Run Code Online (Sandbox Code Playgroud)
我使用192.168.0.x ip addies 连接到 VPS,但10.0.x ip addies 用于练习连接子网。我对上述设计的目标是通过网关 ips在service-a-2和service-a-3之间建立安全隧道;分别为10.0.0.1和 …
我正在尝试在 NFS4 服务器上设置 2 个不同的挂载点,但无法按预期工作。
/etc/exports (on server)
/mnt/raid/nas 10.1.0.0/18(rw,fsid=0,sync)
/mnt/raid/nas/file/perm 10.1.0.0/18(rw,sync,all_squash,no_subtree_check,anonuid=501,anongid=503)
/mnt/raid/nas/mail 10.1.0.0/18(rw,sync,all_squash,no_subtree_check,anonuid=5555,anongid=5555)
Run Code Online (Sandbox Code Playgroud)
有了上面的挂载点,理论上我应该能够单独挂载子目录,例如:
$ -> mount -v -t nfs4 nas.vpc1.j1n.us:/mnt/raid/nas/file/perm /mnt/nas/store/file/perm/
Run Code Online (Sandbox Code Playgroud)
但是我不断收到这些错误:... failed, reason given by server: No such file or directory
,但是如果我像这样安装:
$ -> mount -v -t nfs4 nas.vpc1.j1n.us:/ /mnt/nas/
Run Code Online (Sandbox Code Playgroud)
有用。但是在 NFS 服务器上的 /mnt/raid/nas 文件夹中还有其他目录我不想暴露给 NFS 客户端,所以这个选项真的没有帮助。
我该怎么做才能使用 NFS4,但要指定挂载点,这样我就不会在 /mnt/raid/nas 中共享所有内容?