0

I am migrating an existing WordPress blog into a subdirectory of a new rails 3 app (deployed on Apache2 / Ubuntu 10).

I have PHP/MySQL installed, and I have a standard rails app folder structure in the production env:

/var/www/railsapp/public/

Inside /public/, I want to copy the Wordpress files into /home/blog/, so:

../public/home/blog/-wp stuff-

I've already migrated all the files as well as the database, and updated wp-config.php per the directons given in the Wordpress codex.

However, when I try to access the blog: (www.example.com/home/blog), I get a 403-forbidden message.

I've already ensured my vhost config is setup correctly (I can access the rails app without issue) and the http.d directive is as follows:

<Directory /var/www/railsapp/public/>
    Options +FollowSymLinks
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

Is there something I'm missing?

My ../home/blog/.htaccess file is also correct (I believe):

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /home/blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /home/blog/index.php [L]
</IfModule>

# END WordPress

What could be the problem?

2
  • Create a file in your blog folder. Call it test.html. Can you access it? If you can't then this isn't really a WordPress issue, and would probably be best dealt with at ServerFault or Webmasters
    – anu
    Commented Jul 8, 2011 at 10:44
  • This isn't an answer to your question, but rather a suggestion: why not setup your blog on a subdomain? Commented Jan 30, 2012 at 20:16

1 Answer 1

1

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.