Getting WordPress to work inside a rails 3 application

I had a similar problem, but handled the VirtualHost configuration in a different way:

  1. Used an Apache mod_alias to redirect what for you is /home/blog/ to a path outside of /var/www/railsapp/public/ (e.g., /var/www/wordpress)
  2. Then, for that new hosted directory I had to declare PassengerEnabled off to avoid getting the standard rails error message.

I’ve wrote this up in more detail in a blog post about hosting wordpress in a rails subdirectory. My VirtualHost declaration ended up looking like this:

<VirtualHost x.x.x.x:80>
    ...
    DocumentRoot /srv/www/mydomain.com/public
    Options FollowSymLinks

    # an Alias for the wordpress blog
    Alias /blog /srv/www/mydomain.com/wordpress
    <Directory /srv/www/mydomain.com/wordpress>
        PassengerEnabled off
        AllowOverride all   # make the WordPress .htaccess file work
        Order allow,deny
        Allow from all
    </Directory>

    ...
</VirtualHost>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)