Sha256: 1701b07ba5eefa5a5accc91579bcafec4c8510bbb4f3d872b8b8791fa86df03b
Contents?: true
Size: 1.27 KB
Versions: 11
Compression:
Stored size: 1.27 KB
Contents
#!/usr/bin/env ruby require 'pathname' require 'socket' fqdn = Socket.gethostbyname(Socket.gethostname).first port = 9292 $stdout.sync = true @root = Pathname.new(File.dirname(__FILE__)).parent.expand_path action = ARGV[0] case action when "start" require 'rubygems' require 'rack' puts ' _ ___' puts '| | / (_)________ _____ ____' puts '| | / / / ___/ __ `/ __ `/ _ \\' puts '| |/ / (__ ) /_/ / /_/ / __/' puts '|___/_/____/\__,_/\__, /\___/' puts ' /____/' puts puts "will be running at http://#{fqdn}:#{port}/" puts require @root.join('lib/visage-app') puts "Looking for RRDs in #{Visage::Config.rrddir}" puts config = @root.join('lib/visage-app/config.ru').to_s server = Rack::Server.new(:config => config, :Port => port, :server => "webrick") server.start when "genapache" require 'socket' fqdn = Socket.gethostbyname(Socket.gethostname).first public_dir = @root.join('lib/visage-app/public') puts <<-CONFIG <VirtualHost *> ServerName #{fqdn} ServerAdmin root@#{fqdn} DocumentRoot #{public_dir} <Directory "#{public_dir}"> Options FollowSymLinks Indexes AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> CONFIG else puts "Usage: visage <start|genapache>" end
Version data entries
11 entries across 11 versions & 1 rubygems