TIP: Drupal6/7 permissions setup compatible with DSO (mod_php) 'nobody' web server mode on CentOS+WHM/cPanel under Drush maintenance

Some context

So why might you, if you are operating a cPanel-based VPS for your own Drupal sites, want to consider switching from suPHP to DSO ?

"Your Drupal site got hacked ? Well it's entirely your own fault ! You should always do your updates ! You've only got yourself to blame (and don't dare blame the security holes in that older Drupal code) !!!"

Advanced debugging of Drupal core using the command line (strace & tcpdump)


Debugging of Drupal was never easy, until you know the right tools and how to use them.

There are plenty of alternative debugging methods using some popular PHP libraries XDebug, XHProf, NuSphere PhpED, etc. and also most of the IDE have already built-in step-by-step debugger.

Useful Unix/Linux Commands for Drupal

Following are some useful Unix/Linux commands which are helpful if you are dealing with large sites (files and db size). I find these really handy when moving sites from one server to other, taking backups of Files, Database etc.

Note: To get access to the Unix command line, you will need an SSH client (e.g. Putty). You can also use WinSCP if you are not comfortable with Command line. WinSCP has a feature to enter custom commands using its interface.

Please add other command-line commands that you use while setting up, developing and managing your Drupal sites.

Zip Contents of current directory
zip -r zipfile.zip *

Unzip Contents into current directory
unzip zipfile.zip

Unzip (and extract) the tar'd, gzipped archive (tarball) Contents into current directory
tar zxvf tarballfile.tar.gz

Remove a directory and its contents (Use with extra care)
rm -rf directoryname

Backup Database
mysqldump dbname -uUSERNAME -pPASSWORD --host HOST > filename.sql

Restore Database
mysql -u root -p[root_password] [database_name] < dumpfilename.sql

Copy all files / directories from one server to other (Both servers should have SSH Support)
rsync -avz --progress username@servername:sourcefolder destinationfolder

Linux Memcached daemon, PHP PECL, Drupal Memcache & localized UNIX sockets

This information enhances the documentation for the Drupal Memcache module. The Drupal configuration on this page is for Drupal 6, while the other information below is Drupal version agnostic. For Drupal 7 sites on Ubuntu 12.04 you may want to see this post.

Local multi-site installation of Drupal 7 on Linux

Drupal allows you to run multiple sites from a single Drupal code installation -- each with its own modules, content, theme, etc. For instance, you can run:

  • Multiple sites on your local computer
  • Multiple domains in a single hosting account
  • Multiple sub-domains
  • Multiple sub-directory sites

For a live multi-site installation, see Multisites Using Drupal 7.

This page describes one way to run multiple test sites on your local computer with Drupal 7 on Ubuntu 10.10, Ubuntu 11.04 and Mandriva 2010.2. But the method probably works with little modifications for other distributions. Purposedly, we only present one way to do that, in details, and we try to explain a bit what we're doing. We're not sure whether this procedure contains mistakes or not, and we think it probably contains useless things.

Note: if you are creating multiple sites, it is desirable to make a list of the desired sites before reading through these instructions completely. Some steps can be done in bulk to save time.


Subscribe with RSS Subscribe to RSS - linux