    # File lib/rubygems/server.rb, line 538
      def run
        @server.listen nil, @port

        say "Starting gem server on http://localhost:#{@port}/"

        WEBrick::Daemon.start if @daemon

        @server.mount_proc "/yaml", method(:yaml)
        @server.mount_proc "/yaml.Z", method(:yaml)

        @server.mount_proc "/Marshal.#{Gem.marshal_version}", method(:Marshal)
        @server.mount_proc "/Marshal.#{Gem.marshal_version}.Z", method(:Marshal)

        @server.mount_proc "/specs.#{Gem.marshal_version}", method(:specs)
        @server.mount_proc "/specs.#{Gem.marshal_version}.gz", method(:specs)

        @server.mount_proc "/latest_specs.#{Gem.marshal_version}",
                           method(:latest_specs)
        @server.mount_proc "/latest_specs.#{Gem.marshal_version}.gz",
                           method(:latest_specs)

        @server.mount_proc "/quick/", method(:quick)

        @server.mount_proc("/gem-server-rdoc-style.css") do |req, res|
          res['content-type'] = 'text/css'
          res['date'] = File.stat(@spec_dir).mtime
          res.body << RDOC_CSS
        end

        @server.mount_proc "/", method(:root)

        paths = { "/gems" => "/cache/", "/doc_root" => "/doc/" }
        paths.each do |mount_point, mount_dir|
          @server.mount(mount_point, WEBrick::HTTPServlet::FileHandler,
                        File.join(@gem_dir, mount_dir), true)
        end

        trap("INT") { @server.shutdown; exit! }
        trap("TERM") { @server.shutdown; exit! }

        @server.start
      end