symlink hundreds of wordpress websites

PHP programmer here. Boss wants me to create multiple wordpress websites that are symlink’ed back to a single parent wordpress directory. Each website resides in a separate Linux user account. In other words, one parent, many children copies, all residing in different /home/ accounts. I need help with my symlink strategy…

So far, for each new linux web account,

Read More
  1. install the database
  2. sed replace config values into a temp config file
  3. mysql insert some config data
  4. symlink????

    a. every wordpress file ??

    b. the entire public_html directory ??

If I alter the parent wordpress PHP code, I can place a “real” copy of the config file in the child user directory, above the symlinked public_html. So, I need only use one child symlink to the parent’s public_html directory. BUT, apache returns a 500 error. How do I set up the permissions?

Permissions are the issue. Would chgrp work? Which group? What file mode? Or would I need to create a special group to accommodate the apache user, nobody?

Any help would be greatly appreciated. Code samples welcome 🙂

Related posts

Leave a Reply

3 comments

  1. Problem’s Cause (paranoid security, “switch-user” blocking):

    PHP 5 Handler   suphp
    Suexec  on
    

    Problem’s solution (DSO):

    PHP 5 Handler   dso
    Suexec  off
    

    Performance optimization, added +FollowSymLinks at httpd.conf LINE 75:

    <Directory "/">
        Options All +FollowSymLinks
        AllowOverride All
    </Directory>
    
  2. Each linux user must have a wp-content directory and a wp-config.php file. Don’t forget to set writing permissions to the wp-content directory.

    You can symlink the rest of the wordpress files to the global wordpress ones.

    The global wordpress files must not be writable by the linux users.

  3. This is very possible to do. I have actually written a detailed post explaining the process of symlinking the WordPress directory.

    1. Basically the idea is to replace the wp-config.php file.

    2. Download the repo for WordPress from github with this you can switch to newer or older version of WordPress with a simple command. “git checkout 3.7-branch”

    Here is the complete set of instructions:
    http://www.htmlgraphic.com/symlinking-wordpress-core-files-wordpress-skeleton/