The MU forums have moved to WordPress.org

Server migration kills image uploading (3 posts)

  1. slor
    Member
    Posted 16 years ago #

    I've spent the past few hours pouring over vhost config, htaccess, and folder permissions posts but now I've got ask for help.

    I moved over to a VPS from a previously shared hosting. All files have been transferred over and the database reconstructed on the new host. I set up wildcards for sub-domains and after the DNS server changes propagated, the system delivers existing posts from all blogs with images correctly displayed. I was about to update to the latest version of Mu but wanted to work this out before adding more issues.

    I get the following error message when I try to upload an image for (ironically) a 'Server Back Online!' post:

    The uploaded file could not be moved to /var/www/vhosts/thedomain.com/httpdocs/wp-content/blogs.dir/13/files//2007/11.

    After researching here:

    1. Set the permissions for blogs.dir and wp-content to 777.
    2. Changed the PHP safe mode to off.
    3. Removed the <Directory/$HTTPD_VHOSTS_D/thedomain.com/httpdocs>AllowOverride FileInfo</Directory> entry in my vhost.conf file because it looked similar the error output.
    4. Tried itdamager's htaccess but it threw internal server errors so I restored the old one.
    5. I restarted Apache and BIND a number of times after changes, including right before I wrote this.
    6. I followed these steps one at a time to check their effect, which was none.

    Here's my environment:

    VPS server, Apache
    Plesk interface
    VHOST enabled, sub-domain install
    located in root directory
    Wordpress Mu 1.2.1

    Here are some relevant entries in my logs (I can't really decipher them):

    Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http: //webmaster.thedomain.com/wp-admin/upload.php?style=inline&tab=upload&post_id=91&ID&action&paged=

    PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/thedomain.com/httpdocs/wp-admin/admin-functions.php:1913) in /var/www/vhosts/thedomain.com/httpdocs/wp-includes/functions.php on line 1344, referer: http: //webmaster.thedomain.com/wp-admin/upload.php?style=inline&tab=upload&post_id=91&ID&action&paged=

    Here is my .htaccess:

    RewriteEngine On
    RewriteBase /
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    My vhost.conf now simply has:

    ServerAlias *.thedomain.com

    Any suggestions?

  2. slor
    Member
    Posted 16 years ago #

    After continued reading I tried a solution mentioned in this thread. I should have just searched plainly instead of going for htaccess, vhost, etc.

    The solution was chmod -R 777 blogs.dir. I didn't apply that recursively before.

    Settings permissions to 755 as cautioned did not work.

    That seems to fix the problem, but it seems like a brute force solution. Isn't this a security hazard?

  3. Farms
    Member
    Posted 16 years ago #

    Pumpkinslayer's fix has always worked great for us: http://mu.wordpress.org/forums/topic.php?id=3173&page&replies=3#post-19388

    To reproduce it here... ask your hosts to, ahem:

    "# cd /wordpres_directory/wp-content
    # chmod nobody:nobody -R blogs.dir
    # find blogs.dir -type f -print -exec chmod 644 {} \;
    # find blogs.dir -type d -print -exec chmod 755 {} \;"

    Whatever that means ;)

About this Topic