尝试将我的子域重定向到端口 80 以外的其他端口。请求通过端口 80 接收,我尝试将请求定向到端口 10001,因为那里有一个运行 McMyAdmin Panel 的 Mono 服务器,每次都告诉每个人端口有点烦人,所以我试图让它更方便一些,但目前我的设置显示此消息:
#################### Minecraft Panel Port Redirect Project VHost ####################
<VirtualHost *:80>
ServerName panel.koangaming.com
ServerAlias *.panel.koangaming.com
ProxyPass / http://localhost:10001/
ProxyPassReverse / http://localhost:10001/
ProxyPassReverseCookieDomain localhost panel.koangaming.com
ProxyPreserveHost On
ErrorLog "/var/log/koanhosting.in-error_log"
CustomLog "/var/log/koanhosting.in-access_log" common
</VirtualHost>
加载时当前错误:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.2.15 (CentOS) Server at panel.koangaming.com Port 80
[Thu Feb 20 19:25:57 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 19:25:57 2014] [notice] Digest: done
[Thu Feb 20 19:25:57 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
[Thu Feb 20 19:26:29 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 20 19:26:30 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Feb 20 19:26:30 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 20 19:26:30 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 19:26:30 2014] [notice] Digest: done
[Thu Feb 20 19:26:30 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
*** glibc detected *** /usr/sbin/httpd: free(): invalid pointer: 0x00007f1f9f5ced70 ***
*** glibc detected *** /usr/sbin/httpd: free(): invalid pointer: 0x00007f1f9f5ced70 ***
[Thu Feb 20 19:26:45 2014] [warn] child process 30673 still did not exit, sending a SIGTERM
[Thu Feb 20 19:26:45 2014] [warn] child process 30674 still did not exit, sending a SIGTERM
[Thu Feb 20 19:26:47 2014] [warn] child process 30673 still did not exit, sending a SIGTERM
[Thu Feb 20 19:26:47 2014] [warn] child process 30674 still did not exit, sending a SIGTERM
[Thu Feb 20 19:26:49 2014] [warn] child process 30673 still did not exit, sending a SIGTERM
[Thu Feb 20 19:26:49 2014] [warn] child process 30674 still did not exit, sending a SIGTERM
[Thu Feb 20 19:26:51 2014] [error] child process 30673 still did not exit, sending a SIGKILL
[Thu Feb 20 19:26:51 2014] [error] child process 30674 still did not exit, sending a SIGKILL
[Thu Feb 20 19:26:52 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Feb 20 19:26:52 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 20 19:26:52 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 19:26:52 2014] [notice] Digest: done
[Thu Feb 20 19:26:52 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
sendmail: fatal: chdir /var/spool/postfix: Permission denied
sendmail: fatal: chdir /var/spool/postfix: Permission denied
[Thu Feb 20 20:03:47 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 20 20:03:47 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Feb 20 20:03:47 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 20 20:03:48 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 20:03:48 2014] [notice] Digest: done
[Thu Feb 20 20:03:48 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
[Thu Feb 20 20:06:22 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 20 20:06:22 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Feb 20 20:06:22 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 20 20:06:22 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 20:06:22 2014] [notice] Digest: done
[Thu Feb 20 20:06:22 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
[Thu Feb 20 20:06:29 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 20 20:06:29 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Feb 20 20:06:29 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 20 19:26:52 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 19:26:52 2014] [notice] Digest: done
[Thu Feb 20 19:26:52 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
sendmail: fatal: chdir /var/spool/postfix: Permission denied
sendmail: fatal: chdir /var/spool/postfix: Permission denied
[Thu Feb 20 20:03:47 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 20 20:03:47 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Feb 20 20:03:47 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 20 20:03:48 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 20:03:48 2014] [notice] Digest: done
[Thu Feb 20 20:03:48 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
[Thu Feb 20 20:06:22 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 20 20:06:22 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Feb 20 20:06:22 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 20 20:06:22 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 20:06:22 2014] [notice] Digest: done
[Thu Feb 20 20:06:22 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
[Thu Feb 20 20:06:29 2014] [notice] caught SIGTERM, shutting down
[Thu Feb 20 20:06:29 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Thu Feb 20 20:06:29 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 20 20:06:29 2014] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 20 20:06:29 2014] [notice] Digest: done
[Thu Feb 20 20:06:29 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.25 configured -- resuming normal operations
Program mode requires special privileges, e.g., root or TrustedUser.
Program mode requires special privileges, e.g., root or TrustedUser.
Program mode requires special privileges, e.g., root or TrustedUser.
Program mode requires special privileges, e.g., root or TrustedUser.
这些是来自“error_log”文件的日志,我无法确定它们是否与错误相关。也许有人更了解这些含义,可以解释一下。
答案1
尝试使用netcat
(nc
)或简单的telnet
客户端来验证该端口的 TCP 连接(从机器本身):
netcat localhost 10001
现在,您可以向它发出请求并查看您的应用程序正在发送的内容(此测试GET
方法):
GET / HTTP/1.1
Host: localhost
按enter
两次,你应该会收到来自监听应用程序的一些类似这样的回复:
HTTP/1.1 200 OK
Date: Thu, 20 Feb 2014 22:00:47 GMT
Server: Apache/2.2.22 (Fedora)
Last-Modified: Tue, 15 Jun 2010 10:41:21 GMT
...
...
如果netcat
立即退出或者没有响应,那么监听应用程序似乎没有正常工作。
答案2
您应该查看 selinux。在这种情况下,您必须设置httpd_can_network_connect
sebool 变量以允许 Apache 代理连接到(内部)网络。
setsebool -P httpd_can_network_connect 1
也可以看看: https://serverfault.com/a/911819/188737 https://unix.stackexchange.com/a/8856