Category Linux

install varnish centos redhat

To install varnish on centos or redhat #!/bin/bash echo “Adding Varnish Repository and installing varnish” rpm –nosignature -i > /dev/null 2>&1 yum -q -y install varnish echo “Varnish installed.” chkconfig varnish on echo “Fetching standard Varnish config from Cloud…

howto set up local svn repository

Objective Set up a local svn repository to store some code Install subversion yum install subversion Repository Setup We will set up a path to store the repositories then create the initial repository mkdir -p /usr/local/svn svnadmin create /usr/local/svn/repo1 Initial…

nginx redirect single url

Objective Using nginx redirect single url Example ORIGINAL URL: REDIRECT TO: nginx basic php location block example location / { try_files $uri $uri/ @mylocation; } location @mylocation { rewrite ^/foo(.*)$ /bar/ redirect; rewrite ^.*$ last; } nginx…

curl test https redirect

Testing an https redirect In this example we will be testing an https redirect via curl curl test https redirect Syntax curl -k –head http://someurl Example [root@interweb ~]# curl -k –head HTTP 301 Moved Permanently Connection: close Location: …

sed delete all lines after

Objective: Prep dev httpd.conf for production Tasks: Remove jenkins virtual host entry (which starts with a comment line “#Start Jenkins”) Replace .dev with nothing (ex: www.dev.example.com becomes www.example.com) Replace debug with error (ex: Loglevel debug becomes Loglevel error) Sed to…

rollback httpd.conf changes on error

To rollback httpd.conf changes on error use this script: #!/bin/bash #File: deploy_new_httpd_conf.sh #Define this PATH_TO_NEW_HTTPD_CONF=”~” #Backup old httpd.conf file /bin/cp -f #Copy new httpd.conf over the existing one /bin/cp -f ${PATH_TO_NEW_HTTPD_CONF} #Test the Syntax /usr/sbin/apachectl -t if…

wget warm drupal cache

Objective: Warm Drupal Cache I wrote this script to warm the cache of a drupal site Script Contents #!/bin/bash -ex # Locate the binaries MKDIR=”$(which mkdir)” RM=”$(which rm)” WGET=”$(which wget)” #************************************ #### YOU MUST DEFINE THESE PATH_CACHE_ROOT=”/root/some_dir_name_to_store_data” PATH_LOG_FILE=”” URL_TO_CACHE=”” USER_AGENT=”Mozilla…