Manage Time in Ubuntu Through Command Line

$sudo date newdatetimestring

nn is a two digit month, between 01 to 12 dd is a two digit day, between 01 and 31, with the regular rules for days according to month and year applying hh is two digit hour, using the 24-hour period so it is between 00 and 23 mm is two digit minute, between 00 and 59 yyyy is the year; it can be two digit or four digit: your choice. I prefer to use four digit years whenever I can for better clarity and less confusion ss is two digit seconds. Notice the period ‘.’ before the ss.eg:
Let’s say you want to set your computer’s new time to December 6, 2007, 22:43:55, then you would use:

sudo date 120622432007.55

Advertisements

Use a Self-Signed SSL Certificate with Apache

These instructions will help you generate a generic self-signed certificate, which may be used to provide SSL service for all name-based hosts on your VPS. Please note that self-signed certificates will generate warnings in a visitor’s browser; proceed to “Installing a Commercial SSL Certificate” if you need to set up SSL on a domain using a certificate signed by a commercial SSL provider.

$sudo apt-get install openssl
$sudo mkdir /etc/apache2/ssl
$sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key

You will be asked for several configuration values. Enter values appropriate for your organization and server.
$sudo /etc/apache2/ports.conf
Add the following line
NameVirtualHost *:443

Add these line in your vhost file.

<VirtualHost *:443>

SSLEngine On

SSLCertificateFile /etc/apache2/ssl/apache.pem

SSLCertificateKeyFile /etc/apache2/ssl/apache.key

ServerName www.mydomain.com

DocumentRoot /srv/www/mydomain.com/public_html/

</VirtualHost>

save and close.

$sudo a2enmod ssl
$sudo service apache2 restart.

That’s it. 🙂