Simple Sitemaps & All In One SEO – Not writing sitemap.xml file.

Hi everyone,

Today I attempted to install Andrew’s Simple Sitemaps & All In One SEO plugin (version 5, I believe). Per the install.txt file, I placed all the files into their respective directories. I also edited my .htaccess as follows (look toward the bottom):

# BEGIN WPSuperCache

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

AddDefaultCharset UTF-8

RewriteCond %{REQUEST_URI} !^.*[^/]$

RewriteCond %{REQUEST_URI} !^.*//.*$

RewriteCond %{REQUEST_METHOD} !=POST

RewriteCond %{QUERY_STRING} !.*=.*

RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$

RewriteCond %{HTTP:Accept-Encoding} gzip

RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f

RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]

RewriteCond %{REQUEST_URI} !^.*[^/]$

RewriteCond %{REQUEST_URI} !^.*//.*$

RewriteCond %{REQUEST_METHOD} !=POST

RewriteCond %{QUERY_STRING} !.*=.*

RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$

RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f

RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]

</IfModule>

# END WPSuperCache

RewriteEngine On

RewriteBase /

#Options +FollowSymlinks

#RewriteEngine on

#RewriteCond %{REMOTE_HOST} !^(72.169.92.58|74.73.197.54|67.142.130.13)

#RewriteCond %{REQUEST_URI} !/moving.html$

#RewriteRule .* http://ibankcoin.com/moving.html [R=302,L]

#uploaded files

RewriteRule ^(.*/)?files/$ index.php [L]

RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*

RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

RewriteRule ^(.*/)?sitemap.xml wp-content/sitemap.php [L]

# add a trailing slash to /wp-admin

RewriteCond %{REQUEST_URI} ^.*/wp-admin$

RewriteRule ^(.+)$ $1/ [R=301,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]

<IfModule mod_security.c>

<Files async-upload.php>

SecFilterEngine Off

SecFilterScanPOST Off

</Files>

</IfModule>

However the plugin doesn’t appear to be creating a sitemap.

After a test post, my PHP error log contained the following series of warnings:

[17-Jul-2009 17:45:54] PHP Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 100

[17-Jul-2009 17:45:54] PHP Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 101

[17-Jul-2009 17:45:54] PHP Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(//var) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 100

[17-Jul-2009 17:45:54] PHP Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(//var) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 101

[17-Jul-2009 17:45:54] PHP Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(//var/www) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 100

[17-Jul-2009 17:45:54] PHP Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(//var/www) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 101

[17-Jul-2009 17:45:54] PHP Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(//var/www/vhosts) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 100

[17-Jul-2009 17:45:54] PHP Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(//var/www/vhosts) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 101

[17-Jul-2009 17:45:54] PHP Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(//var/www/vhosts/ibankcoin.com) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 100

[17-Jul-2009 17:45:54] PHP Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(//var/www/vhosts/ibankcoin.com) is not within the allowed path(s): (/var/www/vhosts/ibankcoin.com/httpdocs:/tmp) in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 101

[17-Jul-2009 17:45:54] PHP Warning: file_put_contents(//var/www/vhosts/ibankcoin.com/httpdocs/wp-content/blogs.dir/16/files/sitemap.xml) [function.file-put-contents]: failed to open stream: Permission denied in /var/www/vhosts/ibankcoin.com/httpdocs/wp-content/mu-plugins/simple-sitemaps.php on line 103

In an attempt to elude the open_basedir restriction noted in the log history above, I edited /etc/php.ini to read as follows:

open_basedir = Off

I then rebooted Apache using

/etc/init.d/httpd restart

I then published another test post. I’m still getting the aformentioned warnings in my PHP error log. I’m also still without a sitemap.xml file in my document root (i.e., /var/www/vhosts/ibankcoin.com/httpdocs/sitemap.xml, which should be publicly accessible via web browser at http://www.ibankcoin.com/sitemap.xml).

I also uploaded a file named sitemap.xml to my document root with full 777 permissions — but the plugin still isn’t writing any data to the file.

Any help would be greatly appreciated.

Thanks,

Jeremy

  • Andrew
    • Champion of Loops

    Hiya,

    Basically the plugin can’t create the necessary directories and files.

    I also uploaded a file named sitemap.xml to my document root with full 777 permissions — but the plugin still isn’t writing any data to the file.

    The sitemap files are created at "wp-content/blogs.dir/BLOGID/files/sitemap.xml". Replace BLOGID with the blog id for each blog, etc.

    Make sure blogs.dir has the appropriate permissions.

    Thanks,

    Andrew

  • ibankcoin
    • New Recruit

    Thanks for the quick responses, guys; much appreciated.

    I think my confusion about the location of the sitemap.xml file arises from the following line in the package’s install.txt file:

    Sitemaps will be at domain.tld/sitemap.xml

    I forgot that php.ini can’t be used to disable the open_basedir setting when using the Plesk control panel. It can only be disabled via vhost.conf (as described here). I verified the change via phpinfo(), and everything’s working great now.

    One last question: Some of the blogs in my WPMU install have thousands of posts — but the plugin only seems to be generating listings for the previous 25 posts or so, via simple-sitemaps.php:

    var $totalposts = 25; // Number of posts to display

    Why only 25? Should I bump that up to 10,000? Or is it a bad thing to have too many?

    Also, how do I ensure that all of the search engines are made aware of the various sitemaps?

    Thanks!

  • Andrew
    • Champion of Loops

    I think my confusion about the location of the sitemap.xml file arises from the following line in the package’s install.txt file:

    The sitemaps appear to be at domain.tld/sitemap.xml thanks to the rewrite rule you added to your .htaccess file.

    Why only 25? Should I bump that up to 10,000?

    The more posts you have in the sitemaps the more server resources required to generate them. You can set it to whatever you think your server can handle.

    Also, how do I ensure that all of the search engines are made aware of the various sitemaps?

    The sitemaps are submitted to google but not other search engines.

    The main reason we coded this plugin was to provide a simple sitemaps feature that isn’t a resource hog. If you need all of the bells and whistles it’s best to go with one of the other sitemap plugins.

    Thanks,

    Andrew

  • drmike
    • DEV MAN’s Mascot

    The sitemaps are submitted to google but not other search engines.

    We’ve discussed that previously. Excuse me for not linking but I’m down to 12 minutes for the day. Search forums for ‘yahoo sitemap’ and it should come right up. Links as well.

  • Tracy
    • The Incredible Code Injector

    Holy f@ck, this only writes 25 posts???? IMO, that should be highlighted (maybe it is and I missed it) on the plugin install instructions…. to me that seems dangerously low…. especially for a default…..

  • drmike
    • DEV MAN’s Mascot

    Well, it’s been talked about a bunch of times. Both that and the SEO plugin included in there are made simple so that endusers aren’t bothered with having to worry about such settings.

    I’m going to go ahead and change this line instead and hardcode $number_posts to -1 which should list all of the posts:

    $latestposts = get_posts( ‘numberposts=’ . $this->totalposts . ‘&orderby=date&order=DESC’ );

  • Andrew
    • Champion of Loops

    Holy f@ck, this only writes 25 posts????

    I’m going to have to ask you to take it down a notch. That was not called for by any means. I’m pretty sure that’s the rudest comment I’ve seen on here over the past six months.

    The default has to be low in order for the plugin to work efficiently on large sites. It’s a one line edit to change the number of posts. We’ve never had a complaint before your rude comment so most people seem to be fine with the default.

    Thanks,

    Andrew