{"id":5885,"date":"2020-11-10T14:16:44","date_gmt":"2020-11-10T08:46:44","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=5885"},"modified":"2026-11-17T17:42:38","modified_gmt":"2026-11-17T12:12:38","slug":"how-to-enable-authentication-for-the-kibana-dashboard-using-apache-webserver-on-centos-7","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-enable-authentication-for-the-kibana-dashboard-using-apache-webserver-on-centos-7\/","title":{"rendered":"How to Enable Authentication for the Kibana Dashboard Using Apache Web Server on CentOS 7"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Post Date:<\/strong> November 7, 2020<br><strong>Last Updated:<\/strong> November 17, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Kibana is an open-source data visualization and exploration platform used with Elasticsearch. It provides a web-based interface for monitoring, managing, searching, and visualizing data collected in the Elastic Stack.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Kibana dashboard displays information through charts, graphs, metrics, searches, and maps, allowing administrators to analyze data from a centralized interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Kibana provides built-in authentication through Elasticsearch security in modern Elastic Stack versions. However, you may also want to add an additional authentication layer using the Apache web server to restrict access to the dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we will explain how to configure Apache Basic Authentication as an additional security layer for a Kibana dashboard using a reverse proxy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> CentOS 7 reached end of life on June 30, 2024. It no longer receives regular security updates. The following instructions are intended for maintaining or understanding legacy CentOS 7 environments. For new deployments, use a supported operating system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before configuring Apache authentication for Kibana, ensure that you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A CentOS 7 server with administrative or root access.<\/li>\n\n\n\n<li>Kibana installed and running.<\/li>\n\n\n\n<li>Elasticsearch configured and accessible.<\/li>\n\n\n\n<li>Apache HTTP Server installed or permission to install it.<\/li>\n\n\n\n<li>A domain name pointing to the server, such as <code>monitor.example.com<\/code>.<\/li>\n\n\n\n<li>A valid SSL\/TLS certificate for secure HTTPS access.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, we use the following configuration:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Component<\/th><th>Configuration<\/th><\/tr><tr><td>Operating system<\/td><td>CentOS 7<\/td><\/tr><tr><td>Web server<\/td><td>Apache HTTP Server<\/td><\/tr><tr><td>Kibana port<\/td><td>5601<\/td><\/tr><tr><td>Kibana address<\/td><td>127.0.0.1<\/td><\/tr><tr><td>Domain<\/td><td>monitor.example.com<\/td><\/tr><tr><td>Authentication<\/td><td>Apache Basic Authentication<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Enable Authentication for the Kibana Dashboard Using Apache<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install the Apache Web Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First, install the Apache HTTP Server and the tools required to create password-protected users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install httpd httpd-tools mod_ssl -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Enable and start the Apache service:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl enable httpd\nsystemctl start httpd<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the Apache service status:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl status httpd<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Create a Username and Password for Kibana<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After installing Apache, create a username and password using the <code>htpasswd<\/code> utility.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">htpasswd -cB \/etc\/httpd\/conf\/.htpasswd kibanaadmin<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You will be prompted to enter and confirm a password:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">New password:\nRe-type new password:\nAdding password for user kibanaadmin<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-c<\/code> creates a new password file.<\/li>\n\n\n\n<li><code>-B<\/code> uses bcrypt password hashing.<\/li>\n\n\n\n<li><code>\/etc\/httpd\/conf\/.htpasswd<\/code> is the password file location.<\/li>\n\n\n\n<li><code>kibanaadmin<\/code> is the username created for dashboard access.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Set appropriate permissions on the password file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">chown root:apache \/etc\/httpd\/conf\/.htpasswd\nchmod 640 \/etc\/httpd\/conf\/.htpasswd<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Use the <code>-c<\/code> option only when creating the password file for the first time. If you want to add another user to the existing file, run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">htpasswd -B \/etc\/httpd\/conf\/.htpasswd anotheruser<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Using <code>-c<\/code> again will overwrite the existing password file and remove its previous users.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Configure Kibana to Listen on Localhost<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By default, Kibana commonly uses port 5601. To ensure that users access the dashboard through Apache rather than connecting directly to Kibana, configure Kibana to listen only on the local interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Kibana configuration file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vi \/etc\/kibana\/kibana.yml<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Set the following configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">server.port: 5601\nserver.host: \"127.0.0.1\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and restart Kibana:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl restart kibana<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that Kibana is listening on the local address:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ss -lntp | grep 5601<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The expected listening address should be <code>127.0.0.1:5601<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This prevents external users from bypassing Apache&#8217;s authentication by accessing port 5601 directly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Configure Apache as a Reverse Proxy with Basic Authentication<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now configure Apache to forward requests to Kibana and require a username and password before allowing access.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new Apache configuration file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vi \/etc\/httpd\/conf.d\/kibana.conf<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;VirtualHost *:80>\n    ServerName monitor.example.com\n\n    ProxyPreserveHost On\n    ProxyRequests Off\n\n    ProxyPass \/ http:\/\/127.0.0.1:5601\/\n    ProxyPassReverse \/ http:\/\/127.0.0.1:5601\/\n\n    # Protect the Kibana dashboard with Basic Authentication\n    &lt;Location \/>\n        AuthType Basic\n        AuthName \"Restricted Content\"\n        AuthUserFile \/etc\/httpd\/conf\/.htpasswd\n        Require valid-user\n    &lt;\/Location>\n\n&lt;\/VirtualHost><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>monitor.example.com<\/code> with your actual domain name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Explanation of the configuration:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ProxyPreserveHost On<\/code>: Preserves the original Host header when forwarding requests to Kibana.<\/li>\n\n\n\n<li><code>ProxyRequests Off<\/code>: Disables forward proxy functionality. This is the recommended setting for a reverse proxy.<\/li>\n\n\n\n<li><code>ProxyPass<\/code>: Forwards incoming requests to the Kibana service running on port 5601.<\/li>\n\n\n\n<li><code>ProxyPassReverse<\/code>: Adjusts response headers when required for reverse proxy operation.<\/li>\n\n\n\n<li><code>AuthType Basic<\/code>: Enables HTTP Basic Authentication.<\/li>\n\n\n\n<li><code>AuthName<\/code>: Defines the authentication prompt displayed by the browser.<\/li>\n\n\n\n<li><code>AuthUserFile<\/code>: Specifies the file containing the authentication usernames and password hashes.<\/li>\n\n\n\n<li><code>Require valid-user<\/code>: Allows access only to users listed in the password file.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Apache requires the appropriate proxy modules, including <code>mod_proxy<\/code> and <code>mod_proxy_http<\/code>, to be available and loaded.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Configure HTTPS for Secure Authentication<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Basic Authentication sends credentials using an HTTP authentication header. Without HTTPS, these credentials are not encrypted during transmission.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore, configure an SSL\/TLS certificate for your domain before exposing the dashboard publicly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if you use a Let&#8217;s Encrypt certificate, configure an HTTPS virtual host in your Apache configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;VirtualHost *:443>\n    ServerName monitor.example.com\n\n    SSLEngine on\n    SSLCertificateFile \/etc\/letsencrypt\/live\/monitor.example.com\/fullchain.pem\n    SSLCertificateKeyFile \/etc\/letsencrypt\/live\/monitor.example.com\/privkey.pem\n\n    ProxyPreserveHost On\n    ProxyRequests Off\n\n    ProxyPass \/ http:\/\/127.0.0.1:5601\/\n    ProxyPassReverse \/ http:\/\/127.0.0.1:5601\/\n\n    &lt;Location \/>\n        AuthType Basic\n        AuthName \"Restricted Content\"\n        AuthUserFile \/etc\/httpd\/conf\/.htpasswd\n        Require valid-user\n    &lt;\/Location>\n\n&lt;\/VirtualHost><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should also redirect HTTP requests to HTTPS. Add the following virtual host:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;VirtualHost *:80>\n    ServerName monitor.example.com\n    Redirect permanent \/ https:\/\/monitor.example.com\/\n&lt;\/VirtualHost><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the certificate paths match the actual certificate installation on your server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Check and Restart the Apache Service<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before restarting Apache, validate the configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">httpd -t<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the configuration is valid, you should see:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Syntax OK<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Apache to apply the changes:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl restart httpd<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the service status:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl status httpd<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If Apache fails to start, review the error logs:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">tail -50 \/var\/log\/httpd\/error_log<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Configure Firewall and SELinux (If Required)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If firewalld is enabled, allow HTTP and HTTPS traffic:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">firewall-cmd --permanent --add-service=http\nfirewall-cmd --permanent --add-service=https\nfirewall-cmd --reload<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If SELinux is enforcing, Apache may be prevented from connecting to Kibana on port 5601.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Allow Apache to establish network connections:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">setsebool -P httpd_can_network_connect 1<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do not expose port 5601 publicly. External dashboard access should go through Apache.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: Access the Kibana Dashboard<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once the configuration is complete, open a web browser and access your domain:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">https:\/\/monitor.example.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The browser should display an authentication prompt requesting a username and password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the credentials created in Step 2:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Username:<\/strong> kibanaadmin<\/li>\n\n\n\n<li><strong>Password:<\/strong> The password configured using <code>htpasswd<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">After successful authentication, Apache forwards the request to Kibana, and the dashboard should load.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Verify Apache Authentication<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can also verify the authentication configuration using the <code>curl<\/code> command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, test without providing credentials:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -I https:\/\/monitor.example.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A successful authentication challenge should return:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">HTTP\/1.1 401 Unauthorized\nWWW-Authenticate: Basic realm=\"Restricted Content\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, test with the configured username and password:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -I -u kibanaadmin https:\/\/monitor.example.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The command prompts you for the password. After successful authentication, you should receive a response from the proxied Kibana service.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Issues and Troubleshooting<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Apache Returns a 502 Bad Gateway Error<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible cause:<\/strong> Apache cannot connect to Kibana on port 5601.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Solution:<\/strong> Check whether Kibana is running:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl status kibana<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that Kibana is listening on the expected address:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ss -lntp | grep 5601<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Also check Apache&#8217;s error log and SELinux settings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Apache Returns a 403 Forbidden Error<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible cause:<\/strong> Apache cannot access the password file, or the authentication configuration is incorrect.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Solution:<\/strong> Verify the password file permissions:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ls -l \/etc\/httpd\/conf\/.htpasswd<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure the Apache service account can read the file and that the <code>AuthUserFile<\/code> path is correct.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Browser Does Not Display the Authentication Prompt<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible cause:<\/strong> The authentication directives are missing, incorrectly configured, or applied to a different URL location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Solution:<\/strong> Verify the <code>&lt;Location \/&gt;<\/code> configuration and ensure Apache has loaded the required authentication modules. Validate and restart Apache after making changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Kibana Is Accessible Directly Through Port 5601<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible cause:<\/strong> Kibana is listening on an externally accessible interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Solution:<\/strong> Set <code>server.host: \"127.0.0.1\"<\/code> in <code>kibana.yml<\/code>, restart Kibana, and ensure firewall rules prevent external access to port 5601.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Apache Cannot Connect to Kibana Because of SELinux<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible cause:<\/strong> SELinux is preventing Apache from making network connections to the Kibana backend.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Solution:<\/strong> Check the SELinux status and allow the required connection:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">getenforce\nsetsebool -P httpd_can_network_connect 1<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Apache Basic Authentication vs. Kibana Built-in Authentication<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Apache Basic Authentication and Kibana&#8217;s built-in authentication serve different purposes.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Feature<\/th><th>Apache Basic Authentication<\/th><th>Kibana Built-in Authentication<\/th><\/tr><tr><td>Authentication layer<\/td><td>Apache web server<\/td><td>Elasticsearch security<\/td><\/tr><tr><td>User management<\/td><td>Apache password file<\/td><td>Elasticsearch users and realms<\/td><\/tr><tr><td>Role-based access<\/td><td>Not provided by Apache Basic Authentication alone<\/td><td>Supported through Elasticsearch roles<\/td><\/tr><tr><td>Authentication prompt<\/td><td>Browser-level HTTP prompt<\/td><td>Kibana login page<\/td><\/tr><tr><td>Main purpose<\/td><td>Add an access restriction in front of Kibana<\/td><td>Authenticate users and control application access<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For modern Elastic Stack deployments, Kibana&#8217;s built-in authentication is generally the recommended approach. Apache Basic Authentication can be used as an additional access-control layer when required.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Securing the Kibana dashboard is important because it may contain sensitive monitoring information, application metrics, and operational data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Apache Basic Authentication provides an additional layer of protection by requiring users to enter valid credentials before accessing the Kibana dashboard. By configuring Apache as a reverse proxy, creating an <code>htpasswd<\/code> file, and enabling HTTPS, you can restrict external access to the dashboard.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions (FAQs)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Does Kibana support authentication by default?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Modern Kibana versions support built-in authentication through Elasticsearch security. Authentication can be configured using supported security realms and authentication providers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Why use Apache Basic Authentication for Kibana?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Apache Basic Authentication adds an additional access restriction in front of the Kibana dashboard. It can prevent unauthorized visitors from reaching the Kibana interface before they authenticate.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Which port does Kibana use by default?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Kibana uses port <code>5601<\/code> by default. Apache can act as a reverse proxy so users can access Kibana through a domain name without specifying the backend port.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Is HTTPS required when using Apache Basic Authentication?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">HTTPS is strongly recommended. Basic Authentication does not encrypt credentials by itself, so using it over plain HTTP can expose credentials during transmission.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Can I use Apache authentication and Kibana authentication together?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Apache can require an additional username and password before forwarding requests to Kibana. Kibana can then perform its own authentication and authorization through Elasticsearch security.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">References<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.elastic.co\/docs\/deploy-manage\/users-roles\/cluster-or-deployment-auth\/kibana-authentication\" target=\"_blank\" rel=\"noopener\">Elastic Documentation \u2013 Authentication in Kibana<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.elastic.co\/docs\/reference\/kibana\/configuration-reference\/security-settings\" target=\"_blank\" rel=\"noopener\">Elastic Documentation \u2013 Security Settings in Kibana<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-perform-elk-server-backup-restore-and-recovery-elasticsearch-7-17-x\/\">How to Perform ELK Server Backup, Restore, and Recovery (Elasticsearch 7.17.x)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-create-a-read-only-user-for-kibana-dashboard-elk-stack\/\">How to Create a Read-Only User for Kibana Dashboard (ELK Stack)<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Need Assistance?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Need help securing your Kibana dashboard, configuring Apache reverse proxies, or implementing authentication for your Elastic Stack environment?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/pheonixsolutions.com\/devops-cloud\/\">Pheonix Solutions<\/a> technical team can assist you with Linux server administration, Apache configuration, Elasticsearch, Kibana, and infrastructure security.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For assistance, <a href=\"https:\/\/pheonixsolutions.com\/contact\/\" data-type=\"link\" data-id=\"https:\/\/pheonixsolutions.com\/contact\/\">contact us<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: November 7, 2020Last Updated: November 17, 2026 Introduction Kibana is an open-source data visualization and exploration platform used [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[540],"class_list":["post-5885","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-apache-rules","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1wV","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=5885"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5885\/revisions"}],"predecessor-version":[{"id":13601,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5885\/revisions\/13601"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}