Search Our Database
Enabling Server-Status and Managing Login Details of Server-Status in DirectAdmin by using CLI
Introduction
Monitoring server performance is a crucial task for system administrators to ensure that web services remain responsive and efficient. DirectAdmin, a widely used web hosting control panel, provides administrators with access to Apache’s mod_status module through the server-status feature. This module offers real-time insights into server performance, such as active HTTP requests, resource consumption, and worker status.
Enabling and securing server-status in DirectAdmin allows administrators to quickly diagnose issues, monitor server load, and make informed decisions to optimize performance. However, to prevent unauthorized access, it is essential to protect the server-status page using HTTP authentication.
This article outlines the process to:
- Verify if server-status is enabled.
- Review and configure server-status settings via Apache’s configuration file.
- Update or reset authentication credentials for secure access.
This guide is intended for administrators who manage web servers using DirectAdmin and need a reliable method to monitor Apache server metrics securely.
Prerequisites
- Administrator access to the DirectAdmin control panel.
- SSH access to the server with root privileges.
- Apache web server installed and running on the server.
Step-by-step Guide
Step 1: Verify if Server-Status is Enabled
Visit the following URL in your browser:
https://<server-ip>/server-status
If enabled, the Apache server-status page should display real-time server metrics.
Step 2: Locate the server-status Configuration
vi /etc/httpd/conf/extra/httpd-info.conf
Step 3: Review the Server-Status Block
<Location /server-status> SetHandler server-status AuthType Basic AuthName "Apache status" AuthUserFile /var/www/passwd-server-status Require valid-user </Location>
Step 4: Explanation of the Configuration
- <Location /server-status>: Applies the enclosed settings to the /server-status URL.
- SetHandler server-status: Activates the server-status handler provided by mod_status.
- AuthType Basic: Enforces HTTP Basic Authentication to restrict access.
- AuthName “Apache status”: Sets the authentication realm displayed to users.
- AuthUserFile /var/www/passwd-server-status: Defines the file containing user credentials for authentication.
- Require valid-user: Allows only authenticated users from the specified AuthUserFile.
Step 5: Update or Reset Server-Status Login Credentials
To add or update a user without overwriting the existing file:
htpasswd /var/www/passwd-server-status username
You will be prompted to enter a new password for the specified username.
Step 6: Access the Server-Status Page
https://<server-ip>/server-status
Authentication will be required to view the page.
Step 7: Additional Reference
For details on interpreting the server-status metrics, refer to:
Understanding the Server-Status Page
Conclusion
Enabling and managing Apache’s server-status in DirectAdmin is a straightforward process that provides valuable insights into server performance and resource usage. By securing this page with authentication, administrators can ensure that only authorized personnel have access to server statistics.
Should you have any inquiries about the guidelines, please feel free to open a ticket through your portal account or contact us at support@ipserverone.com. We’ll be happy to assist you further.