Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Wednesday, September 24, 2014

How to create service for apache webserver in windows manually


Incase if you have not chosen "Add as a service" option during the Apache or IHS installation, Then you will have to add the Apache service manually to the windows services. This would start and stop the webserver automatically during the windows reboot.

Following steps will guide you to manually create a service for apache webserver in windows.

Commands:

To create a service:

Syntax:  sc <server> create [service name] [binPath= ] <option1> <option2> ..

sc.exe create "servicename" binPath= "E:\bin\httpd -k runservice" DisplayName= "somename" start= auto

ex: sc.exe create apacheservice binPath= "E:\bin\httpd -k runservice" DisplayName= "Apacheservice" start= auto

Following message will indicate a successful service creation.

[SC] CreateService SUCCESS

NOTE: Ensure that there is a space after the "=" symbol or else the command will fail. Following message will be displayed in case of wrong syntax.


To Delete a service:  

sc.exe delete apacheservice 

[SC] DeleteService SUCCESS 

Testing:

go to run prompt, type service.msc. The newly created service will be visible. You can right click and change the properties, start and stop the service.

This similar exercise can be used for other services as well, Only the command will differ. 

                                 (: Happy learning :)


Thursday, September 18, 2014

Unable to load config info from /usr/local/ssl/openssl.cnf



Issue:
 
While trying to generate the csr from the key using openssl in windows, The following error will be displayed.

 

Solution: download the openssl.cnf file from the following link and paste the file any location. I prefer to keep the files in config folder of openssl folder structure.

You will get this error while trying to generate the csr. Incase if you do not know the steps to generate key,cse and crt. Please go through the following link.


The commands from the above link would be similar for windows as you are using openssl.

After placing the openssl.cnf file, use the following command to generate the csr. 

openssl req -new -key server.key -out server.csr -config < path of openssl.cnf>

This command will ask you for the common name,organization unit name etc. After providing all the details a csr will be generated. A vendor signed or self signed certificate can be requested.

                                 (: Happy learning :)