erichummel-sunspot 1.2.1 → 2.0.0.pre.111215
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/Gemfile +2 -1
- data/History.txt +30 -0
- data/Rakefile +5 -9
- data/lib/sunspot.rb +13 -3
- data/lib/sunspot/batcher.rb +62 -0
- data/lib/sunspot/class_set.rb +23 -0
- data/lib/sunspot/configuration.rb +7 -0
- data/lib/sunspot/dsl.rb +1 -1
- data/lib/sunspot/dsl/field_group.rb +57 -0
- data/lib/sunspot/dsl/field_query.rb +48 -0
- data/lib/sunspot/dsl/function.rb +13 -0
- data/lib/sunspot/dsl/paginatable.rb +5 -1
- data/lib/sunspot/dsl/restriction_with_near.rb +39 -0
- data/lib/sunspot/dsl/scope.rb +4 -4
- data/lib/sunspot/dsl/search.rb +2 -2
- data/lib/sunspot/dsl/standard_query.rb +2 -0
- data/lib/sunspot/indexer.rb +12 -7
- data/lib/sunspot/query.rb +3 -3
- data/lib/sunspot/query/bbox.rb +15 -0
- data/lib/sunspot/query/common_query.rb +13 -2
- data/lib/sunspot/query/dismax.rb +5 -1
- data/lib/sunspot/query/field_group.rb +36 -0
- data/lib/sunspot/query/geofilt.rb +16 -0
- data/lib/sunspot/query/highlighting.rb +8 -1
- data/lib/sunspot/query/pagination.rb +8 -4
- data/lib/sunspot/query/sort.rb +14 -0
- data/lib/sunspot/query/sort_composite.rb +3 -2
- data/lib/sunspot/search.rb +1 -1
- data/lib/sunspot/search/abstract_search.rb +53 -65
- data/lib/sunspot/search/field_group.rb +32 -0
- data/lib/sunspot/search/group.rb +50 -0
- data/lib/sunspot/search/hit.rb +21 -7
- data/lib/sunspot/search/hit_enumerable.rb +72 -0
- data/lib/sunspot/search/paginated_collection.rb +5 -3
- data/lib/sunspot/session.rb +3 -1
- data/lib/sunspot/type.rb +21 -0
- data/lib/sunspot/util.rb +9 -0
- data/lib/sunspot/version.rb +1 -1
- data/spec/api/batcher_spec.rb +112 -0
- data/spec/api/class_set_spec.rb +24 -0
- data/spec/api/hit_enumerable_spec.rb +47 -0
- data/spec/api/indexer/batch_spec.rb +29 -3
- data/spec/api/query/function_spec.rb +9 -0
- data/spec/api/query/group_spec.rb +32 -0
- data/spec/api/query/highlighting_examples.rb +22 -0
- data/spec/api/query/ordering_pagination_examples.rb +21 -0
- data/spec/api/query/spatial_examples.rb +27 -0
- data/spec/api/query/standard_spec.rb +1 -0
- data/spec/api/search/hits_spec.rb +11 -0
- data/spec/api/search/paginated_collection_spec.rb +10 -0
- data/spec/api/search/results_spec.rb +6 -0
- data/spec/api/session_proxy/thread_local_session_proxy_spec.rb +0 -11
- data/spec/api/session_spec.rb +12 -0
- data/spec/api/sunspot_spec.rb +11 -0
- data/spec/helpers/indexer_helper.rb +0 -12
- data/spec/helpers/integration_helper.rb +8 -0
- data/spec/helpers/mock_session_helper.rb +13 -0
- data/spec/helpers/query_helper.rb +0 -12
- data/spec/helpers/search_helper.rb +0 -12
- data/spec/integration/dynamic_fields_spec.rb +2 -0
- data/spec/integration/faceting_spec.rb +14 -1
- data/spec/integration/field_grouping_spec.rb +66 -0
- data/spec/integration/geospatial_spec.rb +85 -0
- data/spec/integration/highlighting_spec.rb +22 -0
- data/spec/integration/indexing_spec.rb +23 -1
- data/spec/integration/keyword_search_spec.rb +1 -1
- data/spec/integration/local_search_spec.rb +1 -1
- data/spec/integration/more_like_this_spec.rb +1 -1
- data/spec/integration/scoped_search_spec.rb +1 -1
- data/spec/integration/stored_fields_spec.rb +2 -0
- data/spec/integration/test_pagination.rb +13 -2
- data/spec/integration/unicode_spec.rb +15 -0
- data/spec/mocks/connection.rb +4 -4
- data/spec/mocks/post.rb +1 -0
- data/spec/spec_helper.rb +21 -11
- data/sunspot.gemspec +42 -0
- data/tasks/rdoc.rake +2 -2
- metadata +95 -135
- data/VERSION.yml +0 -4
- data/bin/sunspot-installer +0 -19
- data/bin/sunspot-solr +0 -74
- data/installer/config/schema.yml +0 -95
- data/lib/sunspot/installer.rb +0 -31
- data/lib/sunspot/installer/library_installer.rb +0 -45
- data/lib/sunspot/installer/schema_builder.rb +0 -219
- data/lib/sunspot/installer/solrconfig_updater.rb +0 -76
- data/lib/sunspot/installer/task_helper.rb +0 -18
- data/lib/sunspot/server.rb +0 -152
- data/solr-1.3/etc/jetty.xml +0 -212
- data/solr-1.3/etc/webdefault.xml +0 -379
- data/solr-1.3/lib/jetty-6.1.3.jar +0 -0
- data/solr-1.3/lib/jetty-util-6.1.3.jar +0 -0
- data/solr-1.3/lib/jsp-2.1/ant-1.6.5.jar +0 -0
- data/solr-1.3/lib/jsp-2.1/core-3.1.1.jar +0 -0
- data/solr-1.3/lib/jsp-2.1/jsp-2.1.jar +0 -0
- data/solr-1.3/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
- data/solr-1.3/lib/servlet-api-2.5-6.1.3.jar +0 -0
- data/solr-1.3/solr/conf/elevate.xml +0 -36
- data/solr-1.3/solr/conf/protwords.txt +0 -21
- data/solr-1.3/solr/conf/schema.xml +0 -64
- data/solr-1.3/solr/conf/solrconfig.xml +0 -725
- data/solr-1.3/solr/conf/stopwords.txt +0 -57
- data/solr-1.3/solr/conf/synonyms.txt +0 -31
- data/solr-1.3/solr/lib/geoapi-nogenerics-2.1-M2.jar +0 -0
- data/solr-1.3/solr/lib/gt2-referencing-2.3.1.jar +0 -0
- data/solr-1.3/solr/lib/jsr108-0.01.jar +0 -0
- data/solr-1.3/solr/lib/locallucene.jar +0 -0
- data/solr-1.3/solr/lib/localsolr.jar +0 -0
- data/solr-1.3/start.jar +0 -0
- data/solr-1.3/webapps/solr.war +0 -0
- data/solr/README.txt +0 -42
- data/solr/etc/jetty.xml +0 -218
- data/solr/etc/webdefault.xml +0 -379
- data/solr/lib/jetty-6.1.3.jar +0 -0
- data/solr/lib/jetty-util-6.1.3.jar +0 -0
- data/solr/lib/jsp-2.1/ant-1.6.5.jar +0 -0
- data/solr/lib/jsp-2.1/core-3.1.1.jar +0 -0
- data/solr/lib/jsp-2.1/jsp-2.1.jar +0 -0
- data/solr/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
- data/solr/lib/servlet-api-2.5-6.1.3.jar +0 -0
- data/solr/solr/.gitignore +0 -1
- data/solr/solr/README.txt +0 -54
- data/solr/solr/conf/admin-extra.html +0 -31
- data/solr/solr/conf/elevate.xml +0 -36
- data/solr/solr/conf/mapping-ISOLatin1Accent.txt +0 -246
- data/solr/solr/conf/protwords.txt +0 -21
- data/solr/solr/conf/schema.xml +0 -238
- data/solr/solr/conf/scripts.conf +0 -24
- data/solr/solr/conf/solrconfig.xml +0 -934
- data/solr/solr/conf/spellings.txt +0 -2
- data/solr/solr/conf/stopwords.txt +0 -58
- data/solr/solr/conf/synonyms.txt +0 -31
- data/solr/solr/conf/xslt/example.xsl +0 -132
- data/solr/solr/conf/xslt/example_atom.xsl +0 -67
- data/solr/solr/conf/xslt/example_rss.xsl +0 -66
- data/solr/solr/conf/xslt/luke.xsl +0 -337
- data/solr/start.jar +0 -0
- data/solr/webapps/solr.war +0 -0
- data/spec/api/server_spec.rb +0 -91
- data/spec/integration/spec_helper.rb +0 -7
@@ -1,76 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'nokogiri'
|
4
|
-
|
5
|
-
module Sunspot
|
6
|
-
class Installer
|
7
|
-
class SolrconfigUpdater
|
8
|
-
include TaskHelper
|
9
|
-
|
10
|
-
CONFIG_FILES = %w(solrconfig.xml elevate.xml spellings.txt stopwords.txt synonyms.txt)
|
11
|
-
|
12
|
-
class <<self
|
13
|
-
def execute(solrconfig_path, options = {})
|
14
|
-
new(solrconfig_path, options).execute
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize(solrconfig_path, options)
|
19
|
-
@force = !!options[:force]
|
20
|
-
unless @force || File.exist?(solrconfig_path)
|
21
|
-
abort("#{File.expand_path(@solrconfig_path)} doesn't exist." +
|
22
|
-
" Are you sure you're pointing to a SOLR_HOME?")
|
23
|
-
end
|
24
|
-
@solrconfig_path = solrconfig_path
|
25
|
-
@verbose = !!options[:verbose]
|
26
|
-
end
|
27
|
-
|
28
|
-
def execute
|
29
|
-
if @force
|
30
|
-
config_dir = File.dirname(@solrconfig_path)
|
31
|
-
FileUtils.mkdir_p(config_dir)
|
32
|
-
CONFIG_FILES.each do |file|
|
33
|
-
source_path =
|
34
|
-
File.join(File.dirname(__FILE__), '..', '..', '..', 'solr', 'solr', 'conf', file)
|
35
|
-
FileUtils.cp(source_path, config_dir)
|
36
|
-
say("Copied default #{file} to #{config_dir}")
|
37
|
-
end
|
38
|
-
else
|
39
|
-
@document = File.open(@solrconfig_path) do |f|
|
40
|
-
Nokogiri::XML(
|
41
|
-
f, nil, nil,
|
42
|
-
Nokogiri::XML::ParseOptions::DEFAULT_XML |
|
43
|
-
Nokogiri::XML::ParseOptions::NOBLANKS
|
44
|
-
)
|
45
|
-
end
|
46
|
-
@root = @document.root
|
47
|
-
maybe_add_more_like_this_handler
|
48
|
-
original_path = "#{@solrconfig_path}.orig"
|
49
|
-
FileUtils.cp(@solrconfig_path, original_path)
|
50
|
-
say("Saved backup of original to #{original_path}")
|
51
|
-
File.open(@solrconfig_path, 'w') do |file|
|
52
|
-
@document.write_to(
|
53
|
-
file,
|
54
|
-
:indent => 2
|
55
|
-
)
|
56
|
-
end
|
57
|
-
say("Wrote solrconfig to #{@solrconfig_path}")
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
private
|
62
|
-
|
63
|
-
def maybe_add_more_like_this_handler
|
64
|
-
unless @root.xpath('requestHandler[@name="/mlt"]').first
|
65
|
-
mlt_node = add_element(
|
66
|
-
@root, 'requestHandler',
|
67
|
-
:name => '/mlt', :class => 'solr.MoreLikeThisHandler'
|
68
|
-
)
|
69
|
-
defaults_node = add_element(mlt_node, 'lst', :name => 'defaults')
|
70
|
-
add_element(defaults_node, 'str', :name => 'mlt.mintf').content = '1'
|
71
|
-
add_element(defaults_node, 'str', :name => 'mlt.mindf').content = '2'
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Sunspot
|
2
|
-
class Installer
|
3
|
-
module TaskHelper
|
4
|
-
def say(message)
|
5
|
-
if @verbose
|
6
|
-
STDOUT.puts(message)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def add_element(node, name, attributes = {})
|
11
|
-
new_node = Nokogiri::XML::Node.new(name, @document)
|
12
|
-
attributes.each_pair { |name, value| new_node[name.to_s] = value }
|
13
|
-
node << new_node
|
14
|
-
new_node
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/lib/sunspot/server.rb
DELETED
@@ -1,152 +0,0 @@
|
|
1
|
-
require 'escape'
|
2
|
-
require 'set'
|
3
|
-
require 'tempfile'
|
4
|
-
|
5
|
-
module Sunspot
|
6
|
-
class Server #:nodoc:
|
7
|
-
# Raised if #stop is called but the server is not running
|
8
|
-
ServerError = Class.new(RuntimeError)
|
9
|
-
AlreadyRunningError = Class.new(ServerError)
|
10
|
-
NotRunningError = Class.new(ServerError)
|
11
|
-
|
12
|
-
# Name of the sunspot executable (shell script)
|
13
|
-
SOLR_START_JAR = File.expand_path(
|
14
|
-
File.join(File.dirname(__FILE__), '..', '..', 'solr', 'start.jar')
|
15
|
-
)
|
16
|
-
|
17
|
-
LOG_LEVELS = Set['SEVERE', 'WARNING', 'INFO', 'CONFIG', 'FINE', 'FINER', 'FINEST']
|
18
|
-
|
19
|
-
attr_accessor :min_memory, :max_memory, :port, :solr_data_dir, :solr_home, :log_file
|
20
|
-
attr_writer :pid_dir, :pid_file, :log_level, :solr_data_dir, :solr_home, :solr_jar
|
21
|
-
|
22
|
-
#
|
23
|
-
# Start the sunspot-solr server. Bootstrap solr_home first,
|
24
|
-
# if neccessary.
|
25
|
-
#
|
26
|
-
# ==== Returns
|
27
|
-
#
|
28
|
-
# Boolean:: success
|
29
|
-
#
|
30
|
-
def start
|
31
|
-
if File.exist?(pid_path)
|
32
|
-
existing_pid = IO.read(pid_path).to_i
|
33
|
-
begin
|
34
|
-
Process.kill(0, existing_pid)
|
35
|
-
raise(AlreadyRunningError, "Server is already running with PID #{existing_pid}")
|
36
|
-
rescue Errno::ESRCH
|
37
|
-
STDERR.puts("Removing stale PID file at #{pid_path}")
|
38
|
-
FileUtils.rm(pid_path)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
fork do
|
42
|
-
pid = fork do
|
43
|
-
Process.setsid
|
44
|
-
STDIN.reopen('/dev/null')
|
45
|
-
STDOUT.reopen('/dev/null', 'a')
|
46
|
-
STDERR.reopen(STDOUT)
|
47
|
-
run
|
48
|
-
end
|
49
|
-
FileUtils.mkdir_p(pid_dir)
|
50
|
-
File.open(pid_path, 'w') do |file|
|
51
|
-
file << pid
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
#
|
57
|
-
# Run the sunspot-solr server in the foreground. Boostrap
|
58
|
-
# solr_home first, if neccessary.
|
59
|
-
#
|
60
|
-
# ==== Returns
|
61
|
-
#
|
62
|
-
# Boolean:: success
|
63
|
-
#
|
64
|
-
def run
|
65
|
-
command = ['java']
|
66
|
-
command << "-Xms#{min_memory}" if min_memory
|
67
|
-
command << "-Xmx#{max_memory}" if max_memory
|
68
|
-
command << "-Djetty.port=#{port}" if port
|
69
|
-
command << "-Dsolr.data.dir=#{solr_data_dir}" if solr_data_dir
|
70
|
-
command << "-Dsolr.solr.home=#{solr_home}" if solr_home
|
71
|
-
command << "-Djava.util.logging.config.file=#{logging_config_path}" if logging_config_path
|
72
|
-
command << '-jar' << File.basename(solr_jar)
|
73
|
-
FileUtils.cd(File.dirname(solr_jar)) do
|
74
|
-
exec(Escape.shell_command(command))
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
#
|
79
|
-
# Stop the sunspot-solr server.
|
80
|
-
#
|
81
|
-
# ==== Returns
|
82
|
-
#
|
83
|
-
# Boolean:: success
|
84
|
-
#
|
85
|
-
def stop
|
86
|
-
if File.exist?(pid_path)
|
87
|
-
pid = IO.read(pid_path).to_i
|
88
|
-
begin
|
89
|
-
Process.kill('TERM', pid)
|
90
|
-
rescue Errno::ESRCH
|
91
|
-
raise NotRunningError, "Process with PID #{pid} is no longer running"
|
92
|
-
ensure
|
93
|
-
FileUtils.rm(pid_path)
|
94
|
-
end
|
95
|
-
else
|
96
|
-
raise NotRunningError, "No PID file at #{pid_path}"
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def log_level=(level)
|
101
|
-
unless LOG_LEVELS.include?(level.to_s.upcase)
|
102
|
-
raise(ArgumentError, "#{level} is not a valid log level: Use one of #{LOG_LEVELS.to_a.join(',')}")
|
103
|
-
end
|
104
|
-
@log_level = level.to_s.upcase
|
105
|
-
end
|
106
|
-
|
107
|
-
def log_level
|
108
|
-
@log_level || 'WARNING'
|
109
|
-
end
|
110
|
-
|
111
|
-
def pid_path
|
112
|
-
File.join(pid_dir, pid_file)
|
113
|
-
end
|
114
|
-
|
115
|
-
def pid_file
|
116
|
-
@pid_file || 'sunspot-solr.pid'
|
117
|
-
end
|
118
|
-
|
119
|
-
def pid_dir
|
120
|
-
File.expand_path(@pid_dir || FileUtils.pwd)
|
121
|
-
end
|
122
|
-
|
123
|
-
def solr_data_dir
|
124
|
-
File.expand_path(@solr_data_dir || Dir.tmpdir)
|
125
|
-
end
|
126
|
-
|
127
|
-
def solr_home
|
128
|
-
File.expand_path(@solr_home || File.join(File.dirname(solr_jar), 'solr'))
|
129
|
-
end
|
130
|
-
|
131
|
-
def solr_jar
|
132
|
-
@solr_jar || SOLR_START_JAR
|
133
|
-
end
|
134
|
-
|
135
|
-
private
|
136
|
-
|
137
|
-
def logging_config_path
|
138
|
-
return @logging_config_path if defined?(@logging_config_path)
|
139
|
-
@logging_config_path =
|
140
|
-
if log_file
|
141
|
-
logging_config = Tempfile.new('logging.properties')
|
142
|
-
logging_config.puts("handlers = java.util.logging.FileHandler")
|
143
|
-
logging_config.puts("java.util.logging.FileHandler.level = #{log_level.to_s.upcase}")
|
144
|
-
logging_config.puts("java.util.logging.FileHandler.pattern = #{log_file}")
|
145
|
-
logging_config.puts("java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter")
|
146
|
-
logging_config.flush
|
147
|
-
logging_config.close
|
148
|
-
logging_config.path
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
end
|
data/solr-1.3/etc/jetty.xml
DELETED
@@ -1,212 +0,0 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
|
3
|
-
|
4
|
-
<!-- =============================================================== -->
|
5
|
-
<!-- Configure the Jetty Server -->
|
6
|
-
<!-- -->
|
7
|
-
<!-- Documentation of this file format can be found at: -->
|
8
|
-
<!-- http://docs.codehaus.org/display/JETTY/jetty.xml -->
|
9
|
-
<!-- -->
|
10
|
-
<!-- =============================================================== -->
|
11
|
-
|
12
|
-
|
13
|
-
<Configure id="Server" class="org.mortbay.jetty.Server">
|
14
|
-
|
15
|
-
<!-- Increase the maximum POST size to 1 MB to be able to handle large shard requests -->
|
16
|
-
<Call class="java.lang.System" name="setProperty">
|
17
|
-
<Arg>org.mortbay.jetty.Request.maxFormContentSize</Arg>
|
18
|
-
<Arg>1000000</Arg>
|
19
|
-
</Call>
|
20
|
-
|
21
|
-
<!-- =========================================================== -->
|
22
|
-
<!-- Server Thread Pool -->
|
23
|
-
<!-- =========================================================== -->
|
24
|
-
<Set name="ThreadPool">
|
25
|
-
<!-- Default bounded blocking threadpool
|
26
|
-
-->
|
27
|
-
<New class="org.mortbay.thread.BoundedThreadPool">
|
28
|
-
<Set name="minThreads">10</Set>
|
29
|
-
<Set name="lowThreads">50</Set>
|
30
|
-
<Set name="maxThreads">10000</Set>
|
31
|
-
</New>
|
32
|
-
|
33
|
-
<!-- Optional Java 5 bounded threadpool with job queue
|
34
|
-
<New class="org.mortbay.thread.concurrent.ThreadPool">
|
35
|
-
<Arg type="int">0</Arg>
|
36
|
-
<Set name="corePoolSize">10</Set>
|
37
|
-
<Set name="maximumPoolSize">250</Set>
|
38
|
-
</New>
|
39
|
-
-->
|
40
|
-
</Set>
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
<!-- =========================================================== -->
|
45
|
-
<!-- Set connectors -->
|
46
|
-
<!-- =========================================================== -->
|
47
|
-
<!-- One of each type! -->
|
48
|
-
<!-- =========================================================== -->
|
49
|
-
|
50
|
-
<!-- Use this connector for many frequently idle connections
|
51
|
-
and for threadless continuations.
|
52
|
-
<Call name="addConnector">
|
53
|
-
<Arg>
|
54
|
-
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
|
55
|
-
<Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
|
56
|
-
<Set name="maxIdleTime">30000</Set>
|
57
|
-
<Set name="Acceptors">2</Set>
|
58
|
-
<Set name="confidentialPort">8443</Set>
|
59
|
-
</New>
|
60
|
-
</Arg>
|
61
|
-
</Call>
|
62
|
-
-->
|
63
|
-
|
64
|
-
<!-- Use this connector if NIO is not available. -->
|
65
|
-
<!-- This connector is currently being used for Solr because the
|
66
|
-
nio.SelectChannelConnector showed poor performance under WindowsXP
|
67
|
-
from a single client with non-persistent connections (35s vs ~3min)
|
68
|
-
to complete 10,000 requests)
|
69
|
-
-->
|
70
|
-
<Call name="addConnector">
|
71
|
-
<Arg>
|
72
|
-
<New class="org.mortbay.jetty.bio.SocketConnector">
|
73
|
-
<Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
|
74
|
-
<Set name="maxIdleTime">50000</Set>
|
75
|
-
<Set name="lowResourceMaxIdleTime">1500</Set>
|
76
|
-
</New>
|
77
|
-
</Arg>
|
78
|
-
</Call>
|
79
|
-
|
80
|
-
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
81
|
-
<!-- To add a HTTPS SSL listener -->
|
82
|
-
<!-- see jetty-ssl.xml to add an ssl connector. use -->
|
83
|
-
<!-- java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml -->
|
84
|
-
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
85
|
-
|
86
|
-
<!-- =========================================================== -->
|
87
|
-
<!-- Set up global session ID manager -->
|
88
|
-
<!-- =========================================================== -->
|
89
|
-
<!--
|
90
|
-
<Set name="sessionIdManager">
|
91
|
-
<New class="org.mortbay.jetty.servlet.HashSessionIdManager">
|
92
|
-
<Set name="workerName">node1</Set>
|
93
|
-
</New>
|
94
|
-
</Set>
|
95
|
-
-->
|
96
|
-
|
97
|
-
<!-- =========================================================== -->
|
98
|
-
<!-- Set handler Collection Structure -->
|
99
|
-
<!-- =========================================================== -->
|
100
|
-
<Set name="handler">
|
101
|
-
<New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
|
102
|
-
<Set name="handlers">
|
103
|
-
<Array type="org.mortbay.jetty.Handler">
|
104
|
-
<Item>
|
105
|
-
<New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
|
106
|
-
</Item>
|
107
|
-
<Item>
|
108
|
-
<New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
|
109
|
-
</Item>
|
110
|
-
<Item>
|
111
|
-
<New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
|
112
|
-
</Item>
|
113
|
-
</Array>
|
114
|
-
</Set>
|
115
|
-
</New>
|
116
|
-
</Set>
|
117
|
-
|
118
|
-
<!-- =========================================================== -->
|
119
|
-
<!-- Configure the context deployer -->
|
120
|
-
<!-- A context deployer will deploy contexts described in -->
|
121
|
-
<!-- configuration files discovered in a directory. -->
|
122
|
-
<!-- The configuration directory can be scanned for hot -->
|
123
|
-
<!-- deployments at the configured scanInterval. -->
|
124
|
-
<!-- -->
|
125
|
-
<!-- This deployer is configured to deploy contexts configured -->
|
126
|
-
<!-- in the $JETTY_HOME/contexts directory -->
|
127
|
-
<!-- -->
|
128
|
-
<!-- =========================================================== -->
|
129
|
-
<Call name="addLifeCycle">
|
130
|
-
<Arg>
|
131
|
-
<New class="org.mortbay.jetty.deployer.ContextDeployer">
|
132
|
-
<Set name="contexts"><Ref id="Contexts"/></Set>
|
133
|
-
<Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
|
134
|
-
<Set name="scanInterval">1</Set>
|
135
|
-
</New>
|
136
|
-
</Arg>
|
137
|
-
</Call>
|
138
|
-
|
139
|
-
<!-- =========================================================== -->
|
140
|
-
<!-- Configure the webapp deployer. -->
|
141
|
-
<!-- A webapp deployer will deploy standard webapps discovered -->
|
142
|
-
<!-- in a directory at startup, without the need for additional -->
|
143
|
-
<!-- configuration files. It does not support hot deploy or -->
|
144
|
-
<!-- non standard contexts (see ContextDeployer above). -->
|
145
|
-
<!-- -->
|
146
|
-
<!-- This deployer is configured to deploy webapps from the -->
|
147
|
-
<!-- $JETTY_HOME/webapps directory -->
|
148
|
-
<!-- -->
|
149
|
-
<!-- Normally only one type of deployer need be used. -->
|
150
|
-
<!-- -->
|
151
|
-
<!-- =========================================================== -->
|
152
|
-
<Call name="addLifeCycle">
|
153
|
-
<Arg>
|
154
|
-
<New class="org.mortbay.jetty.deployer.WebAppDeployer">
|
155
|
-
<Set name="contexts"><Ref id="Contexts"/></Set>
|
156
|
-
<Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/webapps</Set>
|
157
|
-
<Set name="parentLoaderPriority">false</Set>
|
158
|
-
<Set name="extract">true</Set>
|
159
|
-
<Set name="allowDuplicates">false</Set>
|
160
|
-
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
|
161
|
-
</New>
|
162
|
-
</Arg>
|
163
|
-
</Call>
|
164
|
-
|
165
|
-
<!-- =========================================================== -->
|
166
|
-
<!-- Configure Authentication Realms -->
|
167
|
-
<!-- Realms may be configured for the entire server here, or -->
|
168
|
-
<!-- they can be configured for a specific web app in a context -->
|
169
|
-
<!-- configuration (see $(jetty.home)/contexts/test.xml for an -->
|
170
|
-
<!-- example). -->
|
171
|
-
<!-- =========================================================== -->
|
172
|
-
<Set name="UserRealms">
|
173
|
-
<Array type="org.mortbay.jetty.security.UserRealm">
|
174
|
-
<!--
|
175
|
-
<Item>
|
176
|
-
<New class="org.mortbay.jetty.security.HashUserRealm">
|
177
|
-
<Set name="name">Test Realm</Set>
|
178
|
-
<Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
|
179
|
-
</New>
|
180
|
-
</Item>
|
181
|
-
-->
|
182
|
-
</Array>
|
183
|
-
</Set>
|
184
|
-
|
185
|
-
<!-- =========================================================== -->
|
186
|
-
<!-- Configure Request Log -->
|
187
|
-
<!-- Request logs may be configured for the entire server here, -->
|
188
|
-
<!-- or they can be configured for a specific web app in a -->
|
189
|
-
<!-- contexts configuration (see $(jetty.home)/contexts/test.xml -->
|
190
|
-
<!-- for an example). -->
|
191
|
-
<!-- =========================================================== -->
|
192
|
-
<Ref id="RequestLog">
|
193
|
-
<Set name="requestLog">
|
194
|
-
<!-- New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
|
195
|
-
<Arg><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Arg>
|
196
|
-
<Set name="retainDays">90</Set>
|
197
|
-
<Set name="append">true</Set>
|
198
|
-
<Set name="extended">false</Set>
|
199
|
-
<Set name="LogTimeZone">GMT</Set>
|
200
|
-
</New -->
|
201
|
-
</Set>
|
202
|
-
</Ref>
|
203
|
-
|
204
|
-
<!-- =========================================================== -->
|
205
|
-
<!-- extra options -->
|
206
|
-
<!-- =========================================================== -->
|
207
|
-
<Set name="stopAtShutdown">true</Set>
|
208
|
-
<!-- ensure/prevent Server: header being sent to browsers -->
|
209
|
-
<Set name="sendServerVersion">true</Set>
|
210
|
-
|
211
|
-
</Configure>
|
212
|
-
|