Table of Contents

Activating the manager servlet into Fedora requires some stuff to configure.

Overview

Fedora is now providing the Fedora Service Framework which allows the developer community to enhance the capabilities of the Fedora repository with new servlets. Debugging requires frequent starting and stopping of the Tomcat container, overall in this development step. But, by default, Fedora's Tomcat bundle does not activate the manager servlet which can help developers (and administrators) (un)deploy new services WAR archives more easily. In this howto, I will show you how you can activate the manager servlet and enjoy developing new Fedora services.

Technical Details

As we can see from the Tomcat documentation, the activation of the manager servlet is linked to the tomcat-users.xml file. Checking in your Fedora server, you can see to add a "manager" role to activate the manager servlet. So that will be the first step!

_Tomcat_manager_role

Add_this_piece_of_code_to_your_tomcat-users_fedoraTemplate.xml_file:


...
<role rolename="manager" />
<user name="admin" password="admin" roles="manager"/>
...


You_can_change_the_name_and_the_password_of_the_user_allowed_access_to_the_manager_section.

At_this_point,_I_think_most_of_Fedora's_folks_tried_to_restart_Fedora_to_enjoy_the_manager_servlet..._but_some_others_things_are_needed_to_do_that.

_The_missing<i>manager.xml</i>file

A_file_is_missing_in_the_Fedora_Tomcat_bundle_that's_required_for_the_manager_servlet_to_run._The_file_is_the_manager.xml_file_which_should_be_created_under_the_folder:

$FEDORA_HOME/server/$TOMCAT_DIR/conf/Catalina/localhost/

The_<i>manager.xml</i>_contains_the_following_code:


<Context path="/manager" docBase="$

Unknown macro: {catalina.home}

/server/webapps/manager"

debug="0" privileged="true">
<ResourceLink name="users" global="UserDatabase"
type="org.apache.catalina.UserDatabase" />

</Context>


Now_we_need_to_configure_the_UserDatabase_realm_in_the_server_fedoraTemplate.xml_file.

_Configuring_the_server_fedoraTemlate.xml

At_this_point_we_need_to_insert_some_code_in_the_server_fedoraTemplate.xml_to_notify_Tomcat_about_the_resource_the_manager_required_to_run.

Add_the_following_code_before_the_<service>_tag:


<GlobalNamingResources>
<!- Used by Manager webapp ->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>


You_have_to_activate_the_UserDatabase_realm_in_the_<Engine>_section:


<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase" />


That's_all_ _! Now you have to restart your Fedora server in order to get the manager running.

Greetings

Thanks a lot to Fedora's folks asked me to submit this howto.

See Also

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels