Viewing 4 replies - 16 through 19 (of 19 total)
  • Did you ever resolve this? Do you still need help?

    If you still need help, can you clarify your use case and workflow?

    – are you making core changes or just themes and plugins
    – can you enable and use htaccess
    – will all revisions be at demo.com/revX/
    – each rev site is independent and its own DB
    – how are you deploying new rev sites besides git
    – are you copying the DB or fresh new installs each time
    – how much automation do you need

    I run multiple subdirectory installs for testing much as you describe so WP can do what you want. It just depends on your exact workflow and intended use case. It can be simple or complex, with custom setup scripts.

    Thread Starter hydrostarr

    (@hydrostarr)

    Sorry for late reply. This is not solved. Problem:

    https://serverfault.com/questions/361723/seeking-wordpress-apache-conf-that-allows-for-dynamic-subdir-to-site-creation

    Addtl (redundant?) notes:

    * .htaccess is a hack, prefer not to do that (we don’t use .htaccess for any of our production servers, considered “inferior” approach)
    * each site will have it’s own database
    * each site will have it’s directory (in filesystem and in Apache’s URL: mysite.com/site1, mysite.com/site2)
    * each site/subdir can be dynamically created without changing Apache .conf
    * workflow: git checkout a wordpress-based site install to a unique directory, create/import corresponding database, and above links (eg: https://mysite.com/siteX ) appear without any further (Apache or otherwise) configuration.
    * this is all on Linux (specifically Ubuntu) system

    Thread Starter hydrostarr

    (@hydrostarr)

    Plus:

    * No core changes to WP.
    * we can automate most anything (Python Fabric is weapon of choice, but use plenty of general bash & Python scripting) so long as we have a procedure
    ** …but Apache .conf changes (for each new site) are acceptable

    In the end… I suspect we’re making a mountain out of a mole-hill here. Have strong “feeling” there’s a simple answer here for our application context (our WP site doesn’t really leverage WP as a “dynamic blog” like others do–it’s a rather static content set, just a company site selling products, no external/community users changing/adding content in forums/blogs or such), and there may be many wrong assumptions/misconceptions about the operational context… or just a general misunderstanding of the basic requirements.

    In general: I can do this with most any other Apache/php application. Why not WordPress… or at least our WordPress, as it’s coded today? We don’t (yet) know.

    Here’s a possible workflow. Adjust and customize as appropriate for your personal workflow and environments.

    domain.com/site1/ -> /var/www/site1

    – configure the server and database
    – install and buildout WordPress

    domain.com/site2/ -> /var/www/site2

    – branch version control from site1
    – dump mysql from site1
    – write a script to do the following
    —- update wp-config.php with necessary changes
    —- mysql dump file search/replace domain.com/site1/ with domain.com/site2/
    —- Note: search/replace needs to be adjusted for your install and serialized data
    – create new database and restore from the new mysql dump file

    If using .htaccess, it should work on a basic install.

    If not using .htaccess, you will probably want to setup something like

    <Directory ~ "/var/www/site[0-9]{1}">
    # ... directives here ...
    </Directory>

    Or, you can script out another process for updating your <Directory> directives.

    The above should work on most installs and configurations. If you have a highly customized install or some plugins, you may need a more complex update script. The workflow is essentially the same as moving a WordPress install to a new domain, except you’re keeping the old site live.

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Seeking WordPress-Apache conf that allows for dynamic subdir-to-site creation’ is closed to new replies.