SID-02428: Where is configure?
I'm trying to modify .htaccess.txt to work on a hosted web site (Nearly Free Speech).
Line 9-11 says:
# Replace {DataDir} with the value from
configure
# Replace {DefaultUrlHost} with the value from
configure
# Replace {ScriptUrlPath} with the value from
configure
I can't figure out what
configure refers to.
Evidently, you have to set up htaccess before you can run the TWiki configure script on a shared server host. Using the URL, it displays the text of configure, rather than execute it. You can execute it (with limited success) by doing perl -T /home/public/twiki/bin/configure from
PuTTY.
NFSHost sets up your web site in /home/public
so I unzipped TWiki 6.1.0 into /home/public/twiki
the bin would be /home/public/twiki/bin
the pub would be /home/public/twiki/pub
the url
http://mysite.nfshost.com
displays the index.html in /home/public
--
David Tremain - 2020-02-17
Discussion and Answer
configure refers to the configure script. Indeed, there is a chicken and egg problem since you can't run configure.
Setting TWiki up on a shared host is a bit tricky, but possible. In any case, for security I do not recommend placing TWiki in a public website directory. Steps:
- Place TWiki somewhere else on the server, such as /home/david/twiki
- Move the twiki/bin from the TWiki package to a cgi-enabled directory, such as /home/cgi
- Move the twiki/pub from the TWiki package to to the public directory, such as /home/public
- Run configure in the browser, such as =http://example.com/cgi/configure (some shared hosting require an extension, in which case rename configure to configure.cgi, among all other TWiki scripts)
--
Peter Thoeny - 2020-02-17
On NFS, they provide the following directories under /home
conf
logs (contains logs - access_log, error_log, and php-fpm.log)
private (contains .config .cpan perl5 directories)
protected (no subdirectories, php-fpm.conf and run-php.sh files)
public (web site - /home/public/index.html is the default page)
tmp (empty)
htaccess.cfg (they use Apache) is not available, so you have to use .htaccess in each directory
From what I can see, all the needed packages for TWiki (perl,
RCS, cpan, cgi, php) are installed as part of their base site package
I will try relocating the subdirectories and updating the configuration to point to the new locations.
--
David Tremain - 2020-02-29
I wound up with the following directories in the URL path:
bin
pub
templates
I have both bin and pub set so they have write permissions (for the user NFS uses to run the website - web)
templates is not write-enabled
The other directories are in the /home/etc/twiki
I gave lib, data, and working write rights
Do you see any potential problems with that setup?
From the distribution, Execute rights are not set on the bin/nul file, which throws a warning in the CGI Setup section of configure
I was able to clear all errors and warnings in configuration through changing the values in the configuration program and saving it.
I have yet to tackle mail (NFS does not provide mail service - you have to use someone else's mail facility - like google or outlook).
I am working on getting backup/restore functioning so I can upload my TWiki to the web site.
Thanks so much for your help.
--
David Tremain - 2020-03-02
You are safe as long as twiki/bin is in a cgi enabled directory, and twiki/pub in a webserver directory, and all other twiki sub-directories outside the webserver directory.
--
Peter Thoeny - 2020-03-03
I've had to move /twiki/bin, /twiki/data, /twiki/pub and /twiki/templates to the webserver directory (public url web path)
because it wasn't being cooperative to register users or add a new page to the Sandbox web
Or to do a backuprestore - current issue is End of script output before headers, which I asked in a separate question. (I could swear I saw that talked about somewhere in twiki.org, but couldn't find it...)
The good news is that after putting those directories in the public path, I seem to have gotten the register user,
add new page to Sandbox, and e-mail to work...
--
David Tremain - 2020-03-04
Short answer - configure I was asking about is the configuration file that is generated by running the configure script in /twiki/bin
Read and follow Peter's advice above - this question was early on in the process, and I really, really didn't know what I was doing... (what's changed?)
For a hosted site installation, you have to manually edit the
LocalLib.cfg file to point to the twiki installation base directory (on NFSHost, the way I installed, the $twikiLibPath was /home/public/twiki/lib, and the
LocalLib.cfg file's directory was /home/public/twiki/bin). In addition, the scripts have to be runnable by the hosted site's web service (Apache, in this case).
Download /home/public/twiki/bin/LocalLib.cfg.txt
Edit it to set (around line 24)
$twikiLibPath = "/home/public/twiki/lib";
Save file as
LocalLib.cfg and upload it to /home/public/twiki/bin
In order to make files that don't end with a recognized cgi-bin extension
(e.g., .cgi, .pl, .py) execute: (otherwise, it will just display the text
contents of the file and not execute it - regardless of the execute rights)
Create a file with the following two commands:
Options +ExecCGI
SetHandler cgi-script
Save it with the name .htaccess and upload it to /home/public/twiki/bin
Also, make sure the group is "web" and that group has r-x rights.
chgrp -R web /home/public/twiki/bin
chmod -R g+r+x /home/public/twiki/bin
In a browser, go to the following URL:
https://<<your
short site name>>.nfshost.com/twiki/bin/configure
The configure script should run.
--
David Tremain - 2020-03-29
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.