Apache httpd在root用户上运行良好。当我使用oracle用户运行apache时,它无法运行,并给出以下错误:
$ id
uid=600000014(oracle) gid=63855(oinstall)
oracle@myhost:...ache/2.4.43/https-api11/bin$ ls -ltr apachectl
-rwxr-xr-x 1 oracle oinstall 3509 Nov 10 05:09 apachectl
./apachectl -k start
(13)Permission denied: AH00072: make_sock: could not bind to address 10.23.52.219:443
no listening sockets available, shutting down
AH00015: Unable to open logs
$ telnet 10.23.52.219 443
Trying 10.23.52.219...
telnet: Unable to connect to remote host: Connection refused
oracle@myhost:...ache/2.4.43/https-vwsapi11/bin$ nslookup 10.23.52.219
216.51.23.10.in-addr.arpa name = myhost.myshop.com.
oracle@myhost:...ache/2.4.43/https-api11/bin$ telnet myhost.myshop.com 443
Trying 10.23.52.219...
telnet: Unable to connect to remote host: Connection refused下面是httpd.conf中的一些条目
Listen 8080
User oracle
Group oinstall
ServerAdmin weblogic@myshop.com
ServerName myhost.myshop.com
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf最后在extra/httpd-ssl.com中
SSLSessionCache "shmcb:/u/home/apache/2.4.43/https-api11/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
<VirtualHost myhost.myshop.com:443>
DocumentRoot "/u/home/apache/2.4.43/https-api11/htdocs"
ServerName myhost.myshop.com
SSLEngine on
<Directory "/u/home/apache/2.4.43/https-api11/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
CustomLog "/u/home/apache/2.4.43/https-api11/logs/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
ProxyPass /manager/ http://myhost.myshop.com:8443/manager/
ProxyPassReverse /manager/ http://myhost.myshop.com:8443/manager/
ProxyPass /api/ http://myhost.myshop.com:8443/api/ timeout=600
ProxyPassReverse /api/ http://myhost.myshop.com:8443/api/ timeout=600
SetEnv nokeepalive ssl-unclean-shutdown
</VirtualHost>如果上面的信息不够,我会分享整个配置。
请建议我如何让apache httpd与oracle用户一起运行,该用户是用于复制(安装)它的用户。
发布于 2021-04-03 06:15:40
Apache首先需要以根用户身份运行,以便将自身绑定到端口80和443 (或任何端口<= 1024)。
User oracle
Group oinstall在apache启动并需要派生子进程来处理请求(这些进程将作为oracle:oinstall运行)之后,它可以正常工作。
Listen 8080意味着apache正在监听端口8080,而不是端口80或443,如果apache不是以根用户身份运行,它就会工作。
您还在运行mod_ssl,它应该包括
Listen 443默认情况下,除非您或其他人已经更改了配置,因此您需要将此值更改为其他值(>1024),这是我在上面写的原因。
(13)Permission denied: AH00072: make_sock: could not bind to address 10.23.52.219:443
no listening sockets available, shutting down表示虚拟主机正在尝试将自己绑定到端口443上,该端口无法工作,因为apache不是以根用户身份运行。
我想你应该使用一个官方的包来安装apache,让它以root用户的身份运行,并按照你发布的方式进行配置,这样处理请求的子进程就可以按照你喜欢的方式运行(本地用户更好)。
https://stackoverflow.com/questions/66374610
复制相似问题