Latest 100 public
snipts » apache
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>
-
∞ Apache memory usage
ps -u www-data -o pid,rss,command | awk '{print $0}{sum+=$2} END {print "Total", sum}' -
∞ 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
-
∞ No www
# no-www RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
-
∞ 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 ##########
-
∞ 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> ?>
-
∞ servindo favicon pelo apache. Config do htaccess
RewriteRule ^favicon\.ico$ /media/images/favicon.ico [L]
-
∞ Check apache memory consumption
ps aux | egrep ^apache | awk 'BEGIN {x=0} {x+=$4} END {print x}' -
∞ 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.
-
∞ 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
-
∞ alpha list of modules installed in your apache configuration
httpd -l | sort
-
∞ .htaccess rewrite url
# check for form/thanks with or without trailing slash, # and rewrite to /form?m=thanks RewriteRule ^form/thanks(/$|$) /form?m=thanks
-
∞ reconfigure plesk vhost
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<NOME_DOMINIO> -
∞ .htaccess file to lock down files with db or secure in the prefix
<FilesMatch "^(db|secure).*$"> deny from all </FilesMatch> -
∞ 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()
-
∞ 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
-
∞ 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>
-
∞ 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]
-
∞ 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>
-
∞ 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.


