postfix and virtual hosts or domains tutorial
I have Apache 2 configured with VirtualHost’s. So I have my domains for example http://mydomain1.com and http://sampledomain.com running on my machine. What about mails now? What about postfix?
For arriving mail:
- Edit “/etc/postfix/main.cf” and add there:
virtual_alias_domains = mydomain1.com, sampledomain.com virtual_alias_maps = hash:/etc/postfix/virtual - Edit or add “/etc/postfix/virtual”:
@mydomain1.com user1 homer@sampledomain.com user2This means that all mail for domain mydomain1.com should be delivered to local user account user1 (/home/user1 or whatever). This means also that mails for homer@sampledomain.com will be delivered to local user account user2. - Execute:
cd /etc/postfix postmap virtual /etc/init.d/postfix restart
For departuring mail (mails sent form local accounts to the Internet):
- Edit “/etc/postfix/main.cf” and add there:
smtp_generic_maps = hash:/etc/postfix/generic -
Edit or add “/etc/postfix/generic”:
user1@ubuntu-1004-lucid-64-minimal user1@mydomain1.comSo mails sent from local account user1 will be sent into the Internet as user1@mydomain1.com. - Execute:
cd /etc/postfix postmap virtual /etc/init.d/postfix restart
Further information in here http://www.postfix.org/VIRTUAL_README.html#virtual_alias and in here http://www.postfix.org/ADDRESS_REWRITING_README.html#generic.
problem starting sphinx with rials
Problem:
When doing:
rake thinking_sphinx:index
you get:
undefined method `[]' for false:FalseClass
Solution: remove the empty config/schema.yml file.
ubuntu xml gem instal problem
Problem:
libxslt is missing. try 'port install libxslt' or 'yum install libxslt-devel' *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Solution:
apt-get install libxslt1-dev
ubuntu webdav problem
Problem: ubuntu 8.04
Unknown DAV provider: filesystem ...fail!
Solution:
a2enmod dav_fs
vimdiff not working on ubuntu 9.10 and ubuntu 8.04
Problem:
This Vim was not compiled with the diff feature.
Solution:
apt-get install vim
Stange, but worked for me :)
good old pine mail client in ubuntu 9.10
I did not know that Pine is now called Alpine. So to have Pine in Ubuntu one should install
apt-get install alpine
xubuntu system tray disappeared
The solution that worked for ubuntu works for xubuntu as well.
ntldr is missing vista ubuntu grub
After reinstalling my Windows Vista I had to recover Grub menu. I tried https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows and EasyBCD. It was not working. I downloaded Ubuntu 9.10 CD and boot it, hoping to do a grub-install. After reboot I got my Grub menu and when trying to boot Vista a “NTLDR is missing” error.
The solution that worked for me was to:
FIRST OF ALL:
Follow http://neosmart.net/wiki/display/EBCD/Recovering+the+Vista+Bootloader+from+the+DVD
SECOND OF ALL:
Follow https://wiki.ubuntu.com/Grub2#Recover%20Grub%202%20via%20LiveCD
And watch out for the menu.lst generated (/boot/grub/menu.lst), mine included thinks like:
title Ubuntu 9.10, kernel 2.6.31-14-generic root kernel /boot/vmlinuz-2.6.3........ initrd /boot/initrd.img-2.6.3........ quiet
But it should be:
title Ubuntu 9.10, kernel 2.6.31-14-generic root (hd0,4) kernel /boot/vmlinuz-2.6.3....... initrd /boot/initrd.img-2.6.3..... quiet
It seams that update-grub when doing a chroot generated wrong partition numbers for grub. To be more specific it did not generate any partition pointers for the loader :) But after changing those everything works fine.
(hd0,4) is a grub partition number. if you don’t know how to find out what to type there study grub manual http://www.gnu.org/software/grub/manual/html_node/Naming-convention.html
Mine is:
hd - hard disk
0 - disk no. 1
4 - first extended partition
ruby 1.8.6 in ubuntu 9.04 64 minimal
This was inspired by: ruby-on-rails-development-on-ubuntu-9-04-jaunty-using-ruby-1-8-6 . That unfortunately did not work for me.
Edit the file:
/etc/apt/preferences
Add to it:
Package: ruby Pin: release a=hardy Pin-Priority: 900 Package: ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: rdoc1.8 Pin: release a=hardy Pin-Priority: 900 Package: ri1.8 Pin: release a=hardy Pin-Priority: 900 Package: libgtk2-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libdbd-sqlite3-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libopenssl-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libsqlite3-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: ruby1.8-dev Pin: release a=hardy Pin-Priority: 1001 Package: libdbi-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libatk1-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libpango1-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libatk1-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libgdk-pixbuf2-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libglib2-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: libcairo-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: irb1.8 Pin: release a=hardy Pin-Priority: 900 Package: libreadline-ruby1.8 Pin: release a=hardy Pin-Priority: 900 Package: rails Pin: release a=hardy Pin-Priority: 900 Package: libncurses-ruby1.8 Pin: release a=hardy Pin-Priority: 900
Edit the file:
/etc/apt/sources.list
Add to it:
deb http://gb.archive.ubuntu.com/ubuntu/ hardy restricted main multiverse universe deb-src http://gb.archive.ubuntu.com/ubuntu/ hardy restricted main multiverse universe
Install ruby
apt-get update aptitude install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby ruby1.8-dev
rmagick ubuntu installation problem
Problem:
Can't install RMagick 2.9.1. Can't find MagickCore.h.
Solution:
apt-get install libmagick++9-dev