Saturday, November 30, 2013

Insatll SquirrelMail in Ubuntu

original link:
http://www.server-world.info/en/note?os=Ubuntu_11.04&p=httpd&f=12




Install SquirrelMail to build web-based mail transfer system like yahoo mail or hotmail. SMTP/IMAP server is needed to run in your LAN.

www.server.world
- SquirrelMail Server

mail.server.world
- SMTP/IMAP Server


And add 'index.php' in "DirectoryIndex" setting.

[1] Install SquirrelMail
root@www:~#
aptitude -y install squirrelmail squirrelmail-compatibility squirrelmail-secure-login squirrelmail-decode squirrelmail-locales


root@www:~#
/etc/squirrelmail/conf.pl
# run config script

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color off
S Save data
Q Quit

Command >>
1
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Organization Preferences
1. Organization Name
: SquirrelMail

2. Organization Logo
: ../images/sm_logo.png

3. Org. Logo Width/Height
: (308/111)

4. Organization Title
: SquirrelMail

5. Signout Page
:

6. Top Frame
: _top

7. Provider link
: http://squirrelmail.org/

8. Provider name
: SquirrelMail


R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
5
 
# change log-out page



When users click the Sign Out button they will be logged out and
then sent to signout_page. If signout_page is left empty,
(hit space and then return) they will be taken, as normal,
to the default and rather sparse SquirrelMail signout page.

[]:
/webmail
   
# change log-out page

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Organization Preferences
1. Organization Name
: SquirrelMail

2. Organization Logo
: ../images/sm_logo.png

3. Org. Logo Width/Height
: (308/111)

4. Organization Title
: SquirrelMail

5. Signout Page
: /webmail

6. Top Frame
: _top

7. Provider link
: http://squirrelmail.org/

8. Provider name
: SquirrelMail


R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
r
 
# back to menu

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color off
S Save data
Q Quit

Command >>
2
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain
: trim(implode('', file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')))

2. Invert Time
: false

3. Sendmail or SMTP
: SMTP


A. Update IMAP Settings
: localhost:143 (other)

B. Change Sendmail Config
: localhost:25


R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
1
 
# change to your domain name


The domain name is the suffix at the end of all email addresses. If
for example, your email address is jdoe.com, then your domain
would be example.com.

[trim(implode('', file('/etc/'.(file_exists('/etc/mailname')?'mail':'host').'name')))]:
server.world
 
# input your domain name

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain
: server.world

2. Invert Time
: false

3. Sendmail or SMTP
: SMTP


A. Update IMAP Settings
: localhost:143 (other)

B. Change Sendmail Config
: localhost:25


R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
A
 
# select


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain
: server.world

2. Invert Time
: false

3. Sendmail or SMTP
: SMTP


IMAP Settings
--------------
4. IMAP Server
: localhost

5. IMAP Port
: 143

6. Authentication type
: login

7. Secure IMAP (TLS)
: false

8. Server software
: other

9. Delimiter
: detect


B. Update SMTP Settings
: localhost:25

H. Hide IMAP Server Settings

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
4
 
# select


This is the hostname where your IMAP server can be contacted.
[localhost]:
mail.server.world
 
# specify your IMAP server

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain
: server.world

2. Invert Time
: false

3. Sendmail or SMTP
: SMTP


IMAP Settings
--------------
4. IMAP Server
: mail.server.world

5. IMAP Port
: 143

6. Authentication type
: login

7. Secure IMAP (TLS)
: false

8. Server software
: other

9. Delimiter
: detect


B. Update SMTP Settings
: localhost:25

H. Hide IMAP Server Settings

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
8
 
# select


Each IMAP server has its own quirks. As much as we tried to stick
to standards, it doesn't help much if the IMAP server doesn't follow
the same principles. We have made some work-arounds for some of
these servers. If you would like to use them, please select your
IMAP server. If you do not wish to use these work-arounds, you can
set this to "other", and none will be used.
   bincimap
= Binc IMAP server

   courier
= Courier IMAP server

   cyrus
= Cyrus IMAP server

   dovecot
= Dovecot Secure IMAP server

   exchange
= Microsoft Exchange IMAP server

   hmailserver
= hMailServer

   macosx
= Mac OS X Mailserver

   mercury32
= Mercury/32

   uw
= University of Washington's IMAP server

   gmail
= IMAP access to Google mail (Gmail) accounts

   other
= Not one of the above servers

[other]:
dovecot
 
# select Dovecot

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain
: server.world

2. Invert Time
: false

3. Sendmail or SMTP
: SMTP


IMAP Settings
--------------
4. IMAP Server
: mail.server.world

5. IMAP Port
: 143

6. Authentication type
: login

7. Secure IMAP (TLS)
: false

8. Server software
: dovecot

9. Delimiter
: detect


B. Update SMTP Settings
: localhost:25

H. Hide IMAP Server Settings

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
B
 
# select


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain
: server.world

2. Invert Time
: false

3. Sendmail or SMTP
: SMTP


SMTP Settings
-------------
4. SMTP Server
: localhost

5. SMTP Port
: 25

6. POP before SMTP
: false

7. SMTP Authentication
: none

8. Secure SMTP (TLS)
: false

9. Header encryption key
:


A. Update IMAP Settings
: mail.server.world:143 (dovecot)

H. Hide SMTP Settings

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
4
 
# select


This is the hostname of your SMTP server.
[localhost]:
mail.server.world
 
# specify your SMTP server

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain
: server.world

2. Invert Time
: false

3. Sendmail or SMTP
: SMTP


SMTP Settings
-------------
4. SMTP Server
: mail.server.world

5. SMTP Port
: 25

6. POP before SMTP
: false

7. SMTP Authentication
: none

8. Secure SMTP (TLS)
: false

9. Header encryption key
:


A. Update IMAP Settings
: mail.server.world:143 (dovecot)

H. Hide SMTP Settings

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
7
 
# select


If you have already set the hostname and port number, I can try to
automatically detect the mechanisms your SMTP server supports.
Auto-detection is *optional* - you can safely say "n" here.

Try to detect auth mechanisms? [y/N]:
y
 
# yes

Trying to detect supported methods (SMTP)...
Testing none: SUPPORTED
Testing login: SUPPORTED
Testing CRAM-MD5: NOT SUPPORTED
Testing DIGEST-MD5: NOT SUPPORTED

What authentication mechanism do you want to use for SMTP connections?
none - Your SMTP server does not require authorization.
login - Plaintext. If you can do better, you probably should.
cram-md5 - Slightly better than plaintext.
digest-md5 - Privacy protection - better than cram-md5.

*** YOUR SMTP SERVER MUST SUPPORT THE MECHANISM YOU CHOOSE HERE ***
If you don't understand or are unsure, you probably want "none"

none, login, cram-md5, or digest-md5 [none]:
login
 
# select login

SMTP authentication uses IMAP username and password by default.

Would you like to use other login and password for all SquirrelMail
SMTP connections? [y/N]:
n

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain
: server.world

2. Invert Time
: false

3. Sendmail or SMTP
: SMTP


SMTP Settings
-------------
4. SMTP Server
: mail.server.world

5. SMTP Port
: 25

6. POP before SMTP
: false

7. SMTP Authentication
: login (with IMAP username and password)

8. Secure SMTP (TLS)
: false

9. Header encryption key
:


A. Update IMAP Settings
: mail.server.world:143 (dovecot)

H. Hide SMTP Settings

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
r
 
# back to menu

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color off
S Save data
Q Quit

Command >>
10
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language
: en_US

2. Default Charset
: iso-8859-1

3. Enable lossy encoding
: false


R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
1
 
# select


SquirrelMail attempts to set the language in many ways. If it
can not figure it out in another way, it will default to this
language. Please use the code for the desired language.

[en_US]:
ja_JP
 
# specify your language

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language
: ja_JP

2. Default Charset
: iso-8859-1

3. Enable lossy encoding
: false


R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
2
 
# select

This option controls what character set is used when sending
mail and when sending HTML to the browser.

This option is used only when default language is 'en_US'.

[iso-8859-1]:
iso-2022-jp
 
# specify your language

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language
: ja_JP

2. Default Charset
: iso-2022-jp

3. Enable lossy encoding
: false

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
r
 
# back to menu

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color off
S Save data
Q Quit

Command >>
4
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory
: /var/lib/squirrelmail/data/

2. Attachment Directory
: /var/spool/squirrelmail/attach/

3. Directory Hash Level
: 0

4. Default Left Size
: 150

5. Usernames in Lowercase
: false

6. Allow use of priority
: true

7. Hide SM attributions
: false

8. Allow use of receipts
: true

9. Allow editing of identity
: true

   Allow editing of name
: true

   Remove username from header
: false

10. Allow server thread sort
: false

11. Allow server-side sorting
: false

12. Allow server charset search
: true

13. Enable UID support
: true

14. PHP session name
: SQMSESSID

15. Location base
:

16. Only secure cookies if poss.
: true

17. Disable secure forms
: false

18. Page referal requirement
:


R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
7
 
# select

Hide SM attributions (y/n) [n]:
y
 
# Yes

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory
: /var/lib/squirrelmail/data/

2. Attachment Directory
: /var/spool/squirrelmail/attach/

3. Directory Hash Level
: 0

4. Default Left Size
: 150

5. Usernames in Lowercase
: false

6. Allow use of priority
: true

7. Hide SM attributions
: true

8. Allow use of receipts
: true

9. Allow editing of identity
: true

   Allow editing of name
: true

   Remove username from header
: false

10. Allow server thread sort
: false

11. Allow server-side sorting
: false

12. Allow server charset search
: true

13. Enable UID support
: true

14. PHP session name
: SQMSESSID

15. Location base
:

16. Only secure cookies if poss.
: true

17. Disable secure forms
: false

18. Page referal requirement
:


R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
r
 
# back to menu

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages

D. Set pre-defined settings for specific IMAP servers

C Turn color off
S Save data
Q Quit

Command >>
8
 
# select

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. secure_login
2. view_as_html

Available Plugins:
3. administrator
4. bug_report
5. calendar
6. compatibility
7. delete_move_next
8. demo
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. newmail
16. sent_subfolders
17. spamcop
18. squirrelspell
19. test
20. translate

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
7
 
# add "delete_move_next" (number is different at an env)

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. secure_login
2. view_as_html
3. delete_move_next

Available Plugins:
4. administrator
5. bug_report
6. calendar
7. compatibility
8. demo
9. filters
10. fortune
11. info
12. listcommands
13. mail_fetch
14. message_details
15. newmail
16. sent_subfolders
17. spamcop
18. squirrelspell
19. test
20. translate

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
15
 
# add "newmail" (number is different at an env)

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. secure_login
2. view_as_html
3. delete_move_next
4. newmail

Available Plugins:
5. administrator
6. bug_report
7. calendar
8. compatibility
9. demo
10. filters
11. fortune
12. info
13. listcommands
14. mail_fetch
15. message_details
16. sent_subfolders
17. spamcop
18. squirrelspell
19. test
20. translate

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
8
 
# add "compatibility" (number is different at an env)

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
Installed Plugins
1. secure_login
2. view_as_html
3. delete_move_next
4. newmail
5. compatibility

Available Plugins:
6. administrator
7. bug_report
8. calendar
9. demo
10. filters
11. fortune
12. info
13. listcommands
14. mail_fetch
15. message_details
16. sent_subfolders
17. spamcop
18. squirrelspell
19. test
20. translate

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Command >>
q
 
# quit


You have not saved your data.
Save? [Y/n]:
y
 
# save

Data saved in config.php

Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!

root@www:~#
vi /etc/apache2/conf.d/SquirrelMail.conf


# create new

Alias /webmail /usr/share/squirrelmail
<Location /webmail>
Order Deny,Allow

Deny from all

Allow from 10.0.0.0/24
# IP address you allow to access

</Location>


root@www:~#
/etc/init.d/apache2 restart

* Restarting web server apache2
... waiting ...done.

[2] Access to 'http://(your server's name or IP address/)/webmail/', then follwing sacreen is shown, then authenticate your user name and password to login.
 
[3] Just logined
 

Friday, November 29, 2013

Open source CMS software: Concrete 5

Concrete5 is an open source Content Management System written in PHP.

Official website: http://www.concrete5.org

Save and retrieve arrays of data

In a block controller, concrete5 takes care of storing and retrieving simple data items like numbers or strings automatically. But what can you do with arrays?
1 Like

Separating environment specific configurations

In some situations you might wonder how you can separate your configurations files for different environments. This might come handy e.g. in projects where you store the configs files in your version control.
2 Likes

Concrete 5 in an AWS load balanced cluster - 2

This HowTo is meant to be read as part of the AWS sequence under the same title. This article is mainly about costs -- skip and wait for the next one if you are not concerned with that
1 Like

nginx (with fastcgi_cache) + php5-fpm

Simple configuration of nginx with fastcgi_cache enabled and php5-fpm
4 Likes

Concrete 5 in an AWS load balanced cluster

This is the begining of a series of notes on what we have discovered around how to run C5 on a load balanced cluster on the Amazon Web Services AWS platform See http://aws.amazon.com for the long version
4 Likes

Integrate Concrete Wall with Magic Data using Universal Content Puller

Ever wish there was an easy way to integrate magic data with some other blocks from the front end of your site? There is!
1 Like

Style a file input field

A quirk of html is that file input fields used to select a file for uploading are annoyingly resistant to styling. However, you can get round this with a few tricks.
2 Likes

Write a Queuable Job in concrete5 5.6.2+

Learn about writing Queuable Jobs with concrete5's new queue engine
5 Likes


"We use jQuery for almost all our JavaScript needs. We use Zend libraries for complicated stuff like internationalization and caching. We use MySQL, but we use it through the ADOdb Database Abstraction Layer. Sure our in-context editing is easy, but concrete5 has a really powerful advanced permissions system, a flexible data objects model and built-in helper classes as well. We've built concrete5 to be easy to understand at a glance, but super powerful once you open the hood."

Customize 404 Page for Concrete5

key word: Concrete5, CMS
On the surface, one of the draw backs of Concrete5 (or any CMS for that matter) is that there are portions of your site that seem untouchable. Specifically in Concrete5 the 'Login' page the 'Register' page and the '404 - Page Not Found' are glaring examples of when the CMS seems to take over your design and returns pages that are based off the native dashboard theme of Concrete5 and not your own stylish layout.
In this blog what want to take you step by step on how to change your "404 - Page Not Found" page. The benefit of doing this is twofold:

1st - If, God Forbid, someone should find a broken link on your site or simply type the wrong URL the result is a page that looks like it came from your website and not some misplaced step-child that the developer forgot about.
Below is a picture of what the out-of-the-box 404 page looks like:

basic404.PNG

2nd - According to the Google SEO Manuel, having a well thought out 404 page can actually help increase your search ranking and your user's experience:

SEO404.PNG



Step 1: locate site_theme_paths.php

To change the 404 page to reflect your custom theme you will need to open the root/config/site_theme_paths.php file. Make sure you DO NOT open root/concrete/config location. In Concrete5, all customizaton should be done in the top level:

root.PNG

Step 2: edit the site_theme_paths.php

When you open the file you should see this:
  1. <?php
  2. defined('C5_EXECUTE') or die(_("Access Denied."));
  3. //possible themes: default, core, greensalad, dark_chocolate, dashboard, greek_yogurt.
  4. /*
  5. you can override system layouts here - but we're not going to by default
  6. For example: if you would like to theme your login page with the Green Salad theme,
  7. you would uncomment the lines below and change the second argument of setThemeByPath
  8. to be the handle of the the Green Salad theme "greensalad"
  9. */
  10. /*
  11. $v = View::getInstance();
  12. $v->setThemeByPath('/login', "yourtheme");
  13. // $v->setThemeByPath('/403', "yourtheme");
  14. // $v->setThemeByPath('/register', "yourtheme");
  15. */

Some examples have been given to help you but it can be kind of confusing. So you will need to 'un-comment' line 15 and then add a condition for the 404 page. You your .php file should look like this:

  1. <?php
  2. defined('C5_EXECUTE') or die(_("Access Denied."));
  3. $v = View::getInstance();
  4. $v->setThemeByPath('/page_not_found', "retro_ryno");
  5. /*
  6. you can override system layouts here - but we're not going to by default
  7. For example: if you would like to theme your login page with the Green Salad theme,
  8. you would uncomment the lines below and change the second argument of setThemeByPath
  9. to be the handle of the the Green Salad theme "greensalad"
  10. */
  11. /*
  12. $v->setThemeByPath('/login', "yourtheme");
  13.  // $v->setThemeByPath('/403', "yourtheme");
  14.  // $v->setThemeByPath('/register', "yourtheme");
  15.  // $v->setThemeByPath('/dashboard', "yourtheme");
  16. //
  17. */
NOTE:
the examples indicate that you should put your theme's 'handle' in place of 'yourtheme'. But not all themes are built the same. The handle for our custom theme is: theme_retro_ryno but when we packaged up the theme we put the files in a folder named 'retro_ryno'. What's necessary for this little trick to work is to use your theme's actual folder name which may or may not be your theme's handle. E.G. our themes path looks like this:
root/packages/theme_retro_ryno/themes/retro_ryno/ . So we used the theme's actual folder name instead of it's handle.

Your 404 - page not found is now styled according to your theme! But, it would be nice to add some features to this to help your users out. a good idea would be to add a sitemap as well as a search function. Good news is that google now offers a 404 search bar that works with your site and the url error to try and offer other solutions. And, adding a SiteMap is pretty simple:

Step 3: customize the 404 - page not found.

  1. you will first need to copy and paste the , root/concrete/single_pages/page_not_found.php' into your root/single_pages/page_not_found.php. notice we are putting this page in the top level because we want to avoid making changes to concrete5.s core.
  2. open the new page_not_found.php file that you just created in the top level single_pages folder. and make it look like this:


  1. <?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
  2. <h1 class="error"><?php echo t('Page Not Found')?></h1>
  3. <?php echo t('No page could be found at this address.')?>
  4. <?php if (is_object($c)) { ?>
  5. <br/><br/>
  6. <?php $a = new Area("Main"); $a->display($c); ?>
  7. <?php } ?>
  8. <br/><br/>
  9. <?php
  10. $bt = BlockType::getByHandle('autonav');
  11. $bt->controller->orderBy = 'display_asc';
  12. $bt->controller->displayPages = 'top';
  13. $bt->controller->displaySubPages = 'all';
  14. $bt->controller->displaySubPageLevels = 'all';
  15. $bt->render('view');
  16. ?>
  17. <br/><br/>
  18. <a href="<?php echo DIR_REL?>/"><?php echo t('Back to Home')?></a>.

You should now have a 404 page not found for your site that is nicely styled and has a hard-coded sitemap that will automatically grow as your site grows.
If you would like to take this a step further...

Step 4: add google 404 help.

this will require you to have some kind of google account. Google offers a 404 widget which can be found in your Webmaster Tools portion of your account. Check to picture below to see the instructions and what's being offered:

google 404 widget

now, the choice is yours but it would be nice to add the widget above your Sitemap. The end result is really nice. click this link to see it in action:
http://www.rynomediaonline.com/contict/
what I did was mispell 'contact'. the Google 404 Widget detects that what I really wanted was the contact page and so automatically adds 'contact' to the search bar. Below this we have our sitemap in case the user would rather see the site that way.

ryno404.PNG

 Enjoy!

Friday, November 15, 2013

Two most commonly misconfigured Tomcat performance settings


By Lukas Stewart
TheServerSide.com


One of the great things about the Tomcat application server is the fact that the software used to develop and test applications is the exact same software that gets installed and used in a full scale production environment. The packages and binaries a software developer downloads and installs on a local Ubuntu image are the same binaries and packages that get installed by the system administrator on the Linux box running in production. Unfortunately, this can also cause some problems, as the binaries downloaded from apache.org are not necessarily configured to effectively leverage the enhanced performance capabilities of server-side hardware. If a Tomcat installation is performed on a server using the default settings, simple optimizations get missed, and the production hardware will not perform at its optimal capacity.
The most commonly misconfigured settings on a production Tomcat server can be found in the attributes of the connector.
Lukas Stewart
Common misconfigurations on Tomcat
The most commonly misconfigured settings on a production Tomcat server can be found in the attributes of the connector element, which is defined in the Tomcat server's server.xml file. By default, the maxThreads attribute is set to a humble 200. This is fine for a single core machine, but can be multiplied linearly given the number of processors on the production machine. On a machine with four processors, setting this value to anything between 800 and 1000 will not cause a problem. And if the configured number ends up far exceeding the number of threads required, the thread pool will naturally scale back this number when the server load is low.
The other most often misconfigured, or for that matter, outright missing setting on a production Tomcat server has to do with compression. Any communication between the client and server that is primarily text, be it HTML, XML or simply Unicode can regularly be compressed up to 90% using a simple and standard GZIP algorithm. This can have a massive impact on reducing network traffic, allowing responses to be sent back to the client much faster, while at the same time allowing for more network bandwidth to be available for other network heavy applications.

Configuring the Tomcat server
A sample connector entry in Tomcat's server.xml file that takes advantage of these two settings would look like this:

<connector>
  port="8080"
  maxThreads="800"
  minSpareThreads="80"
  maxSpareThreads="160"
  compression="on"
  compressableMimeType="text/html,text/xml,text/plain">
</connector>


There is no doubt that the ability to use the same Tomcat binaries both on the production machine and on a developer's local desktop makes the Apache Tomcat software incredibly user friendly, but at the same time, system administrators must pay attention to the way Tomcat installations are configured on the server. By ensuring that the thread pool is properly configured based on the number of processors in the system, and that highly compressible content types are being delivered to the client in a zipped format, system administrators are ensuring that their servers are configured to deliver an optimized experience to the end user.