منبع اصلی نوشتار زیر در این لینک قرار دارد

Do you know how to install tomcat on Squeeze ?!

If use squeez distro , you know use tomcat in squeez is difficult and it’s need change some access points :
You must first install JDK and set environment variables . for install it please add non-free repository in APT repository configuration in /etc/apt/sources.list .

for example : “deb http://ftp.de.debian.org/debian testing main contrib non-free”

apt-get update
apt-get install sun-java6-jdk
echo ’JAVA_HOME=”/usr/lib/jvm/java-6-sun”‘ >> /etc/environment
echo ’JRE_HOME=”/usr/lib/jvm/java-6-sun/jre”‘ >> /etc/environment

Then for install tomcat please follow me :

apt-get install tomcat6 tomcat6-admin
/etc/init.d/tomcat6 stop

Now , please create blow directory then link some paths :

mkdir /opt/tomcat
cd /opt/tomcat
ln -s /etc/tomcat6/ conf
ln -s /usr/share/tomcat6/bin/ bin
ln -s /usr/share/tomcat6/lib/ lib
ln -s /var/lib/tomcat6/webapps webapps
ln -s /var/log/tomcat6/ logs

Yes , it’s installed . Now for use Manager must define admin user :

In /opt/tomcat/conf/tomcat-users.xml

<user name=”admin” password=”admin” roles=”admin,manager” />

For install virtual host :

mkdir -p /opt/tomcat/webapp1.mydomain.com/ROOT

In the <Engine> tag of “/opt/tomcat/conf/server.xml” add :

<Host name=”mydomain.com” appBase=”/opt/tomcat/webapps1.mydomain.com”>
    <Alias>www.mydomain.com>/Alias>
    <Valve className=”org.apache.catalina.valves.AccessLogValve” prefix=”mydomain_access_log.” suffix=”.txt” pattern=”common”/>
</Host>

Now for configure for port 80 xintd please follow :

netstat -pan | grep ”:80\\|:443″

echo “
service www
{
        socket_type     = stream
        protocol        = tcp
        user            = root
        wait            = no
        bind            = 79.20.130.18
        port            = 80
        redirect        = localhost 8080
        disable         = no
        flags           = REUSE
        log_type        = FILE /var/log/wwwaccess.log
        log_on_success  -= PID HOST DURATION EXIT

        per_source      = UNLIMITED
        instances       = UNLIMITED
}

service https
{
        socket_type     = stream
        protocol        = tcp
        user            = root
        wait            = no
        bind            = 79.20.130.18
        port            = 443
        redirect        = localhost 8443
        disable         = no
        flags           = REUSE
        log_type        = FILE /var/log/httpsaccess.log
        log_on_success  -= PID HOST DURATION EXIT

        per_source      = UNLIMITED
        instances       = UNLIMITED
}
“ > /etc/init.d/tomcat
/etc/init.d/xinetd restart

In /opt/tomcat/conf/server.xml modify the <Connector> as follows:

<Connector port=”8080″ protocol=”HTTP/1.1″  connectionTimeout=”20000″  redirectPort=”8443″ proxyPort=”80″ address=”127.0.0.1″ />

 




برچسب ها : ,

به سیاره لینوکس امتیاز دهید

به اين صفحه امتياز دهيد