Skip to content

Instantly share code, notes, and snippets.

@jankeesvw
Created July 28, 2012 19:40
Show Gist options
  • Save jankeesvw/3194524 to your computer and use it in GitHub Desktop.
Save jankeesvw/3194524 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require "thor"
class Apache < Thor
desc "start", "Start apache"
def start
system "sudo apachectl start"
puts "Apache started"
end
desc "restart", "restart apache"
def restart
system "sudo apachectl restart"
puts "Apache restarted"
end
desc "stop", "stop apache"
def stop
system "sudo apachectl stop"
puts "Apache stopped"
end
desc "config", "setup virutalhosts"
def config
system "mate /etc/apache2/users/jankees.conf -w"
system "mate /etc/hosts -w"
puts "Apache restarted"
end
desc "log", "show apache log"
def log
system "tail /private/var/log/apache2/error_log"
end
desc "accesslog", "show accesslog"
def accesslog
system "tail /private/var/log/apache2/access_log"
end
desc "test", "test apache config"
def test
system "sudo apachectl configtest"
end
end
Apache.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment