Вы находитесь на странице: 1из 3

how to install tomcat apache in solaris 10

SUNDAY, 21. JUNE 2009, 07:06:42

1- remove jdk all versions


If you have previously installed the Solaris packages for Java 2 SDK 1.3.0, 1.3.1, 1.4.0, or 1.4.1,
remove them by running:

# pkgrm SUNWj3dmo SUNWj3man SUNWj3dev SUNWj3rt

To uninstall the Solaris packages for JDK 5.0, remove them by running:

On all processors:
# pkgrm SUNWj5rt SUNWj5dev SUNWj5cfg SUNWj5man SUNWj5dmo

get the jdk 5.(update version). from www.sun.com

# pkgadd -d /path/to/directoryOfPackages

or u can use jdk.sh and it will generate directory contain jdk files installation
useradd --> tomcat and edit .profile and set these parameters
export JAVA_HOME=
export CATALINA_HOME

use 2 hd mirror zfs and mount in /usr/local/tomcat

and get tomcat.tar.zip and cp all files to /usr/local/tomcat

run bin/startup.sh

to stop bin/shutdown.sh

ps -ef | grep java

run http//localhost:8080/hello.jsp

date.jsp

cp file in $CATALINA_HOME/webapps/ROOT

and put any app in $CATALINA_HOME/webapps/.....

and configure manger to access by user

vi $CATALINA_HOME/server/webapps/manager/WEB-INF/web.xml

search about auth section and add the role name


<auth-constraint>
^M
<role-name>manager</role-name>
<role-name>to_pass</role-name>
</auth-constraint>

to add user and set to_pass authentication

vi $CATALINA_HOME/conf/tomcat-users.xml
<user username="tomcat" password="tomcat" roles="tomcat,pass_to"/>

to change port no 80808 to another


vi $CATALINA_HOME/conf/server.xml

to configure log
vi log4j.properties in $CATALINA_HOME/common/classes/log4j.properties

log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/tomcat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

cp /Desktop/log4j-1.2.15.jar /usr/local/tomcat/common/lib/
cp /Desktop/commons-logging-1.1.1.jar /usr/local/tomcat/common/lib/

startup tomcat and then it will create file tomcat.log

test web application extract it Red5War_0.7.0.zip and cp all files in


$CATALINA_HOME/webapps

groupadd tomcat
usermod -g tomcat tomcat
chown -R tomcat:tomcat /usr/local/tomcat

java options

About heap size - it's generally a good idea to set the JVM's max heap size to at least 512, and
no matter what the max is, the initial heap size should be set to the same value.

The reason to set them the same is heap fragmentation.

That's a description of the heap, but what about this other setting set with -XX:MaxPermSize?
Turns out this sets the size for something called the "Permanent Generation". A good definition
for the Permanent Generation is found in the Sun article Frequently Asked Questions about
Garbage Collection in the HotspotTM JavaTM Virtual Machine:

The permanent generation is used to hold reflective of the VM itself such as class objects and
method objects. These reflective objects are allocated directly into the permanent generation,
and it is sized independently from the other generations. Generally, sizing of this generation
can be ignored because the default size is adequate. However, programs that load many
classes may need a larger permanent generation.

So the permanent generation contains information about the objects in the heap. Ah-ha! Now
we can start to understand how these two numbers are related to each other. The heap stores
the objects, and the permanent generation keeps track of information about the objects.
Consequently, the more objects there are in the heap, the more information there is to be
tracked about them, and the larger the permanent generation needs to be.

install apache

PREFIX is not specified, it defaults to /usr/local/apache2.

gzip -dc /Desktop/httpd-2.2.9.tar.gz | tar -xf -

cd httpd-2.2.9/
# Build and install apr
cd srclib/apr
./configure --prefix=/usr/local/apr-httpd/
make
make install

# Build and install apr-util


cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install

# Configure httpd
cd ../../
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/

to know the version of apache


# /usr/local/apache2/bin/httpd -v
# /usr/local/apache2/bin/apachectl -v

authentication

# /usr/local/apache2/bin/htpasswd -c /usr/local/apache2/passwd tomcat

Вам также может понравиться