Forum OpenACS Q&A: Can't get static-pages to work

Collapse
Posted by Gregory Collins on
Hi,

I installed OpenACS 4.5b1 on my Linux box at work, with Postgres
v7.2.1 and the AOLserver distribution linked to on the install
page. (Most) everything works, but I couldn't get the
static-pages module to work properly --- I'd put a sample .html
page in a place which the documentation indicated that it would
be found (${server}/www/), but doing "scan for new static pages"
in the admin page for the static-pages module gives me a blank
page which doesn't do anything. (I.e., it still says "0 static
pages")

Any suggestions? I'm not adverse to hacking up a short script
which manually adds the page locations to the database, but it
seems like the less-kludgey solution should work.

Cheers

Collapse
Posted by Don Baccus on
It was working ... Dave Bauer is the person who worked on it, you might e-mail him (go to openacs.org/directory to find his e-mail address or search the forum for his name).
Collapse
Posted by Simon Carstensen on
Scanning for new static pages I get the following request error:

no such array: static_pages
while executing
"nsv_get static_pages package_id"
(procedure "sp_sync_cr_with_filesystem" line 8)
...

Do you know wherefrom this error stems?

Collapse
Posted by Dave Bauer on
Simon,

You need to restart the server after mounting the package.

the static-pages-init.tcl is not loaded until you restart. That is the file the initialized that variable.

Gregory,

Check the package parameters in the site map. It should work with html pages out of the box. I am using it right now, so I believe it still works.

Collapse
5: ...still doesn't work (response to 1)
Posted by Gregory Collins on
Hi Dave,

I've tried hacking at the AllowedExtensions variable, and restarting the server. It didn't work out of the box, and it's not working now, unfortunately. I click the "Scan for static pages" link and it opens the URL static/admin/fs-scan-progress, which spits out an essentially blank page (the header is "Filesystem Search", then "Your Workspace : ACS System Wide Administration : Static Pages Admin : Filesystem search", then an hrule, then nothing.)

I am hoping maybe someone has some insight into why this may not be working; I was a reasonable Tcl hacker something like four years ago, but my knowledge of databases is kind of weak and I'm obviously unfamiliar with the nuances of the OpenACS package. Maybe I'll try and spend some time hacking through the package code.

Thanks, everyone, for your help.

Collapse
Posted by Dave Bauer on
Interesting. Where did you mount the static-pages package? It should be mounted in a directory directly off the main-site.

If your html pages are in yousite/www/ or any folders under that it should work.

Collapse
Posted by Gregory Collins on
Dave,

The static-pages package is mounted under /static, and the static html files I'm trying to add are indeed mounted under "yousite/www". I don't know if it matters, but I've put the whole package under "~/ACS/web" rather than "/web". I'm guessing that has nothing to do with it.

Cheers

Collapse
Posted by Dave Bauer on
OK. I installed a new OpenACS 4.5 beta with general comments and static pages.

I had 2 html files in the www directory.

Here is the result:
/home/dave/develop/openacs-4-5-beta-1/www/test.html: added
/home/dave/develop/openacs-4-5-beta-1/www/test2.html: added

I am not sure where to tell you to look. Did you install and mount general comments?

Collapse
Posted by Gregory Collins on
Dave,

Well, the good news is that your question led me to the solution to the problem; it works now. I unmounted static-pages, then remounted it again, and everything is groovy.

The bad news is that I guess this means there is an undocumented (or, unclear perhaps) dependency on the mount ordering of static-pages and general-comments --- I had both installed and mounted, but I mounted static-pages first, which mucked things up.

The static-pages documentation says "You must have the General Comments package installed and mounted to use Static Pages"; maybe change "to use" to read "prior to mounting"?

Cheers, and thanks for the help!

Collapse
Posted by Simon Carstensen on
I mistakingly thought that "reload" had the effect of restarting the server. I restarted the server and, of course, everything worked fine. Could someone tell me the function of "Reload a package"?.

Wouldn't it be possible/worthwhile to make the restarting of aolserver automatic (i.e. AOLserver is automatically restarted using exec after the package has been installed)?