Since Mavericks stopped using the deprecated ipfw
(as of Mountain Lion), we'll be using pf
to allow port forwarding.
####1. anchor file
Create an anchor file under /etc/pf.anchors/<anchor file>
with your redirection rule like:
# filter by request host header | |
varnishlog -q 'ReqHeader ~ "Host: example.com"' | |
# filter by request url | |
varnishlog -q 'ReqURL ~ "^/some/path/"' | |
# filter by client ip (behind reverse proxy) | |
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"' | |
# filter by request host header and show request url and referrer header |
... | |
location / { | |
add_header Access-Control-Allow-Origin $http_origin; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE'; | |
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, origin, accept'; | |
add_header 'Access-Control-Allow-Credentials' 'true'; | |
... | |
} |
## lifted shamelessly from http://stackoverflow.com/questions/19142004/nginx-magento-in-subfolder | |
server { | |
listen 80; | |
listen 443; | |
server_name www.domain.de domain.de *.domain.de; | |
root /var/www/domain.de/www.domain.de/htdocs; | |
index index.php; | |
access_log /var/log/nginx/domain_access.log; | |
error_log /var/log/nginx/domain_error.log; |
#!/bin/bash | |
## setup a consolidated list of of apt-get installs | |
apt-get update | |
apt-get --yes --force-yes install python-software-properties python software-properties-common | |
echo 'mysql-server mysql-server/root_password select "xxxxxx"' | debconf-set-selections | |
echo 'mysql-server mysql-server/root_password_again select "xxxxxx"' | debconf-set-selections | |
apt-get --yes --force-yes install apache2 mysql-server-5.5 mysql-client php5 libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcrypt php-pear php5-curl php5-common php5-dev |
UPDATE wp_options SET option_value = REPLACE(option_value, ':8080', ''); | |
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, ':8080', ''); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, ':8080', ''); | |
UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, ':8080', ''); | |
UPDATE wp_posts SET guid = REPLACE(guid, ':8080', ''); |
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to me 80 | |
sudo ipfw add 101 fwd 127.0.0.1,8443 tcp from any to me 443 |
git config --global url."https://".insteadOf git:// |
#!/bin/sh | |
## install software for the base box to come packaged with - these will always be updated with chef/pupput | |
apt-get -y update && apt-get -y upgrade | |
apt-get install -y linux-image-generic-lts-raring linux-headers-generic-lts-raring build-essential dkms rubygems lxc-docker zlib1g-dev libssl-dev libreadline6-dev libyaml-dev ruby1.8 curl wget git-core gcc g++ make autoconf python-software-properties screen puppet puppetmaster openssl-server | |
sudo /usr/bin/gem install chef ruby-shadow --no-ri --no-rdoc | |
## create the vagrant user | |
sudo useradd -d /home/vagrant -m vagrant -p vagrant |
function setup_remote_key() { | |
cat ~/.ssh/id_rsa.pub | ssh $@ "cat - >> ~/.ssh/authorized_keys" | |
} |