Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

BUILDING ERROR =:-(

Quote Reply
BUILDING ERROR =:-(
Hi,

I have been running Links 2.0 - Templates. Of late, while building pages, I've been getting this error, when I get to the "Building Home page" part:
----->
CGI ERROR
==========================================
Error Message : unable to open home page: /home/usr/index.html. Reason: Permission denied
Script Location : nph-build.cgi
Perl Version : 5.00404

[ I thought it was a permissions error at the root, so i checked the directory, and it shows drwxrwxrwx - 777.

Then, I manually tried chmoding the index.html page to 777, but I was refused permission. [This is what the permissions look like]
-rw-r--r-- 1 www www 4157 Aug 31 06:19 index.html

I uploaded another index.html to the root, deleted the old one and tried chmoding, and it worked. I tried building it, and this time, the home page was built, but I got stuck at the What's New page [Refused permission, again!].

The index.html page there has the same permissions -
-rw-r--r-- 1 www www 4157 Aug 31 06:19 index.html

Do I have to delete all the index.html files [in all the directories..] and upload new ones and chmod to 777. [ =:0 I have over 50 directories].

Is there an easier way to do this?

Regds
Joe

[This message has been edited by Joe Louis (edited September 04, 1999).]
Quote Reply
Re: BUILDING ERROR =:-( In reply to
I had a problem with permission defaults on the server when pages are created from cgi-bin, I put some extra code into nph-build so after pages are created they are also chmoded.
Let me know if you think this would solve your problem and I`ll post it up, its very simple to do.
chmod.
Quote Reply
Re: BUILDING ERROR =:-( In reply to
Hi Chmod,

Sure, please post the code...

Regds
Joe
Quote Reply
Re: BUILDING ERROR =:-( In reply to
First backup nph-build.cgi

Then in nph-build.cgi
replace
Code:
# Create the main page.
open (CAT, ">$dir/$build_index") or &cgierr ("unable to open category page: $dir/$build_index. Reason: $!");
print CAT &site_html_category;
close CAT;

# Then we go through the list of links and build on the remaining pages.
$prev = $url if ($build_span_pages);
while ($next && $build_span_pages) {
if ($numlinks > $build_links_per_page) {
$next_page = $page_num+1;
$next = $url . "more$next_page$build_extension";
}
else {
$next = "";
}
$links = "";
LINK: for ($i = 0; $i < $build_links_per_page; $i++) {
%tmp = &array_to_hash ($i, @{$links{$cat}});
last LINK if ($tmp{$db_key} eq "");
$links .= &site_html_link (%tmp);
}
$title_linked = &build_linked_title ("$cat/Page_$page_num/");
$title = &build_unlinked_title ("$cat/Page_$page_num/");

$use_html ?
print qq|\tSubpage : <A HREF="|, $url, qq|more$page_num$build_extension" TARGET="_blank">$dir/more$page_num$build_extension</A>\n| :
print qq|\tSubpage : $dir/more$page_num$build_extension\n|;

open (CAT, ">$dir/more$page_num$build_extension") or &cgierr ("unable to open category page: $dir/index$page_num$build_extension. Reason: $!");
print CAT &site_html_category;
close CAT;

@{$links{$cat}} = @{$links{$cat}}[(($#db_cols+1)*$build_links_per_page) .. $#{$links{$cat}}];
$numlinks = ($#{$links{$cat}}+1) / ($#db_cols + 1);

$prev = $url . "more$page_num$build_extension";
$page_num++;
}
print "\n";
}
}
with
Code:
# Create the main page.
open (CAT, ">$dir/$build_index") or &cgierr ("unable to open category page: $dir/$build_index. Reason: $!");
print CAT &site_html_category;
close CAT;
chmod(0644,"$dir/$build_index") or cgierr ("unable to chmod what's new page: $dir/$build_index. Reason: $!");
print "\tchmod: $dir/$build_index successful\n";


# Then we go through the list of links and build on the remaining pages.
$prev = $url if ($build_span_pages);
while ($next && $build_span_pages) {
if ($numlinks > $build_links_per_page) {
$next_page = $page_num+1;
$next = $url . "more$next_page$build_extension";
}
else {
$next = "";
}
$links = "";
LINK: for ($i = 0; $i < $build_links_per_page; $i++) {
%tmp = &array_to_hash ($i, @{$links{$cat}});
last LINK if ($tmp{$db_key} eq "");
$links .= &site_html_link (%tmp);
}
$title_linked = &build_linked_title ("$cat/Page_$page_num/");
$title = &build_unlinked_title ("$cat/Page_$page_num/");

$use_html ?
print qq|\tSubpage : <A HREF="|, $url, qq|more$page_num$build_extension" TARGET="_blank">$dir/more$page_num$build_extension</A>\n| :
print qq|\tSubpage : $dir/more$page_num$build_extension\n|;

open (CAT, ">$dir/more$page_num$build_extension") or &cgierr ("unable to open category page: $dir/index$page_num$build_extension. Reason: $!");
print CAT &site_html_category;
close CAT;
chmod(0644,"$dir/more$page_num$build_extension") or cgierr ("unable to chmod what's new page: $dir/more$page_num$build_extension. Reason: $!");
print "\tchmod: $dir/more$page_num$build_extension successful\n";


@{$links{$cat}} = @{$links{$cat}}[(($#db_cols+1)*$build_links_per_page) .. $#{$links{$cat}}];
$numlinks = ($#{$links{$cat}}+1) / ($#db_cols + 1);

$prev = $url . "more$page_num$build_extension";
$page_num++;
}
print "\n";
}
}
You`ll see it confirmed or rejected as you build.
If this sorts out your category pages and you want the code for the whats new pages and main page let me know.

chmod

[This message has been edited by chmod (edited September 05, 1999).]

[This message has been edited by chmod (edited September 05, 1999).]
Quote Reply
Re: BUILDING ERROR =:-( In reply to
Hi,

I replaced the code in nph-build.cgi as you suggested.

*All New and Popular records were updated *Home pages were built
and then I got stuck again at this point : Building 'What's New page'. It says - unable to open what's new page - reason - Permission denied.

Is there some thing else I ought to do?

Joe