vicker313 tech blog

August 29, 2010

Enable Telnet and SSH at HPUX

Filed under: HPUX — Tags: , , — vicker313 @ 8:18 am

Aside from access through console port, HPUX like other Unix or Linux, can be accessed through Telnet or SSH. If some how you cannot access your HPUX through these 2 methods, it may be either the service is not started or the firewall of the machine blocking your way. Solutions below are tried at HPUX 11.3.

To start the Telnet Service:

  1. Edit /etc/inetd.conf, search for keyword “telnet”
  2. If you see the line is commented (hash in front), uncomment it by removing the hash sign
  3. Issue command “inetd -c” to reconfigure, now the telnet service should be up.

However if you still unable to access through Telnet, try to disable the firewall by issuing this command:

ipfilter -d

In my case, after doing these 2 solutions, I able to access through either telnet or ssh.

August 27, 2010

Enable GZIP Compression in Tomcat

Filed under: Tomcat — Tags: , — vicker313 @ 7:31 am

Tomcat Service has this feature to compress the web pages before being downloaded by surfer, no special plug in or add on at both server or client (browser) side. To activate this feature:

  1. Edit the conf/server.xml configuration file
  2. Look for the connector tag
  3. Add the following attributes:
    • compression=”on”
    • compressionMinSize=”2048″
    • noCompressionUserAgents=”gozilla, traviata”
    • compressableMimeType=”text/html,text/xml”
  4. The end result will be something like this (bold is the added attributes): <Connector port=”8080″ maxHttpHeaderSize=”8192″
    maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
    enableLookups=”false” redirectPort=”8443″ acceptCount=”100″
    connectionTimeout=”20000″ disableUploadTimeout=”true”
    compression=”on”
    compressionMinSize=”2048″
    noCompressionUserAgents=”gozilla, traviata”
    compressableMimeType=”text/html,text/xml”
    />

(Source from http://viralpatel.net/blogs/2008/11/enable-gzip-compression-in-tomcat.html)

In order to know the edit works or not, use the following  link to test the website or webpage:

In chrome browser you can check the compress status by clicking the icon at the left side of address bar (where the https sign showed)

Update 110813: in order to include more file types into the compression, fill in more MIME Type, for example:

<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/json,text/javascript,text/css,text/plain,
application/javascript,application/xml,application/xml+xhtml"/>

August 12, 2010

Increase or Make Unlimited Maximum Post Size in Tomcat

Filed under: Tomcat — Tags: , , — vicker313 @ 7:58 pm

Tomcat by default has limited the amount of data (2 MB) that you can submit to Tomcat Service through Form Post Method. In other word, exception will occur if you upload something more than 2 MB. To increase the maximum post size or make it unlimited, you only need to:

  1. Edit the server.xml file in conf folder
  2. Look for the line (or similar):
    <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
  3. Add this attribute: maxPostSize=”o”. Set the value 0 (zero) make it unlimited, or any size like “4MB”. Now it is look like this:
    <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" maxPostSize="0"/>
  4. Restart Tomcat Service and done

Create a free website or blog at WordPress.com.