服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器
我想用nginx代理tcpstream量到不同的后端,这取决于请求者的IP地址。 到目前为止,我在nginx.conf中有以下设置: stream { server { listen 1025; if ($remote_addr != 10.0.99.18) { proxy_pass mailcatcher_production:1025; } if ($remote_addr = 10.0.99.18) { proxy_pass mailcatcher_others:1025; } } } 但是在启动nginx时出现以下错误: [emerg] 1#1: "if" directive is not allowed here in /etc/nginx/nginx.conf:36 我认为这并不重要,但我在docker中运行nginx,并在启动时将nginx.conf复制到容器中。
我知道有很多很好的答案这样的问题在stackoverflow或serverfault,但我无法find我的问题的答案。 我有我的php-fpm 7.0进程的以下/status输出。 pool: www process manager: dynamic start time: 04/Jul/2017:15:09:20 +0200 start since: 609 accepted conn: 6113 listen queue: 0 max listen queue: 0 listen queue len: 0 idle processes: 89 active processes: 11 total processes: 100 max active processes: 27 max children reached: 0 slow requests: 0 正如你所看到的,我有很多闲置的进程正在等待某些事情要做。 闲置的stream程是好还是不好的做法? ; The number of […]
我想限制从指定的IP访问docker集装箱港口。 我用ipset设置iptables规则。 我公开了端口8888.来自端口8888的请求被转发到简单的泊坞窗networking服务器。 我用白名单IP地址定义ipset。 ipset create testfilter iphash ipset add testfilter 192.168.52.65 然后我创build了iptables规则。 带名称testfilter新链,带有端口8888 FORWARD规则应跳转到testfilter 。 来自testfilter链的第一个规则应该匹配来自白名单ipset的IP。 当IP与白名单不匹配时,来自testfilter链的第二条规则应该放弃通信。 iptables -N testfilter iptables -I FORWARD -p tcp –dport 8888 -j testfilter iptables -A testfilter -m set –match-set test_ips src -j RETURN iptables -A testfilter -j DROP 但是端口8888仍然可以从任何IP访问。 我也尝试使用INPUT规则而不是FORWARD规则,同时从规则中删除–dport参数,并把-m state –state NEW参数而不是那个。 任何想法如何解决?
我目前有一个串口的设备,启动时,这个串口绑定到ttyS1。 在设备上有一个进程(我几乎不能控制)来控制这个端口,所以你可以通过一个串行terminal来进行通信。 我希望能够通过设备上运行的软件与这个串口进行交互。 我现在使用的方法是在启动后立即劫持ttyS1,并在其中创build一个虚拟串口,然后我的软件就在另一端。 如果我这样做,那么串口不能再通过物理端口访问。 有没有办法做到这一点,而不会失去通过物理端口的访问? 我附上了一张照片来试图说明我的意思。
我有问题与Apacheconfiguration,通常是在几分钟内完成,但这让我感到困惑,为什么它不会工作。 我使用LetsEncrypt自签名证书进行testing,使用以下教程: https ://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in- Ubuntu的16-04 然后我创build了Apacheconfiguration(注意,添加“绕过字符代码) <“VirtualHost *:80 ServerName website.org ServerAlias www.website.org ServerAdmin [email protected] DocumentRoot /var/aegir/hostmaster-7.x-3.11/sites/website.org/ ErrorLog ${APACHE_LOG_DIR}/website.org_error.log CustomLog ${APACHE_LOG_DIR}/website.org_access.log combined <“/虚拟主机> <“VirtualHost *:443>” ServerAdmin [email protected] ServerName website.org DocumentRoot /var/aegir/hostmaster-7.x-3.11/sites/website.org/ ErrorLog ${APACHE_LOG_DIR}/website.org_error.log CustomLog ${APACHE_LOG_DIR}/website.org_access.log combined SSLEngine on SSLCertificateFile /etc/apache2/ssl/website.org.crt SSLCertificateKeyFile /etc/apache2/ssl/website.org.key <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-6]" \ […]
所以我有一个nginx安装程序作为我的域的反向代理,这是从我的angularjs 2应用程序的/ api开始的调用redirect到同一台机器上的一个春季启动应用程序 但是,当我尝试执行login调用/ myname /loginPOST,调用成功进入春季启动应用程序,然后successfulyl答复,但我的前端应用程序永远不会收到一个响应,因此我得到一个504网关超时。 什么可能导致这个问题呢? 我有以下configuration: user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type […]
我有12个Ubuntu服务器14.04节点的Hadoop集群。 我的问题是在一些包括namenode的服务器上,时间跳转到2036-02-07几分钟,然后变回,导致Hadoop datanode死亡。 我安装了ntp进行时间同步,但ntp的最小同步间隔为8秒,这对我来说仍然是一个问题,因为Hadoop心跳间隔为3秒。 请注意,所有服务器中的时区都是相同的。 我曾经在一个地方看过,当操作系统无法读取硬件时钟的时候会发生这种情况,我该如何检查它是否属实? 任何关于这个时间的原因有什么改变,我怎么能阻止呢? NTP运行为 ntpd -p /var/run/ntpd.pid -g -u 109:118 这是我的ntp.conf文件: # /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help driftfile /var/lib/ntp/ntp.drift statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable # Specify one or […]
在我们的Uni上,今天RADIUS服务器的服务器证书已经轮换了。 这迫使所有caching/固定此证书的客户端重新请求重新连接权限。 不过,我也注意到,我的Android手机没有任何改变,因为我固定在那里,新的证书仍然使用旧的根。 该设置使用PEAP与大学提供的非大学和非域join的计算机login。 现在我有三个(简单的)问题: Windows(10)是否支持WLAN的可信根证书? 我可以在哪里导入/查看这些证书? 我在哪里可以查看给定WLANconfiguration文件使用的当前权威指纹?
我的networking非常简单: [计算机A 172.18.1.12] -eth0 – [GW] -tun0 — tun0- [VPS] – eth1- [计算机B 172.18.1.12] [eth1] —- [WWW] [计算机* 172.18.1。++] 程序是openvpn安装在GW和VPS上,tun0和class A地址VPS 10.8.0.1 GW 10.8.0.2 我添加了针对VPS的eth1伪装,并且GW0转发的tun0被激活。 我只是想在特殊端口上的某些应用程序使用VPN,所以我添加了一个iptables的snat规则,但没有任何反应。 我只是想重新路由所有数据包端口14000从我的私人子网到互联网上的外部服务器端口14000通过VPN。 感谢帮助我,因为我卡住了:)
我有一个相当简单的问题。 有没有办法将OpenStack Keystoneconfiguration为OAuth2客户端。 所以用户可以通过OAuth授权服务器提供对OpenStack安装的访问权限? 如果没有实施。 你会build议使用什么技术? 我的OAuth实现在nodeJS上运行。 我想过实现访问同一用户数据库的LDAP服务器。 任何其他的想法?