IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » apache The latest public apache snipts.

showing 1-20 of 76 snipts for apache
  • Htaccess Private Files (svn, cvs, sql, etc)
    # Drupal's way of denying access to delicate server files
    <FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
      Order allow,deny
    </FilesMatch>
    

    copy | embed

    0 comments - tagged in  posted by jrguitar21 on Aug 27, 2010 at 1:48 p.m. EDT
  • Apache memory usage
    ps -u www-data -o pid,rss,command | awk '{print $0}{sum+=$2} END {print "Total", sum}'
    

    copy | embed

    0 comments - tagged in  posted by jonbiddle on Aug 24, 2010 at 11:36 a.m. EDT
  • Apache - Stop, start and restart Apache2
    sudo /etc/init.d/apache2 stop
    sudo /etc/init.d/apache2 start
    or
    sudo /etc/init.d/apache2 restart
    

    copy | embed

    0 comments - tagged in  posted by ecwpa on Jul 30, 2010 at 11:18 a.m. EDT
  • No www
    # no-www
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    

    copy | embed

    0 comments - tagged in  posted by trey on Jul 09, 2010 at 12:44 p.m. EDT
  • Custom HTACCESS rules used on Komrade's Joomla! sites
    ########## CUSTOM RULES - START ##########
    
    # Google Apps
    Redirect 301 /mail http://mail.google.com/a/domain.com
    
    # Added to prevent directory browsing
    Options -Indexes
    
    # Redirect to WWW
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    
    ########## CUSTOM RULES - END ##########
    

    copy | embed

    0 comments - tagged in  posted by fevangelou on Jun 05, 2010 at 9:17 p.m. EDT
  • prevent the hotlinking of images
    <?php
      // setting in http.conf file. 
      SetEnvIfNoCase Referer "^http://www\.sitepoint\.com/" locally_linked=1
      SetEnvIfNoCase Referer "^http://sitepoint\.com/" locally_linked=1
      SetEnvIfNoCase Referer "^$" locally_linked=1
      <FilesMatch "\.(gif|png|jpe?g)$">
        Order Allow,Deny
        Allow from env=locally_linked
      </FilesMatch>
    ?>
    

    copy | embed

    0 comments - tagged in  posted by paranoid on May 25, 2010 at 2:01 a.m. EDT
  • servindo favicon pelo apache. Config do htaccess
    RewriteRule ^favicon\.ico$ /media/images/favicon.ico [L]
    

    copy | embed

    0 comments - tagged in  posted by italomaia on May 12, 2010 at 10:38 a.m. EDT
  • Check apache memory consumption
    ps aux | egrep ^apache | awk 'BEGIN {x=0} {x+=$4} END {print x}'
    

    copy | embed

    0 comments - tagged in  posted by malkir on May 06, 2010 at 9:25 p.m. EDT
  • passenger processes amount
    PassengerMaxPoolSize 2
    PassengerMaxInstancesPerApp 2
    
    PassengerPoolIdleTime
    #specify how many seconds an instance must be idle before it is unloaded. Default is 300 seconds.
    

    copy | embed

    0 comments - tagged in  posted by mateuszzawisza on May 04, 2010 at 6:49 a.m. EDT
  • code added to .htaccess to enable compression of certain served content using Apache mod_deflate
    # compress all text & html
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/css application/x-javascript application/javascript
    

    copy | embed

    0 comments - tagged in  posted by frankfarm on Apr 25, 2010 at 1:25 p.m. EDT
  • alpha list of modules installed in your apache configuration
    httpd -l | sort
    

    copy | embed

    0 comments - tagged in  posted by frankfarm on Apr 14, 2010 at 3:47 p.m. EDT
  • .htaccess rewrite url
    # check for form/thanks with or without trailing slash,
    # and rewrite to /form?m=thanks
    RewriteRule ^form/thanks(/$|$) /form?m=thanks
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Mar 30, 2010 at 12:19 p.m. EDT
  • reconfigure plesk vhost
    /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<NOME_DOMINIO>
    

    copy | embed

    0 comments - tagged in  posted by ftassi on Mar 12, 2010 at 12:44 p.m. EST
  • .htaccess file to lock down files with db or secure in the prefix
    <FilesMatch "^(db|secure).*$">
    deny from all
    </FilesMatch>
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Mar 02, 2010 at 11:17 a.m. EST
  • Dynamic Django mod_wsgi hook files
    # --- django.wsgi - in any project
    from some_common_module import wsgi_helper
    application = wsgi_helper.setup(__file__)
    
    
    # --- wsgi_helper.py - in some_common_module
    import os, sys
    import django.core.handlers.wsgi
    
    def setup(filename):
    	project_root = os.sep.join(filename.split(os.sep)[:-2])
    	project_dir = None
    	
    	for path in os.listdir(project_root):
    		# Find each dir off the root, and check it for settings.py
    	
    		path = os.path.join(project_root, path)
    	
    		if os.path.isdir(path):
    			file = "".join([path, os.sep, "settings.py"])
    			if os.path.exists(file):
    				# We have found /project_name/settings.py
    				project_dir = path
    				os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % path.split(os.sep)[-1]
    	
    	if not project_dir:
    		raise Exception("Could not find project settings file! Checked path: %s" % path)
    	
    	if project_root not in sys.path: sys.path.insert(0, project_root)
    	if project_dir not in sys.path: sys.path.insert(0, project_dir)
    
    	return django.core.handlers.wsgi.WSGIHandler()
    

    copy | embed

    0 comments - tagged in  posted by Fotinakis on Feb 26, 2010 at 6:39 p.m. EST
  • Rewrite .cfm files to files with .cfm
    RewriteEngine On
    Options -Indexes
    
    # redirect all .cfm files to files without .cfm
    RedirectMatch 301 ^(.*)\index.cfm$ $1
    RedirectMatch 301 ^(.*)\.cfm$ $1
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Feb 15, 2010 at 11:25 a.m. EST
  • htaccess redirect all traffic to homepage
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . http://domain.tld/index.php [L]
    </IfModule>
    

    copy | embed

    0 comments - tagged in  posted by rendrag on Feb 06, 2010 at 1:49 p.m. EST
  • Rewrite .htaccess to EE's engine if directory conflicts with existing directory
    RewriteEngine On
    RewriteBase /
    
    # if the file/dir does not exist, append index.php 
    # which will call EE and pull up it's structured url
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/interact/$1 [L]
    

    copy | embed

    0 comments - tagged in  posted by robertbanh on Feb 03, 2010 at 10:10 a.m. EST
  • Prevent .htaccess and .htpasswd file from being viewed by web clients
    #
    # The following lines prevent .htaccess and .htpasswd files from being 
    # viewed by Web clients. 
    #
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
    </Files>
    

    copy | embed

    0 comments - tagged in  posted by yvoictra on Jan 16, 2010 at 6:02 p.m. EST
  • Apache non-www .htaccess config
    Options +FollowSymLinks
    
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTP_HOST} !^apaair\.aero$ [NC]
    RewriteRule ^(.*)$ http://apaair.aero/$1 [R=301,L]
    
    # Important: It is needed to have mod_rewrite MODULE activated and have "AllowOverride Directive" set to ALL.
    

    copy | embed

    0 comments - tagged in  posted by yvoictra on Jan 16, 2010 at 9:05 a.m. EST
Sign up to create your own snipts, or login.