Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

May 25, 2010

at Tuesday, May 25, 2010 Labels: Posted by Billy 1 comments

I recently updated to Ubuntu Lucid and immediately noticed UI performance degradation after using it for a short while. The sluggish performance affected window switching and scrolling in Firefox/Chrome/Evince etc. Nothing on my system indicated a memory leak or chewed-up processor.

I searched Ubuntu's bug tracking system and came across this post, which indicated the using the latest kernel version fix the problem. After following the steps here to update my kernel, my system runs as fast as ever. Hopefully other users experience my situation will stumble across this post and find it helpful.

February 19, 2009

If you have a pre 1.0.0 version of Hunchentoot installed on your system, you'll be happy to know that upgrading is fairly easy. But be warned! Hunchentoot 1.0 is incompatible with code written for older versions!

Using asdf-upgrade is the easiest way to upgrade. First launch SBCL with root priveliges:

sudo sbcl


If you do not have asdf-upgrade, you'll need to install it:
(require 'asdf-install)
(asdf-install:install 'asdf-upgrade)


Choose a system wide install. Again, I usally skip gpg checks, but if you're inclined to check them this is a great site: http://www.pps.jussieu.fr/~jch/software/pgp-validating.html

Now we can use asdf-upgrade.
(require 'asdf-upgrade)


To see a list of out-dated packages run the report function:
(asdf-upgrade:report)


To upgrade Hunchentoot, as well as your other packages, run the upgrade command:
(asdf-upgrade:upgrade)


Now we can run Hunchentoot 1.0:
(require 'hunchentoot)
(hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4242))


Point your browser to http://127.0.0.1:4242 and you should see the Hunchentoot default page.

See my previous post for further configuration details of Hunchentoot. Some major differences between the current version and older versions include discontinued support for mod_lisp and a different api to start and stop the server.

January 23, 2009

This article describes how to install Tomcat 6 behind the Apache web server. This allows Apache to serve the static content and Tomcat to handle the dynamic content of your site. It assumes you have already installed Apache and that the operating system is Ubuntu 8.10 Intrepid.

First we need to install Java on our system. We can use aptitude if we set our software sources correctly. To check, open the software sources list:

sudo nano /etc/apt/sources.list

Add the following two lines:
deb http://za.archive.ubuntu.com/ubuntu/ intrepid main restricted
deb http://za.archive.ubuntu.com/ubuntu/ intrepid multiverse

Update the repository:
sudo aptitude update

Now we can install Java:
sudo aptitude install sun-java6-jre

Confirm the Java installation by entering the following:
java -version

You should see output similar to "java version 1.6.0_10"

Installing Tomcat 6


The following command installs Tomcat 6 with the admin and example applications:
sudo aptitude install tomcat6 tomcat6-admin tomcat6-examples

The admin and example applications are optional. The admin applications provides quick and easy monitoring of the Tomcat server via a browser. The example applications help new users learn Tomcat and Java servlet programming.

To test the installation, point your web browser to http://server-name:8080, replacing server-name with the name or ip-address of your server. Be sure to add port 8080 to the end of the address. If you are installing Tomcat on your local machine, use localhost as the server name. Your browser should display the tomcat welcome page.

Previous versions of Tomcat required extra steps to set the java home variable and to automatically start tomcat when booting, but with Tomcat 6 this should be taken care of for you. You can view the Tomcat startup script in /etc/init.d/tomcat6.

Running Tomcat behind Apache


For this section, I assume you already have Apache installed. To connect Apache and Tomcat we need to install mod_jk:
sudo aptitude install libapache2-mod-jk

Installing mod_jk automatically adds it to Apache's list of enabled modules. If you already have it and need to enable it, issue the command:
sudo a2enmod jk

Next we need to modify Apache's configuration files to point specified paths of your site to Tomcat. First create a workers file that contains connection properties to Tomcat.
sudo nano workers.properties

Add the following lines to the file:

#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# We define a worked named 'default'
#

workers.tomcat_home=/var/lib/tomcat6
workers.java_home=/usr/lib/jvm/java-6-sun
ps=/
worker.list=default

worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1

This creates a worker named "default" which connects to the Tomcat ajp port 8009. Now we make Apache aware of this file and tell it how to log jk information. Open apache2.conf:
sudo nano /etc/apache2/apache2.conf 

Add the following lines to the bottom of the file:

# Where to find workers.properties
JkWorkersFile /etc/apache2/workers.properties

# Where to put jk logs
JkLogFile /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


Next we tell Apache which paths of your site to let Tomcat serve. Site configuration files reside in /etc/apache2/sites-available/. If Apache serves one site you can edit the default site. Open the site configuration file and add the following between the VirtualHosts tags:

# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

# Tomcat serves everything by default
JkMount / default
JkMount /* default

# Apache serves the following URLs
JkUnMount /static default
JkUnMount /static/* default
JkUnMount /photos default
JkUnMount /photos/* default

Notice the JKMount and JKUnMount lines. These settings enable Tomcat to serve all paths by default, and Apache to handle the /static and /photos paths. Adjust accordingly to your site. Next restart Apache so the changes take effect:
sudo /etc/init.d/apache2 restart

Point your web browser to you site, leaving off the trailing port number. You should see the Tomcat welcome page. Congratulations! You now have a Tomcat server running behind Apache!

January 18, 2009

at Sunday, January 18, 2009 Labels: Posted by Billy 0 comments

While setting up my new Ubuntu server, I discovered a great set of articles about server configuration thanks to Slicehost. The articles outline typical installations of apache, php, mysql and more.

http://articles.slicehost.com/

December 7, 2008

at Sunday, December 07, 2008 Labels: Posted by Billy 0 comments

Abstract: When in System > Preferences > Screen Resolution, if you change the refresh rate and you monitor goes blank, reboot into the terminal, then from your home directory remove the file .config/monitors.xml



This week I was playing around with different desktop wallpapers for Ubuntu and wandered off into the screen resolution settings for gnome. Now, it has been a while since I configured my current monitor, so when I saw I had options for a faster refresh rate I just had to modify it, even though I should have known my monitor didn't support higher rates. I increased the refresh rate and my monitor immediately went blank, then displayed the message "Mode not supported". I patiently waited a couple minutes to see if Ubuntu would automatically revert the settings, but nothing happened. I rebooted the system.

I figured I would have to manually edit the xorg.conf file, something I've done before and have no problem doing. But to my surprise the login splash screen displayed. I logged in and the screen went blank with the same message blinking.

Evidently it must be some gnome user configuration rather than an xorg.conf problem since it happens only after logging in. From another computer I googled for answers, but none seemed to address my particular problem; most dealt with xorg configurations. Then I found a post stating gnome stores settings files in a series of .gnome directories, and removing these files would change my desktop setting back to default.

After booting into a terminal, I searched the files in those directories but none seemed to deal with monitor configurations. Desperate, I deleted them all. I went to log in again but the screen turned blank once again.

To solve this problem, I knew I had to find the configuration file that gnome modifies when configuring the monitor. I created a new user and logged in and opened Monitor Resolutions window. I changed the resolution this time, and saved the settings.

To find files that were recently modified, from your home directory type the command ls -atu | less, which list all files and directories and sorts by time last modified. If you were following my steps, you should notice that the .config directory was modified. Issuing the command again in that directory reveals that a file called monitors.xml was recently modified. Here lies the problem.

The monitors.xml file contains the monitor settings for each user, including screen refresh rate. I simply deleted this file, and everything returned to normal. All this hassle could have easily been resolved if the monitor settings revert back to the previous settings if the user doesn't confirm the changes within a few seconds time. Despite all the trouble, Ubuntu is still my favorite operating system.