Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I set up an Apache2.2 and Tomcat7 Windows Server. Now I would like to use the domain for the apache and a subdomain or a subdirectory for the tomcat webapps. But I don’t know how to configure the httpd.conf.

At the moment the httpd.conf looks like:

<IfModule !mod_jk.c>
    LoadModule jk_module modules/mod_jk.so
</IfModule>

<IfModule mod_jk.c>
    JkWorkersFile conf/workers.jetty.properties
    JkLogFile logs/mod_jk.log
    JkLogLevel info
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
    JkOptions +ForwardKeySize +ForwardURICompat
</IfModule>

<VirtualHost servername:*>
    ServerName servername
    ServerAdmin administrator@servername.com
    JkMount /* jetty
</VirtualHost>

My idea was to change the VirtualHost to sub.servername:* but this doesn’t work.

How could I use a subdomain or directory for the webapps? At the moment, every call will me directed tomcat. My tomcat runs on the port 8081. Maybe edit the server.xml from tomcat?

It would be awesome, if someone could help me. Greetz.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

httpd.conf

<VirtualHost *:80>
    ServerName  domain.com
    ServerAdmin sysadmin@domain.com
    DocumentRoot /var/www/html
    ErrorLog logs/domain.error_log

    <Directory "/var/www/html">
        Options -MultiViews +FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

mod_jk.conf

LoadModule          jk_module modules/mod_jk.so

JkWorkersFile       /etc/httpd/conf/workers.jetty.properties
JkShmFile           /var/log/httpd/jk.shm

JkLogFile           /var/log/httpd/mod_jk.log
JkLogLevel          info
JkLogStampFormat    "[%a %b %d %H:%M:%S %Y] "

<VirtualHost *:80>
    ServerName      sub.domain.com
    JkMount         /* jetty
</VirtualHost>
share|improve this answer
add comment

About how to configure AJP service, you need to edit at least these files: httpd.conf of Apache HTTPd, worker.jetty.properties of mod_jk and server.xml of Apache Tomcat.

Look at worker.jetty.properties file if is it defined "jetty" worker and pointing to 8081. Also you need to define on server.xml the AJP connector (by default AJP1.3 it's pointing to port 8009)!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.