Entries tagged [debian]

PageSpeed with HTTPS, Apache and Tomcat

Feb 21, 2016


PageSpeed is a tool by Google which rewrites/optimizes resources served by your web server so that your site loads faster. I think it was designed to work with sites that largely serve static content. Most PHP based sites are like that. For example, Wordpress installations can directly reside in the DocumentRoot of Apache. That makes it straightforward to configure PageSpeed. But if you are using a Java web application fronted by Apache, the PageSpeed documentation doesn't help you much.

PageSpeed configuration for dynamic content

If your web application serves content using a URL which does not map to a physical location in your DocumentRoot, PageSpeed will not be able to find it. For example, this blog runs on Apache Roller which serves static files using a logical path and not a physical path. If relative to your web application's root, the CSS files are present in this phsyical location:

roller/themes/alaru/css/

And the CSS files are served with this logical URL:

https://satishchilukuri.com/blog/resource/css/

PageSpeed will try to look for this physical location relative to DocumentRoot:

blog/resource/css

Read more...

Installing Java 8 and Tomcat 8 on Debian Wheezy

Feb 01, 2015


Installing Java 8

By default, Debian repositories only have Open JDK and on Wheezy, the Open JDK version is the equivalent of Java 7. To get the latest Java 8, we need to install it manually. First download the Java 8 server JRE which comes with JVM monitoring tools. Or you could just download the Java 8 JDK which includes those monitoring tools and more. I prefer to install only the bare minimum setup that is necessary.

When manually installing software on Linux, it is recommended that it go into /opt directory. So unpack the JRE or JDK into /opt.

Create a symbolic link "java8" pointing to the JRE/JDK directory. This will make it easier when installing updates to the JRE/JDK. All Java dependent applications will refer to the symbolic link and when you do update the JRE/JDK, you don’t need to update the path to Java for all those applications. You just need to update the symbolic link.

cd /opt
sudo ln -s jdk1.8.0_25 java8

Add the Java bin directory to your PATH so that the Java commands are available to you. Edit your .profile file

vi ~/.profile

Read more...