WordPress.org

Ready to get started?Download WordPress

Forums

Thumbnails in Media Library and Site Not Showing (20 posts)

  1. lepuzar
    Member
    Posted 1 year ago #

    I have bit the bullet and I am in the process of moving my 12 sites to a multisite install on my own hosted Ubuntu + LAMP server. I won't lie, it's been a few weeks of tip-toeing in the dark. The guidance of this forum and some of your posts on other blogs has been precious. With this latest ambush however, I am now resolved to start asking questions as I cannot find any proper answer anywhere else.

    Via mySQL exports, I moved http://www.340mps.com to my server (still in dev) as site ID 2. Everything is smooth (domain mapping, posts, permalinks, etc.) except for the photos. They used to be found at http://www.340mps.com/media folder. I am now under the constraints of the http://www.340mps.com/files folder. The funny thing is if I look for image1.jpg at http://www.340mps.com/files/image1.jpg it is there but it won't show in the library nor in the post.

    I would appreciate any suggestion.

  2. Normally if the /files/ URL isn't working, it's a function of

    1) Not having the correct .htaccess

    2) Not having the correct httpd.conf

    Read http://codex.wordpress.org/Multisite_Network_Administration#Apache_Virtual_Hosts_and_Mod_Rewrite and the section below it :)

  3. lepuzar
    Member
    Posted 1 year ago #

    Hi Ipstenu,

    1) I read a lot of your posts so I figured you'd mention the .htaccess ;) And mine is clean cut, exactly like this:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress

    2) My httpd.conf is blank though. Can I assume it is because I use VirtualMin? Am I actually missing something in VirtualMin? In order to get the domain mapping to work, I added my domain 340mps.com as an alias of my primary domain victoor.com and that seemed to do the trick. But who knows?

    3) Finally I read the link you provided me with. This left me a little quizzical:

    To enable mod_rewrite to work within an Apache Virtual host you may need to set some options on the DocumentRoot.

    So I dug out the apache2.conf and added this just in case:

    <VirtualHost *:80>
      DocumentRoot /home/victoor/public_html
      <Directory /home/victoor/public_html>
        AllowOverride Fileinfo Options
      </Directory>

    But for naught.

    Thanks for your help,
    Victor

  4. In order to get the domain mapping to work, I added my domain 340mps.com as an alias of my primary domain victoor.com and that seemed to do the trick.

    No, that's actually what parking a domain does ;) It's just for the lazy/non-CommandLine inclined.

    Stupid question: Did you recycle the apache servvice after you did that?

    The general debugging is to check the following URLs:

    http://www.340mps.com/files/image1.jpg
    http://www.340mps.com/wp-includes/ms-files.php?file=/image1.jpg
    http://www.340mps.com/wp-content/blogs.dir/#/files/image1.jpg (where # is the blog number)

    Do any of those work?

  5. lepuzar
    Member
    Posted 1 year ago #

    Stupid question: Did you recycle the apache servvice after you did that?

    I've restarted the server a few times since.

    The general debugging is to check the following URLs:

    http://www.340mps.com/files/image1.jpg
    http://www.340mps.com/wp-includes/ms-files.php?file=/image1.jpg
    http://www.340mps.com/wp-content/blogs.dir/#/files/image1.jpg (where # is the blog number)

    Do any of those work?

    They all do.

  6. The funny thing is if I look for image1.jpg at http://www.340mps.com/files/image1.jpg it is there but it won't show in the library nor in the post.

    ... Okay. Now I'm confused.

    The image shows if you go to it directly, but NOT in the posts?

  7. lepuzar
    Member
    Posted 1 year ago #

    The image shows if you go to it directly, but NOT in the posts?

    That's correct. But it's even crazier than that.

    1. Nothing shows up in the Media Library.
    2. Gallery uploads do not show up in the posts.
    3. Single photo uploads added to a post show up.

    I should mention that this is only true for uploads previous to the move. New uploads work just fine. I guess now that I am reading myself I should try a new gallery upload to see if this works. I'll let you know more.

  8. Oh! OH!

    Go check permissions and ownership on the files! Compare the old to the new.

  9. lepuzar
    Member
    Posted 1 year ago #

    I have the feeling you are completely right. The permissions could be the problem.

    In fact, after installing WordPress MU, the automatic plugin install with WordPress would not work. Following these instructions on why WordPress is asking for FTP connection info, I realized with this piece of code:

    <?php echo(exec("whoami")); ?>

    that apache2 was running as www-data. I promptly changed ownership of the whole public_html folder to www-data. The plugin could then be installed.

    This however, meant that the admin for the WordPress install could not FTP into the server anymore. I ended up changing admin user to belong to www-data group and it did the trick.

    All these settings are far from the original WordPress single site install where I did not have to do anything. On the original site:

    • Apache2 runs as uxxxxxxxx
    • File owner is 5xxxxxx
    • Owner group is 6xx

    Do you have any suggestions on how to entangle this mess?

  10. WordPress asking for FTP info is perfectly normal on some servers.

    (It means the PHP account you're using doesn't have FTP access, by the way, has naught to do with your WP admin stuff. Apples and Oranges. Both fruit ;) )

    Log in via your normal user and make a file. What are the ownership and permissions?

  11. lepuzar
    Member
    Posted 1 year ago #

    Ownership is to www-data:www-data
    Permissions are 664, same as the older files

    I tried changing ownership of all the old files to www-data:www-data but the old photos are still not showing.

    What am I missing here?

  12. Are the folders owned by www-data?

  13. lepuzar
    Member
    Posted 1 year ago #

    They are. Should they be?

    I tried creating a user matching the user of the #2 blog and changing the permissions to this user. No dice.

  14. Is your new server still using .htaccess files? I mean, it's nto nginx right?

  15. rahul286
    Member
    Posted 1 year ago #

    @Lepuzar

    Have u disabled multisite?

    See: http://www.340mps.com/wp-includes/ms-files.php

    It says: Multisite support not enabled

    May be you forgot to put codes in wp-config.php

  16. lepuzar
    Member
    Posted 1 year ago #

    @Ipstenu I followed pretty closely these instructions on how to setup Ubuntu, LAMP, Webmin and Virtualmin. Except if I am completely mistaken on the whole show (which I could be), I am reasonably convinced that this is an Apache2 server with no sign of nginx anywhere.

    @rahul286 You are looking at the original site I am trying to move to my dev server. The dev server is locally hosted and not publicly accessible for the time being. When all is rosy, it will be. On the dev server I can guarantee you that multisite support is enabled ;)

  17. rahul286
    Member
    Posted 1 year ago #

    @lepuzar
    Thanks for confirmation. :-)
    As its Apache territory I'm kicking myself out of discussion (haven't used Apache in years... ;-)

  18. The only thing I can think of is to scrub it and start over as a fresh install, and then use export/import to bring the posts and images over.

  19. lepuzar
    Member
    Posted 1 year ago #

    Apart from Taiwanese Oktober Fest, this weekend is mostly open so I should be able to start from scratch on that blog. I'll "suicide" it and try to export import feature.

    Out of curiosity, how can I manage a successful export and import if the domain names are the same on my current host and on my dev server? What I mean is, I've done a Tools -> Export from the original blog. I edited my local host files to match my domain mapping and therefore access the dev server. I imported into the new blog but of course it fails to retrieve all the photos. How can the WordPress import feature access the original photos? Do I need to postpone the domain mapping until the import is done?

  20. I usually name the dev server to mydomain.dev and use my hosts file to have that pretend URL so I can easily import. Then when I'm ready to go live, I can search/replace mydomain.dev/mydomin.com without fear of busting serialization.

Topic Closed

This topic has been closed to new replies.

About this Topic