[Deploying Sakai] how to deploy Sakai on virtual domain?

Leon Kolchinsky lkolchin at gmail.com
Thu Jan 7 23:23:14 PST 2010


Hello All,

I've installed "Apache mod_jk and tomcat with multiple virtual hosts"
Used primarily those 2 manuals
http://www.alwayssunny.com/blog/?p=174
http://www.howtoforge.com/apache2_tomcat5_mod_jk_p2

and a lot of reading through apache docs.

The virt. domains working and java requests processed by tomcat.

I cant find any document on deploying Sakai in similar environment :(

When I extract sakai-bin-2.6.1.tgz into /srv/myserver029 and restart tomcat
and apache I'm getting -

"HTTP Status 404 - /

type Status report

message /

description The requested resource (/) is not available.
Apache Tomcat/5.5.26
"
Which probably means that the app. is not deployed.

Can someone tell me how to install and configure Sakai in virt. domain ?


Thanks.

Here are some of my configs realted to apache httpd+tomcat+virt domains
integration:

# cat /etc/httpd/conf/workers.properties:

#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# We define a workers named worker1 and worker2
workers.tomcat_home=/opt/tomcat/
workers.java_home=/usr/java/jdk
ps=/
worker.list=worker1,worker2
worker.worker1.type=ajp13
worker.worker1.host=myserver029.somedomain.com
worker.worker1.port=8009
worker.worker1.lbfactor=1
worker.worker2.type=ajp13
worker.worker2.host=sakai26.dyndns.org
worker.worker2.port=8009
worker.worker2.lbfactor=1

# Load-balancing behaviour
worker.loadbalancer.type=lb

# Status worker for managing load balancer
worker.status.type=status

Snap from httpd.conf:

LoadModule jk_module modules/mod_jk.so
# mod_jk config
# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/httpd/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
#JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Globally deny access to the WEB-INF directory
<LocationMatch '.*WEB-INF.*'>
AllowOverride None
deny from all
</LocationMatch>

Virt. hosts config:

<VirtualHost *:80>
ServerName myserver029.somedomain.com
ServerAdmin admin at somedomain.com

DocumentRoot /srv/myserver029

# ServerAlias www.myserver029.somedomain.com
# if not specified, the global error log is used
ErrorLog /var/log/httpd/myserver029.somedomain.com-error_log
CustomLog /var/log/httpd/myserver029.somedomain.com-access_log combined
# don't loose time with IP address lookups
HostnameLookups Off
# needed for named virtual hosts
UseCanonicalName Off

# Add index.jsp to DirectoryIndex files
DirectoryIndex index.php index.html index.htm index.shtml index.php4
index.php3 index.phtml index.cgi index.jsp

JkMount /* worker1
JkMount /*.jsp worker1

# Im doing it globally in httpd.conf so need to do this on domain basis -
deny access to the WEB-INF directory

# <LocationMatch '.*WEB-INF.*'>
# AllowOverride None
# deny from all
# </LocationMatch>
</VirtualHost>


For my second virtual host, I created the following configuration file under
/etc/httpd/conf/vhosts.d/02sakai26.dyndns.org.conf

<VirtualHost *:80>
ServerName sakai26.dyndns.org
ServerAdmin admin at somedomain.com

DocumentRoot /srv/sakai26

ServerAlias www.sakai26.dyndns.org
# if not specified, the global error log is used
ErrorLog /var/log/httpd/sakai26.dyndns.org-error_log
CustomLog /var/log/httpd/sakai26.dyndns.org-access_log combined
# don't loose time with IP address lookups
HostnameLookups Off
# needed for named virtual hosts
UseCanonicalName Off

# Add index.jsp to DirectoryIndex files
DirectoryIndex index.php index.html index.htm index.shtml index.php4
index.php3 index.phtml index.cgi index.jsp

JkMount /* worker2
JkMount /*.jsp worker2

# Im doing it globally in httpd.conf so need to do this on domain basis -
deny access to the WEB-INF directory

# <LocationMatch '.*WEB-INF.*'>
# AllowOverride None
# deny from all
# </LocationMatch>
</VirtualHost>



Configuration of mod_jk listener in tomcat

In order for tomcat to listen for the workers you defined you need to add a
line like this to the engine element on your tomcat server.xml file.
# vi /opt/tomcat/conf/server.xml
Inside <Engine name="Catalina" defaultHost="localhost">
Just before the </Engine> tag:

<Listener className="org.apache.jk.config.ApacheConfig"
modJk="/usr/lib64/httpd/modules/mod_jk.so"
workersConfig="/etc/httpd/conf/workers.properties"/>

Don’t forget to modify the paths for your system.


In /opt/tomcat/conf/server.xml

For each domain you now need to create a new tomcat host. The name of each
host should correspond with the host you defined in each of your workers.

I copied the host element from the default host. Here are my host elements.
More info on host elements can be found here.

Taken from here: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
first option: In the
$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the
Context element information will be loaded by all webapps of that host.

second option:
I did it like this - inside a Host element in the main conf/server.xml (I
think the first is better)

........</Host>
<Listener className="org.apache.jk.config.ApacheConfig"
modJk="/usr/lib64/httpd/modules/mod_jk.so"
workersConfig="/etc/httpd/conf/workers.properties"/>

<Host name="myserver029.somedomain.com"
appBase="/srv/myserver029"
unpackWARs="true"
autoDeploy="true"
xmlValidation="false"
xmlNamespaceAware="false">
<Context path="" docBase="" debug="1"/>
</Host>

<Host name="sakai26.dyndns.org"
appBase="/srv/sakai26"
unpackWARs="true"
autoDeploy="true"
xmlValidation="false"
xmlNamespaceAware="false">
<Context path="" docBase="" debug="1"/>
</Host>

</Engine>

</Service>

</Server>

Unleashing the Beast; Starting Apache & Tomcat

Now test to make sure the Apache configuration is correct and that it can
successfully start up with the JK Connector configuration:
#/etc/init.d/httpd configtest

Restarting servers
/etc/init.d/apache2 start
/etc/init.d/tomcat5 start

Testing

copy one the following dir to apropriate doamins:

cp -R /opt/tomcat/webapps/jsp-examples /srv/myserver029/
cp -R /opt/tomcat/webapps/servlets-examples /srv/sakai26/

Create index.jsp in /srv/myserver029/:
# cat index.jsp
<html>
<head>
<title>My big ole bad page!</title>
</head>
<body>
Hello Vear029! The time is now <%= new java.util.Date() %>
</body>
</html>

and index.html in sakai26:
# cat ../sakai26/index.html
<html>
<head>
<title>My big ole bad page!</title>
</head>
<body>
Hello Sakai26!
</body>
</html>


All working including jsp-examples!!!!

How can I install Sakai to /srv/myserver029 directory???
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/production/attachments/20100108/1155b920/attachment-0001.html 


More information about the production mailing list