• 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.

Viewing 15 replies - 1 through 15 (of 19 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    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 πŸ™‚

    Thread Starter lepuzar

    (@lepuzar)

    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

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    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?

    Thread Starter lepuzar

    (@lepuzar)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    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?

    Thread Starter lepuzar

    (@lepuzar)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    Oh! OH!

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

    Thread Starter lepuzar

    (@lepuzar)

    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?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    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?

    Thread Starter lepuzar

    (@lepuzar)

    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?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    Are the folders owned by www-data?

    Thread Starter lepuzar

    (@lepuzar)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

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

    @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

    Thread Starter lepuzar

    (@lepuzar)

    @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 πŸ˜‰

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Thumbnails in Media Library and Site Not Showing’ is closed to new replies.