#!/bin/bash
find /var/www/webs -name 'vhost' -exec bash -c 'IFS=/ read -a names <<< "$1"; ln -sf "$1" "${names[4]}"' -- {} \;
Wednesday, August 24, 2011
bash script to symbolically link using find results
Friday, April 15, 2011
Exim4 handling redirecting mails from your apache vhost an external email
The Problem
Consider the Apache vhost myweb.com. Someone sends an email to
info@myweb.com. We want exim4 to spot that and use sendmail to send the mail to
the approved user. frequently that person might be sat behind gmail or something
similar.
The components
- Everything is done via exim4 config with the addition of a new router and
vhost specific alias files which contain the email mappings. - The text here assumes you have NOT split your configuration
- All exim configuration is done using the exim4.conf.template file.
The solution
- Edit /etc/exim4/exim4.conf.template.
- Modify the local domains definition
# List of domains considered local for exim. Domains not listed here
# need to be deliverable remotely.
domainlist local_domains = @:localhost:dsearch;/etc/exim4/virtualhosts
This tells exim which domain names are considered for for further processing.
- Insert the following additional router code before systemalias handling (400):-
#####################################################
### router/350_exim4-config_vdom_aliases
#####################################################
vdom_aliases:
driver = redirect
allow_defer
allow_fail
domains = dsearch;/etc/exim4/virtualhosts
data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtualhosts/$domain}}}
retry_use_local_part
pipe_transport = address_pipe
file_transport = address_file
no_more
#####################################################
### end router/350_exim4-config_vdom_aliases
######################################################################################## - A cursory glance at the code suggests that /etc/exim4/virtualhosts will play a
part. It does! - Create a file for each vhost you wish to redirect email for. From our example
we create /etc/exim4/virtualhosts/myweb.com. In it we place our email
mappings. Here is an example:-
info: info@gmail.com
webmaster: webmaster@gmail.com
--
My Emacs Files At GitHub
Thursday, September 16, 2010
Sheeva plug : the idle web server
Wonderful devices : http://en.wikipedia.org/wiki/SheevaPlug
Small, cheap to run, headless, support Debian. Reliable I guess.
--
My Emacs Files At GitHub
Thursday, January 22, 2009
Web hosting with Apache and laziness.
For a while I had been ignoring a niggling little issue with my home hosted web site at http://www.richardriley.net. When you entered the web address the url actually served was http://www.richardriley.net/default. Finally I found a straightforward explanation of virtual hosts and using redirect matching which all came together and worked. Here is the link.