WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Issue with file access in blogs.dir (11 posts)

  1. arunciks
    Member
    Posted 3 years ago #

    :) Once again i need awesome help from here.. :)

    I am testing multisite with few sites.
    Issue is that can't access files in sites upload folder under blogs.dir

    Tried following scenarios with appache restarts after each:

    1. changed blogs.dir and all subfolders and files owner to apache - chown apache -R /path/...
    2. changed blogs.dir and all subfolders and files to 777 - chmod 777 -R -v /path/...
    3. 1. changed blogs.dir and all subfolders and files to 775 - chmod 775 -R -v /path/...

    none of the changes affect -
    http://testgallery.dualcoregroup.com/files/2011/07/lae084143-m13x3.jpg

    current rights:
    -rwxrwxr-x 1 apache apache 23579 Jul 12 18:08 lae084143-m1x3.jpg

    I suspect that maybe something to do with rewriting?
    since the content stored under
    blogs.dir/6/files/2011/07/

    maybe numbers as here in the folder 6 have something to do with it?...

    to mention uploads and upgrades go fine ..
    Apache running under apache user:

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    3063 apache 15 0 257m 37m 3292 S 0.0 7.4 0:00.72 httpd
    3064 apache 15 0 257m 38m 3344 S 0.0 7.5 0:00.71 httpd
    3065 apache 15 0 247m 28m 3308 S 0.0 5.6 0:00.51 httpd
    3066 apache 15 0 247m 28m 3308 S 0.0 5.6 0:00.74 httpd
    3067 apache 15 0 257m 38m 3292 S 0.0 7.4 0:00.70 httpd
    3068 apache 15 0 247m 28m 3316 S 0.0 5.6 0:00.76 httpd
    3069 apache 15 0 253m 34m 3424 S 0.0 6.7 0:00.76 httpd
    3070 apache 15 0 257m 38m 3400 S 0.0 7.4 0:00.50 httpd
    3076 apache 15 0 247m 28m 3308 S 0.0 5.6 0:00.51 httpd

  2. luciferdreams
    Member
    Posted 3 years ago #

    Good Question, seems to be a little bit of an issue lately. What once was open, now is closed from being valid urls. I hope those who are in the know, have a good direction to go and let us know.

  3. CoderJosh
    Member
    Posted 3 years ago #

    Yes, that's a rewriting issue, because the error message you're seeing when you try to access the file you've mentioned comes from your web server (Apache), not from WordPress.

    Can you show us your .htaccess file?

  4. Tim Moore
    Moderator
    Posted 3 years ago #

    Something is likely wrong with your .htaccess file. Can you put yours in pastebin and post the link here?

  5. luciferdreams
    Member
    Posted 3 years ago #

    Here is mine, same issue only with files.

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteCond $1 ^(index\.php)?$ [OR]
    RewriteCond $1 \.(gif¦jpg¦ico¦css¦js)$ [NC,OR]
    RewriteRule ^(.*)$ - [S=1]

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

  6. You have some extra stuff in there. Stuff is a technical term ;)

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress
  7. CoderJosh
    Member
    Posted 3 years ago #

    Accessing http://testgallery.dualcoregroup.com/wp-includes/ms-files.php?file=2011/07/lae084143-m13x3.jpg works fine, so it's definitely a rewrite problem.

    As a test, change this line:

    RewriteCond $1 \.(gif¦jpg¦ico¦css¦js)$ [NC,OR]

    into something like:

    RewriteCond $1 \.(gif¦jpgxx¦ico¦css¦js)$ [NC,OR]

    and check accessing http://testgallery.dualcoregroup.com/files/2011/07/lae084143-m13x3.jpg again.

  8. luciferdreams
    Member
    Posted 3 years ago #

    Thanks for answering questions. So far removing the stuff did no good and the suggesting of rewritecond didn't work either.

    Which is okay, just going to take a little more time to figure why I took a left turn at Albuquerque instead of a right.

    From my site and posting on this thread because the issue is to me the same and I don't like make 100 different forum post for the same thing. If I can help it.

    Site Url:http://lovemygame.com/lucifersarcade/
    Permalink Structure:/%year%/%monthnum%/%day%/%postname%/
    Upload Files Directory: wp-content/blogs.dir/9/files
    File Upload Directory: http://lovemygame.com/lucifersarcade/files
    If I have say a logo URL pointing here http://lovemygame/wp-content/blogs.dir/9/files/lal.png it works just fine, but if I use http://lovemygame.com/lucifersarcade/files/lal.png it gives a 404.

    The above is from the settings page for the web site in the Site Admin. If I log into the dashboard the permalink structure is set to this http://lovemygame.com/lucifersarcade/2011/07/13/sample-post/.

    It might be a case of having to update the permalink structure which is no big deal. I don't know where or what setting that got changed to make it different. I know I have been working hard to get my Google Page Speed and YSlow Performance up higher which is now at 92 for Google and 90 for YSlow. 1.5 second load time. Cool part by adjusting the main site the benefit is carried over to the multi-sites as well. If you have time to point me in the right direction when you have a chance that would be great. Would like to get back to helping with plugin developers and language translations. Which is fun and time consuming as well. I check back later have to do the day job thing back to testing software. Thanks

  9. Basically if the rewrite stops working there are three likely causes.

    1) The files aren't there (we know that's not the case)
    2) The htaccess is wrong (seems to be okay)
    3) Your htaccess isn't being read

    You're going to need to go into httpd.conf on your server and see if AllowOverride is set to ALL.

  10. arunciks
    Member
    Posted 3 years ago #

    :) Awesome...:)

    I woke up and so many replies... :)..

    Ipstenu - Thanks you were right once again.. :).. AllowOverride was the issue... :)..

  11. Je vous en prie :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags