Difference between revisions of "Ubuntu"

Jump to navigation Jump to search
10,171 bytes removed ,  07:01, 6 August 2010
Remove "Exchange Server" to be dedicated Zimbra page
(→‎Exchange Server: Added "Message Filters")
(Remove "Exchange Server" to be dedicated Zimbra page)
Line 114: Line 114:
#* Use <code> 0 </code> so that files are removed regardless of age.
#* Use <code> 0 </code> so that files are removed regardless of age.
#* Use <code> -1 </code> so that no files are removed.
#* Use <code> -1 </code> so that no files are removed.
== Exchange Server ==
=== DNS Records ===
Firstly, you need to own a public domain name, then get your ISP to create two DNS records...
# '''MX record''' - Mail Exchanger (MX) record
#* EG <code> sandfordit.com [MX] -> mail.sandfordit.com </code>
#* <code> sandfordit.com </code> is the domain you own, and <code> mail </code> is hostname of your email server (can be anything you like)
# '''A record''' - Standard DNS record
#* EG <code> mail.sandfordit.com [A] -> 158.25.34.124 </code>
#* <code> 158.25.34.124 </code> is the static IP address assigned by your ISP.  You'll need to set-up a NAT on your router (often oddly called a virtual server in domestic routers) to map incoming mail on TCP 25 to your email server's actual address (EG <code> 158.25.34.124:25 -> 192.168.1.150:25 </code>.
Note, instead of an A record you can use a CNAME record if you prefer, though obviously the CNAME record will still need to point to a valid A record.  Using a CNAME might be preferable, if for example you've multiple services running from a single public IP, that you might want to split out in the future to run on separate IP's, at which point you can replace the CNAME records with A records.
=== OS DNS Setup ===
In order to get round the fact that your exchange server won't have the same IP (or name even) on the public internet as it will on your internal network, a DNS server is installed on the exchange server to provide MX record resolution.  Procedure assumes DNS (Bind) is already installed.
Terminology...
* '''Private''' = Home or internal network IP address and network name (eg <code>192.168.1.150</code> and <code>mail.home.int</code>)
* '''Public''' = Global internet, ISP assigned IP address and registered domain name (eg <code>158.25.34.124</code> and <code>mail.sandfordit.com</code>)
Firstly, add the IP('s) of the DNS servers you use for resolution on your other machines to your local DNS server's list of forwarders (so that your exchange server forwards DNS resolution requests for unknown names to your normal DNS servers), edit <code>/etc/bind/named.conf.options</code>
<pre>
options {
        directory "/var/cache/bind";
        query-source address * port 53;
        forwarders {
                192.168.1.1; 158.25.30.10;
        };
        auth-nxdomain no;    # conform to RFC1035
};
</pre>
Edit <code>/etc/resolv.conf</code> to force the server to use its local DNS server for resolution
nameserver 127.0.0.1
Restart bind using <code> /etc/init.d/bind9 restart </code> and check you can resolve external addresses properly.
Now create the internal zone that will eventually contain the local MX record for your exchange server, append the following to <code> /etc/bind/named.conf.local </code>, using your publicly registered domain name
<pre>
zone "sandfordit.com"  {
    type master;
    file "/etc/bind/db.sandfordit.com";
};
</pre>
Lastly create the database file for you DNS domain <code>/etc/bind/db.sandfordit.com</code>, using your publicly registered domain name and private (internal) IP address for your exchange server...
<pre>
;
; BIND data file for sandfordit.com
;
$TTL    604800
@      IN      SOA    mail.sandfordit.com. admin.sandfordit.com. (
                        070725        ; Serial
                        604800        ; Refresh
                          86400        ; Retry
                        2419200        ; Expire
                        604800 )      ; Negative Cache TTL
;
@      IN      NS      mail
        IN      MX      10 mail
        IN      A      192.168.1.150
mail    IN      A      192.168.1.150
</pre>
=== Zimba Install ===
Reference http://wiki.zimbra.com/index.php?title=Ubuntu_8.04_LTS_Server_%28Hardy_Heron%29_Install_Guide
# Copy the install to the server
#* EG <code> pscp zcs-6.0.5_GA_2213.UBUNTU8.20100202225756.tgz simons@mail:zcs-6.0.5_GA_2213.UBUNTU8.20100202225756.tgz </code>
# Uncompress the package
#* <code> tar -xzf zcs-6.0.5_GA_2213.UBUNTU8.20100202225756.tgz </code>
# Start the install
#* <code> ./install.sh </code>
#* The install ''will'' fail due to missing packages!
# Install the missing prerequisite packages
#* EG <code> apt-get install libpcre3 libgmp3c2 libstdc++5 sysstat </code>
# Restart the install
# Part-way through the install will complain about your domain not having a DNS record, change the domain to your publicly registered domain (without server hostname, so <code>sandfordit.com</code> rather than <code>mail.sandfordit.com</code>
# At the end of the install, address the unconfigured item (ie an admin password)
Once the install is completed, login to administer the exchange server using https://mail:7071
To enforce https for Zimbra Desktop clients use the following commands (requires a restart to take effect)...
<pre>
su - zimbra
zmtlsctl https
</pre>
==== High CPU Workaround ====
Zimbra seems to have some real issues with constant high CPU spikes every minute, to limit reduce the logging retention and failed process checking.
<pre>
su - zimbra
zmlocalconfig -e zmmtaconfig_interval=6000
zmprov mcf zimbraLogRawLifetime 7d
zmprov mcf zimbraLogSummaryLifetime 30d
/opt/zimbra/libexec/zmlogprocess
crontab -e
*/60 * * * * /opt/zimbra/libexec/zmstatuslog
</pre>
==== Backup ====
'''Basic manual backup'''
# SU to Zimbra admin
#* <code> su - zimbra </code>
# Stop Zimbra services
#* <code> zmcontrol stop </code>
# Exit Zimbra user and create copy of directory
#* EG <code> cp -rp /opt/zimbra /home/simons/zimbra_backup_100301 </code>
<br>'''More elaborate scripted version'''<br>
* For more info see - http://www.zimbra.com/forums/administrators/15275-solved-yet-another-backup-script-community-version.html
* Script is downloadable from - http://www.osoffice.de/downloads/viewcategory-7.html
# Check the size of the <code> /opt/zimbra </code> dir, this will be replicated to a sync directory, from which the actual backup is taken, and check available free space
#* <code> du -hs /opt/zimbra </code>
#* <code> df -h </code>
# Un-gzip and upload the config file to somewhere convenient
# Edit required config params at start of script
# Run the script to install (as root), allow creation of required folders and install of required utils
#* <code> ./zmbak_v.0.8.sh --INSTALL </code>
# Perform a first full run to check everything works alight and to create the first full backup
#* <code> ./zmbak_v.0.8.sh -f </code>
To restore, see http://www.zimbra.com/forums/administrators/15275-solved-yet-another-backup-script-community-version-24.html
=== Upgrade ===
Use the same package to upgrade the software as used for a brand new install (there is no separate upgrade package).  The important part of any upgrade ''IS NOT'' how to get your system upgraded, it ''IS'' how you're going to recover if it all goes horribly wrong.
# Isolate the server from the internet (so new mails can't received following the pre-upgrade backup)
# Stop the mail server running
#* <code> su - zimbra </code>
#* <code> zmcontrol stop </code>
# Backup the server 1st
#* If hosted on an ESX, probably most easily achieved by starting a snapshot (remember to delete the snapshot after a few days if no probs are encountered)
#* Also copy off any existing local backup (so that a new full backup can be started following the upgrade)
# Copy the install to the server
#* EG <code> pscp zcs-6.0.6_GA_2324.UBUNTU8.20100406144520.tgz simons@mail:zcs-6.0.6_GA_2324.UBUNTU8.20100406144520.tgz </code>
# Uncompress the package
#* <code> tar -xzf zcs-6.0.6_GA_2324.UBUNTU8.20100406144520.tgz </code>
# Start the upgrade using the install script
#* <code> ./install.sh </code>
# The script should detect an existing installation and upgrade it, do not install additional components, but do confirm the upgrade.
# Once completed, test thoroughly
# Perform a full local backup
# Reconnect to network
==== Patch ====
Sometimes patch packages are supplied for minor upgrades between specific versions.  Take the same backup precautions as for a normal upgrade.  The actual application of the patch varies slightly from an upgrade...
# Copy the patch package to the server
#* EG <code> pscp zcs-patch-6.0.6_GA_2332.tgz simons@mail:zcs-patch-6.0.6_GA_2332.tgz </code>
# Uncompress the package
#* <code> tar -xzf zcs-patch-6.0.6_GA_2332.tgz </code>
# Start the patch upgrade using the install script
#* <code> ./installPatch.sh </code>
# Restart the software to apply changes
#* <code> su - zimbra </code>
#* <code> zmcontrol stop </code>
#* <code> zmcontrol start </code>
=== Install Zimlet ===
Zimlets ''only'' work when accessing via the web client, they are not usable from the full-fat Zimbra client.
# Copy the Zimlet to the server
#* EG <code> pscp com_zimbra_tasksreminder.zip simons@mail:com_zimbra_tasksreminder.zip </code>
# Move the file to the <code> /opt/zimbra/zimlets </code> directory
# Deploy the Zimlet
#* EG <code> zmzimletctl deploy com_zimbra_tasksreminder.zip </code>
=== Signature Length Increase ===
The maximum length of an email signature is limited to 10240 by default, to increase...
# '''Update appropriate CoS/user pref...'''
## In server admin console
## Either update the
### ''User''
###* Addresses > Accounts > <user>
### Or ''CoS''
###* Configuration > Class of Service > <CoS>
## Go to Preferences > Mail Options > Composing mail
## Change ''Maximum length of mail signature'' value (eg 20480)
# '''Update Zimbra Desktop'''
## Delete, then re-add the account and allow to resync fully
=== LDAP Config Item Check/Modify ===
* To check config
** EG <code> zmprov gcf zimbraMailPurgeSleepInterval </code>
* To modify config
** EG <code> zmprov mcf zimbraMailPurgeSleepInterval 1m </code>
=== Message Filters ===
* To verify email account filters setup
** EG <code> zmmailbox -z -m simon gfrl </code>
=== Message Purging ===
Check per-user settings
zmprov ga simon@sandfordit.com | grep Lifetime
more /opt/zimbra/log/mailbox.log | grep MailboxPurge
=== Documentation Links ===
* '''[http://wiki.zimbra.com/index.php?title=Working_with_Zimlets Zimlets]'''
* '''[http://wiki.zimbra.com/wiki/Zimbra_Desktop_FAQ#How_to_install_spell_checker_dictionaries.3F Zimbra Client Dictionary Install]'''


== MySQL ==
== MySQL ==

Navigation menu