Tag Archives: ubuntu

Setting up a pptp vpn server

Share Button

It’s always been very useful to be able to vpn in to your network and access file-shares or internal websites as you would be able to do on your computer at work. PPTP VPN is very easy and fast to set up and it works for most of the devices and operating systems out there without additional software necessary. The pptpd service listens on port 1723 and your firewall needs to be adjusted to let it pass to the internal server that handles this. This video below demonstrates the install and configuration of a simple pptpd server on a Ubuntu Server 12.04LTS edition. I hope you enjoy this video and don’t forget to leave a comment here or on my youtube channel.

Thanks MSJ 😉


Enable SSL on Apache2

Share Button

Apache Web Server works great out of a box but in some cases you like to secure your site with a certificate and this Article will walk you through it step by step enabling SSL and generating a certificate. The only down site with self-signed certificates is that they are not trusted in the public internet and the customer will see a certificate warning. This doesn’t mean it’s not working it’s just that the certificate could not be verified but if you continue with the certificate it still secures your connection.

Let’s get started and install Apache2 enter:

sudo apt-get install apache2

type in ps ax |grep apache and you should see something like that:

23783 ? Ss 0:00 /usr/sbin/apache2 -k start
23787 ? S 0:00 /usr/sbin/apache2 -k start
23788 ? Sl 0:00 /usr/sbin/apache2 -k start
23789 ? Sl 0:00 /usr/sbin/apache2 -k start

that means the installation worked and apache is running. Now start firefox and enter the address of your web server in the URL and you should see this:



Great everything work the way it should. Now let’s create a certificate. First of all create a directory where we place our certificate. Type in:

sudo mkdir /etc/apache2/ssl

now create a certificate with the following command (it’s all in one line):

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

now openssl will ask you a bunch of questions. Let’s go over those together:

Generating a 2048 bit RSA private key
writing new private key to ‘/etc/apache2/ssl/apache-test.key’
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:New Mexico
Locality Name (eg, city) []:Albuquerque
Organization Name (eg, company) [Internet Widgits Pty Ltd]:UbuntuVideoCast
Organizational Unit Name (eg, section) []:IT Department
Common Name (e.g. server FQDN or YOUR name) []:www.ubuntuvideocast.com
Email Address []:mstjohn1974@gmail.com

this above should give you a good idea what you should fill in on those questions. Now that this is done lets prepare Apache to use it. Type in:

sudo nano /etc/apache2/sites-available/default-ssl

and now go down till you see the SSLEngine on directive. Now below that you should see the following two directives:

SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

we have to change it to match our new certificate, it should something like that:

SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

save it and enable ssl on apache by issuing this commands:

sudo a2enmod ssl

sudo a2ensite default-ssl

and last but now least restart or reloading the new configuration. Type:

sudo service apache2 restart

and try to hit it with your browser. If everything works you should see something like this:



This is the warning I was talking about earlier. Click on the link “I understand the risk” and you will see this:



Click on the button “Add Exception” and you will see this:



Click on the “View” button to verify it is really our certificate that we set up. You should see something like that:



Everything is there ..great…click on close and on the remaining screen click on “Confirm security exception” and we are done and should see this:



Cool…..that’s it…I hope it helped you in getting an SSL Certificate installed and running with your Web Server. Let me know if you have any further questions. Please comment on this article.


More Image Magick

Share Button

In May last year I wrote a post about ImageMagick and some neat features. Now I think it is time for some more features. I was browsing the net on the hunt for some additional feature I like to post on my blog. I showed you the commands mogrify and convert. Convert has some additional option I like to show you.

As you might remember we can use convert to actually convert one format for example png to jpg like this:

convert mypicture.png mypicture.jpg

we can also reduce the picture quality:

convert mypicture.png -quality 75 mypicture.jpg

this will reduce the output picture to a 75% of its original. You can also resize a picture to a specified dimension:

convert mypicture.jpg -resize 640×480 mypicture.jpg

the problem with the command above it the imagemagick tries to preserve the original aspect ratio and make it fit within the specified dimension but if you like to break that and force it to convert is in the desired dimension use the command as followed:

convert mypicture.jpg -resize 640×480! mypicture.jpg

Now lets say you took a picture while you flipped the camera in a 90% angle, with the command below you can rotate the picture clockwise.

convert mypicture.jpg -rotate 90 mypicture.jpg

It’s time for the real cool stuff. ImageMagick provides also effects.

convert mypicture.jpg -charcoal 3 mypicture.jpg

This for example applies the charcoal effect with an intensity of 3. Then there is the implode effect.

convert mypicture.jpg -implode 2 mypicture.jpg

You can also combine all of those together if you like. If you like to know more about ImageMagic and it’s command line function check out this link.

I hope you enjoyed this quick and dirty post. If you know something cool you can do with ImageMagick let me know.





1 2 3 25