Archive for August, 2009

Certificate for Apache with Open SSL

1.Certificate Creation

  • Generate Private Key
openssl genrsa -des3 -out shyju-pc.key 1024

if you don’t want to put password(Apache will always ask for password when starting the service)  don’t put -des3

  • Generate CSR
openssl req -new -key shyju-pc.key -config “C:\Apache\conf\openssl.cnf” -out shyju-pc.csr
  • Generate Self Signed certificate for time being
openssl x509 -req -days 30 -in shyju-pc.csr -signkey shyju-pc.key -out shyju-pc.crt
  • Export to ISS

openssl pkcs12 -export -out DigiCertBackup.pfx -inkey shyju-pc.key -in  shyju-pc.crt -certfile “D:\NetworkSolutions_CA.crt”
If you want to export certificate to another Apache server you can just copy the SSL certificate, private key, and any intermediate certificates to the second server and configure httpd.conf .

Network Solutions gives some instructions on their website that are outdated so it left me guessing on the correct order to create the SSLCertificateChainFile. Here is the correct order:


Just take the stuff out of each file and copy/paste into a new file. Do not remove the BEGIN and END lines. Then, place the file somewhere on the server and in the apache config enter the full path to it like this:
SSLCertificateChainFile /etc/httpd/conf/certs/network_solutions_combined_2008.crt

2. Edit httpd.conf

Listen 443
<VirtualHost _default_:443>
ServerName http://shyju-pc
SSLEngine on
SSLCertificateFile “C:\Apache\conf\shyju-pc.crt”
SSLCertificateKeyFile “C:\Apache\conf\shyju-pc.key”

SSLCertificateChainFile “C:\Apache\conf\combined.crt”
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown
CustomLog logs/ssl_request_log \
“%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \”%r\” %b”

, , , , , , ,

Leave a comment

Delete Blank lines from Asterisk Config files

When I installed the Asterisk-GUI., I found that once we make any changes in configuration from i asterisk-gui, it will insert many blank lines along with the changes in the configuration files(/etc/asterisk/*.conf)..
So no. of the blank lines increases with configuration changes and after certain no of changes the the asterisk pbx stop responding and it could not read the config files because of the huge file size..

I found a work around for this problem by deleting the blank lines when the config file changes..
For this we have to make the below change in asteisk-gui file “/var/lib/asterisk/static-http/config/js/index.js”.
Search for “module reload”.Then put the following lines after that like below ..

var t = ASTGUI.cliCommand(‘module reload’);
ASTGUI.systemCmdWithOutput(“/bin/sed ‘/^$/d’ -i /etc/asterisk/users.conf”,function(a1){});
ASTGUI.systemCmdWithOutput(“/bin/sed ‘/^$/d’ -i /etc/asterisk/extensions.conf”,function(b1){}); = ‘none’;

This will remove blank lines only from users.conf&extensions.conf(these are main files where the configuration changes happens repeatedly)

, , , , , , ,

1 Comment