I recently had to create a number of home directories from the user accounts in the /etc/passwd file because Webmin didn't create them when the user was created. Don't ask me why. Webmin is a mystery and only does things it feels like doing at the time it does them. But I digress..
The first thing I did was to create file with all users that have directories.
Edit the file you created and remove things like the postfix directory and other non-user account directories.
Next, run the command to create all of the home directories and then change their ownership to the user.
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.
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
In /etc/hosts.allow
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.
### The client steps ###
5. Make a directory that you you are going to use to mount the NFS share. Call it whatever you want.
6. Start portmap, nfs, nfslock, netfs on the client as you did on the server.
7. Mount the share.
8. Add an entry to /etc/fstab in order to have the share mount after a reboot.
9. Test that you can create/delete/edit files and needed by your application.
The following command will optimize all databases in mysql (excpect those that don't support it due to their storage engine).
You can throw the
--auto-repair
flag in if you are brave.
If you need to change the TTLs on all domains in Plesk at once, you can massage the database with the following command:
Substitute the TTL values for what you need. Since the flat files are still used by named to provide DNS resolution, those will need to be updated as well. This command will do the trick:
I had occassion to run across the following question recently:
"Plesk was just upgraded to version 9.2.x and all domains now have an overuse policy set to not allow overuse. I can manually change this to allow overuse, but is there a way to do this through the database so I don't have to do it a domain at a time?".
The answer is yes, sort of. Plesk provides a 'domain_pref' utility that allows the setting of many of the parameters related to domain preferences. This allows one to change parameters for domains using the command line instead of logging into the interface. It works on one domain at a time, so some scripting foo is necessary in order to accomplish this on multiple domains.
In regards to the overuse policy, this handy little one-liner will allow the updating of all domains to a specific overuse policy.
There are three options available for the overuse policy.
- Block: Do not allow overuse
- Notify: Allow overuse and notify the domain administrator when overuse has occurred.
- Normal: Allow overuse with no notification.
The script above does the following things:
1. Connects to the Plesk database and selects a list of all domains from the 'domains' table.
2. Runs the 'domain_pref' CLI and sets the overuse policy to 'block'.
It has also come to my attention that the clients will have to have their overuse policy set as well.
As always, BACK UP the psa database before doing anything with the CLI.
