How to blogs and code snippets - Server Administration

How to install letsencrypt SSL certificates for Nginx server block on Debian Jessie

Posted Tuesday April 26, 2016 14:25:54
Let's Encrypt

Let's Encrypt (letsencrypt) is a new Certificate Authority (CA) that provides an easy way to obtain and install free trusted TLS/SSL certificates, thereby enabling encrypted HTTPS on web servers. It simplifies the process by providing a software client, letsencrypt, that automate most, if not all of the required setup steps.


Continue reading

How to create a hidden service in the Tor network in Debian Jessie with Nginx

Posted Saturday April 23, 2016 23:13:57
Dark web - onion service

(This is for educational purposes only!)

With hidden service also known as "dark web", "dark net" or "deep web", it is possible for servers to hide their locations while offering various kinds of services. Users connect to these hidden services without knowing the network identity.


Continue reading

Install Tomcat 8 behind Nginx with Google PageSpeed in Debian Wheezy

Posted Saturday March 22, 2014 13:24:56

   How to install Tomcat 8 in Debian Wheezy
Here is a guide on how to configure Debian Wheezy with Tomcat 8 behind Nginx with Google PageSpeed. This is based on our recently configured Wheezy of similar setup. Below are the main components of this webserver installation.

  • Nginx with Google PageSpeed and some other Nginx modules
  • Tomcat 8 on Java 7
  • MySQL and phpMyAdmin on php5-fpm.
  • Debian Wheezy Linux server.


Continue reading

Improving page load with mod_expires and ExpiresFilter in JSF applications

Posted Monday June 24, 2013 16:00:04

Apache 2 mod_expires and Tomcat 7 ExpiresFilter add Cache-Control HTTP header in server responses. Caching allows resources to be saved, or cached by the browser. Once a resource is cached, the browser refer to the locally cached copy instead of having to download it again on subsequent visits to the web page. This reduces round trip time by not having to request for these resources, thus improve page load.


Continue reading

2 ways to setup SSL on Tomcat 7

Posted Thursday March 14, 2013 17:08:20

Today we will demonstrate how to setup SSL on Tomcat 7 with and without Apache2 in Debian servers using self-signed certificates. This should work with Debian Squeeze and Wheezy servers.  We assume you already have existing Apache 2 and Tomcat 7 installations.


Continue reading

Install Tomcat 7 as your primary Webserver in CentOS 6.3

Posted Thursday January 17, 2013 00:51:42

This guide demonstrates how to install Tomcat 7 in CentOS 6.3 as your primary Webserver.   This uses Tomcat mod_jk connector for httpd and Tomcat 7 communications.   This enables accesses to Tomcat application through port 80, and not having to explicitly enter the Tomcat port.   We build mod_jk connector from the source.

It is the assumption that you already have a running CentOS 6.3 system.  You should also be logged to your system as root or a user with root privileges to use this procedure.


Continue reading

Run Windows and Linux simultaneously in a single computer, share files between using Samba and vboxsf

Posted Sunday December 16, 2012 20:46:19

In this demo,  we will setup Windows 7 to host a Debian server as guest operating system using VirtualBox 4.2.4,  the latest version as of blog time.   This virtualization setup may be useful for learning Linux without having to have a separate PC.   The setup may also be useful for testing Linux application before they are deployed to a live server.

We use Samba to move files between operating systems as well as demonstrate how to share files using VirtualBox's "Shared Folders", the vboxsf filesystem.


Continue reading

How to install and use Apache Tomcat Native in Debian Squeeze

Posted Monday October 08, 2012 22:13:49

The Apache Tomcat Native or tc-native is composed of JNI native wrappers to Apache Portable Runtime (APR).   According to the tc- native documentation, it provides performance benifits especially if Web Applications are using SSL or serve large amount of static data.

Tc-native do not have binary distribution for Debian or Linux for that matter.   You build from the sources that come with each Tomcat release.   It can be found as tarball ${CATALINA_HOME}/bin/tomcat-native.tar.gz.   Tc-native is also available as a separate download from the Tomcat Native website in the link that follows.   This is also the latest version.

http://tomcat.apache.org/download-native.cgi

Whichever copy you use,  you need the following components installed in your system to build tc-native.


Continue reading

Custom error pages for Tomcat JSF applications

Posted Sunday March 11, 2012 23:02:02

In this blog we will demonstrate how and where to catch Tomcat application page access errors and display custom error pages to users.


Continue reading

Install and configure Apache2 QOS module in Debian Squeeze

Posted Friday March 09, 2012 04:26:59

QOS stands for quality of service. It is an Open Source Apache2 module that is able to protect your server from various kinds of malicious access or attacks. A detailed list of what QOS can do to protect your server can be found in their website.

In this blog, we will demonstrate how to configure Apache2 with mod_qos, limit the number of connection per IP address, disallow slow connections that might be blocking the server, limit number of active TCP connections to keep server from running out of resources, and limit bandwidth and number of connections to some locations.


Continue reading

How to automatically restart Apache Tomcat when it dies in Debian server

Posted Wednesday January 04, 2012 15:09:41

This short blog is about monitoring and restarting Tomcat through crontab if and when it silently dies for whatever cause. The process described here works and was tested in our Tomcat 7 installation in Debian Squeeze servers.


Continue reading

Using Expect script to automate SSH logins and do routine tasks accross multiple hosts

Posted Sunday October 23, 2011 13:38:24

If you maintain several Linux hosts sometimes it is easier if you can automate logins and do routine tasks unattended. In this blog we will show you how to accomplish this using Expect scripts.


Continue reading

How to setup FLV streaming with crtmpserver C++ RTMP server

Posted Saturday October 08, 2011 17:42:44

crtmpserver is a high performance real time media streaming server able to stream recorded or live media. Today we will demonstrate how to build and use crtmpserver to stream FLV and other audio and video formats (see table near the end of page) in Debian 6 server. We intend not to modify the source, so there is no C++ programming involved.


Continue reading

Speed up your website using Apache2 mod_deflate for your virtual host

Posted Sunday September 04, 2011 20:33:29

I want to share my experience in my efforts to improve the performance of my website using mod_deflate. mod_deflate compresses content before sending them back to the browser which reduces considerable amount of traffic time. Compressed content is supported by most newer browsers. For older browser we have included directives not to compress content.


Continue reading