Created
July 28, 2012 19:40
-
-
Save jankeesvw/3194524 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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