尝试使用 Apache 2.4 设置 Elasticsearch+Logstash+Kibana。
-- 安装成功:
brew install elasticsearch logstash httpd24
-- 启用虚拟主机模块/usr/local/etc/apache2/2.4/httpd.conf:
# Virtual hosts
Include /usr/local/etc/apache2/2.4/extra/httpd-vhosts.conf
和
LoadModule vhost_alias_module libexec/mod_vhost_alias.so
-- 在中创建虚拟主机/usr/local/etc/apache2/2.4/extra/httpd-vhosts.conf:
<VirtualHost *:8080>
ServerName kibana4.serv
ServerAlias www.kibana4.serv
DocumentRoot /usr/local/var/www/kibana-4.0.2-darwin-x64/src/public
<Directory /usr/local/var/www/kibana-4.0.2-darwin-x64/src/public>
Require all granted
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
-- 为 ELK 创建了新的配置/usr/local/etc/apache2/2.4/other/elk.conf:
LoadModule proxy_http_module /usr/local/opt/httpd24/libexec/mod_proxy_http.so
<Location /elasticsearch>
ProxyPass http://localhost:9200/
ProxyPassReverse /
SSLRequireSSL
</Location>
<Location /kibana/>
ProxyPass http://localhost:5601/
ProxyPassReverse /
SSLRequireSSL
</Location>
-- 包含新创建的配置elk配置文件到/usr/local/etc/apache2/2.4/httpd.conf:
Include /usr/local/etc/apache2/2.4/other/*.conf
但是当我尝试重新启动 apache 时得到:
$ /usr/local/opt/httpd24/bin/httpd -D FOREGROUND
httpd: Syntax error on line 523 of /usr/local/etc/apache2/2.4/httpd.conf:
Syntax error on line 1 of /usr/local/etc/apache2/2.4/other/elk.conf:
Cannot load /usr/local/opt/httpd24/libexec/mod_proxy_http.so into server:
dlopen(/usr/local/opt/httpd24/libexec/mod_proxy_http.so, 10):
Symbol not found: _ap_proxy_cookie_reverse_map\n
Referenced from: /usr/local/opt/httpd24/libexec/mod_proxy_http.so\n
Expected in: flat namespace\n in /usr/local/opt/httpd24/libexec/mod_proxy_http.so
加载 mod_proxy_http.so 有什么问题?模块的路径是正确的……
答案1
我已在 httpd.conf 中取消注释:
LoadModule proxy_module libexec/mod_proxy.so