RSS

Monthly Archives: October 2006

Apache's ProxyPass on Ubuntu

  1. Install apache2. On Ubuntu type:
     # apt-get install apache2
  2. Activate mod_proxy:
     # a2enmod proxy
  3. Create a new file in /etc/apache2/sites-available, named metak (or whatever):
    NameVirtualHost *
    <Virtualhost *>
      DocumentRoot "/var/www/metak"
      ServerName localhost
      ServerAdmin support@mycompany.com
      DirectoryIndex index.html index.phpProxyRequests On
      ProxyPreserveHost On
      ProxyVia full
    
      <proxy>
        Order deny,allow
        Allow from all
      </proxy>
    
      ProxyPass        /  http://www.metak.com
      ProxyPassReverse /  http://www.metak.com
    </Virtualhost>
  4. Enable the new site and restart apache2:
    # a2ensite metak
    # /etc/init.d/apache2 reload
 
19 Comments

Posted by on October 20, 2006 in Linux, Ubuntu

 

Ruby tricks

A short little method that helps find methods up the class latter:

class Object
  def my_methods
    self.class.ancestors.each {|anc|
      puts "#{anc}:"
      p anc.instance_methods(false)
      puts
    }
  end
end
5.times.my_methods

It was copied from Stupid easy Ruby tricks

 
1 Comment

Posted by on October 11, 2006 in Ruby/Rails

 

Recursive recovery of MySQL databases

On Red Hat Enterprise MySQL is recovered with these commands:

cd /var/lib/mysql
find . -name "*.MYI" -exec myisamchk -r '{}' \;

 
Leave a comment

Posted by on October 11, 2006 in Linux

 
 
%d bloggers like this: