MostlyChris

Thoughts that are my own.

Plesk ChangeLogs

I have a hard time keeping up with latest micro update versions for Plesk. I have a harder time keeping up with the location of the microupdates list. So with that in mind, I am keeping it here for future reference.

Plesk 10

Plesk 10 Changelog

Quick and Dirty (Simple) NFS Setup in 8 Steps

Follow these simple steps to setup an NFS client/server.

First, some housekeeping for this example.
Server machine (server) = 192.168.1.1
Client machine (client) = 192.168.1.2
Exported directory /nfs/export

The server steps

  1. Create an entry in /etc/exports with the exported directory and client IP.

     /nfs/export 192.168.1.2(rw)
    

    The (rw) sets the directory to be read and writeable. There are other options that can be specified here. Check out the NFS docs for more.

  2. Edit /etc/hosts.deny and /etc/host.allow In /etc/hosts.deny

      portmap: ALL
    

    In /etc/hosts.allow

      portmap: 192.168.1.2
    
  3. Start up portmap, nfs, nfslock, netfs on the server. These can most likely be found in /etc/init.d in the form of init scripts. Make sure they are set to start at boot with chkconfig (Redhat servers).

  4. Run rpcinfo and make sure at least nfs, portmap and mountd are listed.

     rpcinfo -p localhost
    

The client steps

  1. Make a directory that you you are going to use to mount the NFS share. Call it whatever you want.

     mkdir /mount/nfsdir
    
  2. Start portmap, nfs, nfslock, netfs on the client as you did on the server.

  3. Mount the share.

     mount 192.168.1.1:/nfs/export /mnt/nfsdir
    
  4. Add an entry to /etc/fstab in order to have the share mount after a reboot.

     192.168.1.1:/nfs/export  /mnt/nfsdir   nfs  rw  0 0
    
  5. Test that you can create/delete/edit files and needed by your application.

Originally Posted Dec 2009

Sending Copy of Email to Another Account With Qmail

Suppose you would like to send a copy of an incoming email to another account while the email still goes to the original account. You can do this by modifying the .qmail file of the original recipient and adding an entry that looks like the following:

&user@domain.com

On a Plesk server, a full .qmail file with the above changes looks like this:

| true
&user@domain.com
| /usr/bin/deliverquota ./Maildir

Keep in mind that if you do this on a Plesk server, these changes will be overwritten with mchk or upgrades so you will have to take measures to deal with this. I set the files immutable so they can’t be changed by Plesk. This causes its own problems so you will have to decide if it is worth it.


Originally Posted March 2010

Accessing Horde Webmail via IP Address

I recently was asked to allow access to a server’s webmail. The problem was that there are no longer any domains pointed to the server. The solution, of course, was to connect to webmail via the IP address. Since this is a Plesk server, the following will allow access by IP.

Create a file in /etc/httpd/conf.d called zz012_horde.conf

Place the following in the file

<Directory /usr/share/psa-horde>
<IfModule sapi_apache2.c>
    php_admin_flag engine on
    php_admin_flag safe_mode off
    php_admin_value open_basedir "/etc/psa:/usr/share/psa-horde:/usr/share/psa-horde/config:/tmp"
    php_admin_value include_path "/usr/share/psa-horde/lib:/usr/share/psa-horde/pear:."
</IfModule>
<IfModule mod_php5.c>
    php_admin_flag engine on
    php_admin_flag safe_mode off
    php_admin_value open_basedir "/etc/psa:/usr/share/psa-horde:/usr/share/psa-horde/config:/tmp"
    php_admin_value include_path "/usr/share/psa-horde/lib:/usr/share/psa-horde/pear:."
</IfModule>
</Directory>
Alias /horde /usr/share/psa-horde

Restart apache and then access the file using the url http://ip.ad.dr.es/horde.


Originally Posted April 2010

Extracting Single Table From Mysql Dump File

Using awk, it is possible to extract a single table from a mysql dump file. You will need to know the name of the table you want AND the name of the table immediately after the table you want. I was able to find this info quicker than loading the whole dump file by going to mysql and looking at the table order and finding the table after the one I was looking for.

After getting the required information, apply some awk magic like such.

awk '/Table structure for table .firstTable./,/Table structure for table .secondTable./{print}' name_of_dump_file > output_file.sql

The awk statement above is printing all text from the location of the first match to the location of the second match. Matches are denoted by the text inside the forward slashes. In the above, search criteria one (starting point) is “Table structure for table .firstTable.” and search criteria two (stopping point) is “Table structure for table .secondTable.”. Make sure you replace “firstTable” and “secondTable” with the tables discussed earlier.

Check over your new output file and make sure it has the table you wanted and then you can import it using standard mysql commands.


Originally Posted April 2010