modrewrite not working on my Apache setup

Not sure if this is webmaster or a WordPress question, it’s a bit half and half, sorry if I’m posting in the wrong place.

Without using Multi-Site or installing new WordPress CMS’ in second-level domains, what’s the best way to get multiple WordPress installs running on my VPS (running Linux powered CentOS 6 with WHM and cPanel)?

Read More

It’s currently working but only by setting the permalinks option to the default setting, so the URLs aren’t human-friendly. I have come across something called WPSiteStack, though I’d really rather not go down this route.

Long story short, I need the following:

  • Seperate installs so one core / theme / plugin update doesn’t affect all sites and increases security of all sites;
  • ‘Pretty’ permalinks;
  • Each WordPress install must be in the root of it’s own domain to ensure that I can accurately measure my clients’ quotas;

It may also be worth noting that some functions within each install use the $_SERVER[‘DOCUMENT_ROOT’] and $_SERVER[‘HOST’] variables.

I have already edited the httpd-vhosts.conf, httpd.conf and .htaccess files but this hasn’t made any changes.

So any ideas what I’m missing or doing wrong? Any help is much appreciated.

UPDATE: mod_rewrite is definitely included and has been all along, though it’s not working with custom post types on one install and not working at all on all other installs. So /%year%/%monthnum%/%day%/%postname%/ is only working for standard ‘post’ and ‘page’ post types on one install while on other installs, which don’t use custom post types, it’s not working at all so only default permalink setting works for them.

Related posts

Leave a Reply

1 comment

  1. This is fairly easy to set up using virtual host configurations in Apache or Nginx (depending on which webserver you want to run on your box).

    Here’s the gist of things:

    1. Each installation will have a separate database and separate database user (for security).

    I set these up manually in MySQL through the command line, but if you have phpMyAdmin set up, you can use that instead.

    2. Each installation will be in its own directory. This keeps everything (core, themes, plugins) 100% separate.

    For example, you might configure multiple directories for each domain. Assume you have myawesomesite.com and mybizsite.com, you’d set up:

    • /var/www/html/myawesomesite
    • /var/www/html/mybizsite

    Each of these directories contains a distinct installation of WordPress. Separate files, separate wp-config.php, separate everything.

    3. Use virtual hosts to listen for requests for each domain.

    The default installations of both Apache and Nginx listen for all requests to an IP address and (usually) direct all traffic to /var/www/html. You can override this behavior by creating virtual hosts in your configuration to map specific host requests to specific folders.

    For example, all requests to your IP address for myawesomesite.com would be served from /var/www/html/myawesomesite and all requests for mybizsite.com would instead be served from /var/www/html/mybizsite.

    Keeping things separate like this also enables you to set up pretty permalinks because both sites use different .htaccess files (with Apache). So you could, essentially, have different permalink structures for each site.

    Setting up a virtual host is pretty straight forward and well documented. There are tutorials around for just about every configuration. For Apache, you want to look up Name-based Virtual Hosts.

    Setting one up in Nginx requires setting up a server_name in your configuration file. I use Nginx for all of my own hosting, and I did write up a tutorial on how I built up my CentOS server as well. Hope it helps!