# to add mephisto sites, you need to: # # (back up this file) # # A. If it's a top level site e.g. site.com # # 1. add the following in /var/www/vhosts/site.com/conf/vhost.conf # $ sudo nano /var/www/vhosts/site.com/conf/vhost.conf # # ProxyRequests Off # ProxyPreserveHost On # ProxyPass /plesk-stat ! # ProxyPass /webstat ! # ProxyPass /webstat-ssl ! # ProxyPass /ftpstat ! # ProxyPass /anon_webstat ! # ProxyPass / http://0.0.0.0:81/ # ProxyPassReverse / http://0.0.0.0:81/ # # 2. recognfigure plesk # $ sudo /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=site.com # # 3. add '|(^|www\.)site\.com' to the end of the REGEXP (inside parens) on $HTTP["host"] line below # e.g. if it was: "(blog\.ardes\.com|(^|www\.)c90.com)" # it becomes: "(blog\.ardes\.com|(^|www\.)c90.com|(^|www\.)site\.com)" # # 4. restart lighty # $ sudo /sbin/service lighttpd restart # # B. If it's a subdomain site e.g. blog.site.com # # 1. add the following in /var/www/hosts/site.com/subdomains/blog/vhost.conf # $ sudo nano /var/www/hosts/site.com/subdomains/blog/vhost.conf # # ProxyRequests Off # ProxyPreserveHost On # ProxyPass / http://0.0.0.0:81/ # ProxyPassReverse / http://0.0.0.0:81/ # # 2. recognfigure plesk (use exact same command as in A.2 above - no subdomain needed) # # 3. add '|blog\.site\.com' to the end of the REGEXP (inside parens) on $HTTP["host"] line below # e.g. if it was: "(blog\.ardes\.com|(^|www\.)c90.com)" # it becomes: "(blog\.ardes\.com|(^|www\.)c90.com|blog\.site\.com)" # # 4. restart lighty (as above A.4) # # If you get a problem return to the backed up file and check you spelling etc # $HTTP["host"] =~ "(newblog\.ardes\.com|c90\.ardes\.com|accountability\.ardes\.com)" { var.mephisto-root = "/srv/mephisto" var.mephisto-host = "%0" server.document-root = var.mephisto-root + "/public" server.errorlog = var.mephisto-root + "/log/lighttpd_error.log" accesslog.filename = var.mephisto-root + "/log/lighttpd_access.log" server.error-handler-404 = "/dispatch.fcgi" url.rewrite = ( "/$" => "/cache/" + var.mephisto-host + "/index.html", "/(images|stylesheets|javascripts)/mephisto/(.+)$" => "/$1/mephisto/$2", "/(images|stylesheets|javascripts)/(.+)$" => "/cache/" + var.mephisto-host + "/$1/$2", "/assets/(.+)$" => "/assets/" + var.mephisto-host + "/$1", "/([.]+)$" => "/cache/" + var.mephisto-host + "/$1" ) fastcgi.server = ( ".fcgi" => ( "localhost" => ( "socket" => var.mephisto-root + "/tmp/sockets/fcgi.socket", "bin-path" => var.mephisto-root + "/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "production" ), "min-procs" => 2, "max-procs" => 6, "idle-timeout" => 20 ) ) ) }