Search Our Database

Enabling Server-Status and Managing Login Details of Server-Status in DirectAdmin by using CLI

Last updated on |

Introduction

Monitoring server performance is essential for maintaining website and service health. In DirectAdmin, the server-status module offers real-time insights into server performance, including HTTP requests and resource usage. This article guides administrators through enabling server-status and managing login credentials.

Prerequisites

  • Administrator access to the DirectAdmin control panel.
  • SSH access to the server for configuration adjustments.

1. Firstly, you can check if the server-status is enabled. You can browse it by using https://:<server-ip>/server-status

2. To find out the login details or the other server-status settings. SSH into your server as root and use the command below to open the file:

vi /etc/httpd/conf/extra/httpd-info.conf

3. Find the server-status part which similar as below:

<Location /server-status>
SetHandler server-status
AuthType basicu
AuthName “Apache status”
AuthUserFile /var/www/passwd-server-status
Require valid-user
</Location>

4. Let me explain it:

  1. <Location /server-status>
    This directive specifies that the configuration enclosed within the <Location> and </Location> tags applies to the URL path /server-status. It means when you access http://yourserver.com/server-status, the settings here are applied.
  2. SetHandler server-status
    SetHandler server-status tells Apache to process requests to the specified location (/server-status) using the server-status handler. This handler is part of Apache’s mod_status module, which generates the server status page. Essentially, it activates the server status page for the given location.
  3. AuthType basic
    This line specifies the type of authentication to be used for securing access to the server status page. basic authentication is a simple authentication scheme built into the HTTP protocol. It sends usernames and passwords over the network in base64 encoded form, making it relatively easy to decode if intercepted. This is why it’s recommended to use HTTPS when basic authentication is in place to protect the credentials.
  4. AuthName “Apache status”
    AuthName sets the realm of the authentication. The realm is essentially a description that the server presents to the user, indicating which username and password should be used when making a request. In this case, “Apache status” is the realm name, which will appear in the dialog box where the user enters their credentials.
  5. AuthUserFile /var/www/passwd-server-status
    This directive tells Apache where to find the file containing the list of valid usernames and their passwords for accessing the /server-status location. /var/www/passwd-server-status is the path to this file. This file should be created and managed using the htpasswd utility, which is part of Apache’s suite of tools.
  6. Require valid-user
    Finally, Require valid-user indicates that only authenticated users (those with a username and password recognized by the AuthUserFile) are allowed to access the server status page. This means that anyone trying to access /server-status must successfully authenticate using one of the usernames and passwords listed in /var/www/passwd-server-status.

5. If you want to reset the login details of the server-status, you can follow the steps below:

Overwrite the User:

To overwrite the user, you’d use:

htpasswd -c /var/www/passwd-server-status <username>

This command creates the file if it doesn’t exist and adds a new user. You’ll be prompted to enter and confirm the password.

Updating/Adding Users Without Overwriting:

If the file already exists and you want to add a new user or update an existing user’s password without overwriting the file, you omit the -c flag:

htpasswd /var/www/passwd-server-status username

6. Now, you can access to the server-status page by using this URL:

https://<ip-address>/server-status

You can check this KB for understanding the Server-Status Page: https://www.ipserverone.info/knowledge-base/how-to-monitor-server-status-by-enabling-server-status-in-directadmin-server/

Conclusion

Enabling and managing server-status in DirectAdmin is straightforward and provides valuable performance insights.

For additional assistance or if you encounter any issues, please contact our support team at support@ipserverone.com.