Easy Apache SSL generation shell script

Here’s my bash shell script to generate SSL server key and csr files.


#!/bin/bash

echo "Enter file path to store cert e.g. /etc/httpd/conf/ssl"
read FILEPATH
echo "Enter full domain name e.g. www.whatever.com"
read DOMAINNAME

FULLPATH="$FILEPATH/$DOMAINNAME"

echo "# # # # # # # # # # # # # # # # # # # # # #"
echo "# Creating server .key "
echo "# $FULLPATH.key "
echo "# # # # # # # # # # # # # # # # # # # # # #"
openssl genrsa -des3 -out $FULLPATH.key 1024

echo "# # # # # # # # # # # # # # # # # # # # # #"
echo "# Creating .csr "
echo "# $FULLPATH.csr "
echo "# # # # # # # # # # # # # # # # # # # # # #"
openssl req -new -key $FULLPATH.key -out $FULLPATH.csr

echo "# # # # # # # # # # # # # # # # # # # # # #"
echo "# Creating .pem "
echo "# pulling password out of .key"
echo "# $FULLPATH.pem "
echo "# # # # # # # # # # # # # # # # # # # # # #"
# this one's optional...
openssl rsa -in $FULLPATH.key -out $FULLPATH.pem

Comments (0) 7:00 am

Mac OS X & cron not starting

Why Apple decided to not start cron by default… I don’t know. They did create a launchd startupitem, however, it’s got a funky twist. It looks to see if the cron tabs have been touched, then decides to run cron… after a reboot.

So, to overcome this lameness, simply open your terminal.app and type:
sudo crontab -e

Using your vi skills, add a # to the file, save and quit.

Reboot and do a ps aux | grep cron to see it running.

Comments (0) 11:15 am

Basic Network Configuration

Configuring networking on Linux, Unix and Solaris systems is easy. It is accomplished in two easy steps. Note: “#” is the command prompt.

#ifconfig [interface] [ip address] netmask [netmask]
- E.g. ( solaris 8 ) #ifconfig dmfe0 10.0.1.20 netmask 255.255.255.0
#route add default [ip address to default gateway] [interface]
- E.g. ( solaris 8 ) #route add default 10.0.1.1 dmfe0
So basically you add an IP address that is on the same subnet as your default gateway, then make the default gateway the default route. Pretty easy.

Comments (0) 6:14 am