我试图用apache 2.4.10 unix套接字,我不断收到错误No protocol handler was valid for the URL /foo.
我已经安装并启用了mod_proxy_uwscgi 。
我的虚拟主机看起来像这样:
<VirtualHost *:80> ServerAdmin [email protected] ServerName foo.example.com <Location /> ProxyPass unix:/path/to/socket.sock|uwscgi:// </Location> </VirtualHost>
apachectl -M输出
Loaded Modules: core_module (static) so_module (static) watchdog_module (static) http_module (static) log_config_module (static) logio_module (static) version_module (static) unixd_module (static) access_compat_module (shared) alias_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) filter_module (shared) headers_module (shared) mime_module (shared) mpm_prefork_module (shared) negotiation_module (shared) php5_module (shared) proxy_module (shared) proxy_ajp_module (shared) proxy_fcgi_module (shared) proxy_http_module (shared) proxy_uwsgi_module (shared) reqtimeout_module (shared) rewrite_module (shared) setenvif_module (shared) socache_shmcb_module (shared) ssl_module (shared) status_module (shared)
我看不出我做错了什么。
你有一个错字。 这不是uwscgi,它是uwsgi。
从UWSGI文档 :
从Apache 2.4.9开始,添加了对Unix套接字的支持。 语法非常简单:
ProxyPass / unix:/var/lib/uwsgi/app1.sock|uwsgi://uwsgi-uds-app1/
ProxyPass / unix:/var/lib/uwsgi/app2.sock|uwsgi://uwsgi-uds-app2/
我想你可能需要有以下线路来代替你现在拥有的: ProxyPass uwscgi://path/to/socket.sock
除此之外,unix / uwscgipath以URI的forms提供,其格式应为PROTOCOL:// PATH。 如果PATH是一个规范的path,你将有,例如unix:/// dev / null。