logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Change Apache service description
Author
elav83



Joined: 10 Nov 2014
Posts: 17
Location: India

PostPosted: Mon 25 Jul '16 12:36    Post subject: Change Apache service description Reply with quote

Can some one tell me how to change the httpd service description in Windows?
When Apache is run as service using the command httpd.exe -k install -n "MyServiceName" then we are able to see the version details in service description.
Description: Apache/2.4.23 (Win64) OpenSSL/1.0.2h
We want to hide the description for security reason.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Mon 25 Jul '16 12:44    Post subject: Reply with quote

You can try the directive: ServerTokens

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of: Full | OS | Minor | Minimal | Major | Prod
# where Full conveys the most information, and Prod the least.
#
Back to top
elav83



Joined: 10 Nov 2014
Posts: 17
Location: India

PostPosted: Mon 25 Jul '16 14:51    Post subject: Reply with quote

Hi Steffen

Thanks for the reply.
I need to disable server details in service description(httpd is run as service in windows).
My config file already has the following configuration:

#To disable server signature
ServerSignature Off
ServerTokens Prod
Back to top
timo



Joined: 03 Jun 2012
Posts: 45
Location: FI, EU

PostPosted: Mon 25 Jul '16 15:26    Post subject: Service description Reply with quote

elav83 wrote:
I need to disable server details in service description(httpd is run as service in windows).


Service description can be changed with SC command in Windows.
sc <server> [command] [service name] <option1> <option2>...

sc without any arguments for help.

If your service name is Apache,
sc description Apache "new service description"

SC must be run as elevated user.
Back to top
elav83



Joined: 10 Nov 2014
Posts: 17
Location: India

PostPosted: Tue 26 Jul '16 6:49    Post subject: Reply with quote

Hi Timo,
Thanks for the reply.

SC command changes the description but the description is reset every time when the service is started. It looks like Apache sets the description at the service startup.
SC command is not solving the problem.

Is there any configuration available to change the service description? or In which source code file we have to make the change.
Back to top
tholian



Joined: 22 Apr 2015
Posts: 4
Location: Malaysia

PostPosted: Tue 26 Jul '16 7:37    Post subject: Reply with quote

can you give a screenshot of what exactly you wish to change?
Back to top
elav83



Joined: 10 Nov 2014
Posts: 17
Location: India

PostPosted: Tue 26 Jul '16 10:56    Post subject: Reply with quote

Hi Tholian,

Thanks for the reply. Here is the screen shot.
I want to change/hide the description. Due to security reasons I want to hide the Apache/OpenSSL version details in
server machine.


Regards,
Elavarasan
Back to top
elav83



Joined: 10 Nov 2014
Posts: 17
Location: India

PostPosted: Tue 26 Jul '16 11:11    Post subject: Reply with quote

I'm able to change the service description by modifying the source code.

Source File: ..\httpd-2.4.23\server\mpm\winnt\service.c
Function: set_service_description()
The variable full_description is assigned with custom description:
full_description = (const char *)AP_SERVER_MY_DESCRIPTION;


I'm not sure whether changing the source is the only possible way or any other alternative is also available.
Back to top
tholian



Joined: 22 Apr 2015
Posts: 4
Location: Malaysia

PostPosted: Tue 26 Jul '16 11:36    Post subject: Reply with quote

you can change it by starting windows command prompt as administrator and enter the following:


Code:
sc description ApacheNode1 "Tholian Apache Server"



ApacheNode1= The service name

"Tholian Apache Server" = the description you want to appear

hope this helps
Back to top
timo



Joined: 03 Jun 2012
Posts: 45
Location: FI, EU

PostPosted: Tue 26 Jul '16 14:53    Post subject: Reply with quote

Instead of changing the description, try http://stackoverflow.com/questions/38568582/how-to-change-apache-service-description-in-windows to hide it.
Back to top
elav83



Joined: 10 Nov 2014
Posts: 17
Location: India

PostPosted: Wed 27 Jul '16 11:45    Post subject: Reply with quote

The link in the stackoverflow describes about 'LanmanService' and not the Apache service.

The only possible solution I know is changing the source code and it works.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Mon 01 Aug '16 15:59    Post subject: Reply with quote

elav83 wrote:
The link in the stackoverflow describes about 'LanmanService' and not the Apache service.

That is only an example.

in
Code:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache2.4


Description you can change that, too!

elav83 wrote:


The only possible solution I know is changing the source code and it works.

See above that it is possible.
Back to top
tpbradt



Joined: 18 Jan 2017
Posts: 1
Location: USA

PostPosted: Wed 18 Jan '17 21:29    Post subject: Reply with quote

All,

1) Any option for changing the Apache services description does not work, whether it is using sc.exe or going straight to the registry. When the service is next started or restarted, it will change the description right back to the original.
2) Yes, the option listed in the SO post answer can be used for any service and not just the LanmanServer. However it is not a good option for anyone who still wants the service visible but just wants to hide or change the DESCRIPTION of the service. The "hidden" parameter hides the service itself, not just the description as the user listed as the option. NOTE: The Microsoft kb is inaccurate...the value to be added is a REG_DWORD, not REG_BINARY.
3) None of the httpd.conf directives, including ServerTokens as mentioned here (seems to apply only the HTTP response header, nothing to do with the service), seem to have any relation to the service description.
4) I am concluding, as elav83 has also insisted, that the only real solution is to modify the code itself. Sad...this should be configurable.
Back to top


Reply to topic   Topic: Change Apache service description View previous topic :: View next topic
Post new topic   Forum Index -> Apache