Installation of TWiki4 on 1and1 Shared Hosting (Linux)
Pre-Requisites
- SSH client - I use Putty.
- FTP-Capable Text Editor - I use EditPlus
- 1and1 Shared hosting account - You need to know your 1and1 "root" username, which looks like "u12345678". You can find this out by logging into your account at http://admin.1and1.com and visiting "Secure Shell (SSH) Access" in the package administration section.
Install TWiki Files
Configure TWiki Installation
TODO Set Up Login Sessions
TODO Install Perl Modules For TWiki
OLD-DO-NOT-USE BryceSchober Installation Steps
- Unzip TWiki-4.0.4.tgz to TWiki-4.0.4
- Unzip contents of hotfix-4.0.4-2.tgz over TWiki-4.0.4
- Rename TWiki-4.0.4 to TWiki-4.0.4-patched
- Execute (cygwin) "tar -cjf twiki-4.0.4-patched.tar.bz2 Twiki-4.0.4-patched"
- Copy twiki-4.0.4-patched.tar.bz2 to remote root
- Execute (remote) "tar -xjf twiki-4.0.4-patched.tar.bz2"
- Rename remote /Twiki-4.0.4-patched to /twiki
- Read http://[your_domain]/twiki/INSTALL.html
- Read http://twiki.org/cgi-bin/view/TWiki/SettingFileAccessRightsLinuxUnix
- Remote "cd twiki"
- Paste script into remote console:
find . -type d -print -exec chmod -v 755 {} \;
find data -name '*.txt' -type f -exec chmod -v 660 {} \;
find data pub -name '*,v' -type f -exec chmod -v 440 {} \;
find lib -name '*.pm' -type f -exec chmod -v 440 {} \;
find locale -type f -exec chmod -v 440 {} \;
find pub -type f -exec chmod -v 660 {} \;
find pub/TWiki/WysiwygPlugin/_kupu -type f -exec chmod -v 440 {} \;
find bin -type f -exec chmod -v 550 {} \;
find bin/logos -type f -exec chmod -v 440 {} \;
find templates -type f -exec chmod -v 440 {} \;
find tools -type f -exec chmod -v 550 {} \;
chmod -v 660 lib/LocalSite.cfg
chmod -v 660 data/.htpasswd
chmod -v 660 data/mime.types
chmod -v 440 bin/LocalLib.cfg.txt
chmod -v 440 bin/.htaccess.txt
chmod -v 440 pub/_work_areas/.htaccess
chmod -v 440 pub/_work_areas/README
chmod -v 440 AUTHORS COPYING COPYRIGHT index.html INSTALL.html LICENSE pub-htaccess.txt readme.txt robots.txt root-htaccess.txt subdir-htaccess.txt TWikiHistory.html twiki_httpd_conf.txt TWikiReleaseNotes04x00.html
chmod -v 550 UpgradeTwiki
- cd ..
- Remote "tar -cjf twiki-20060906-step13.tar.bz2 twiki"
- rename /twiki/bin/.htaccess.txt to /twiki/bin/.htaccess - NOTE: Don't do this, see step 29.
- rename /twiki/bin/LocalLib.cfg.txt to /twiki/bin/LocalLib.cfg
- rename all files in /twiki/bin with no extension, adding .pl extension
- Remote "tar -cjf twiki-20060906-step17.tar.bz2 twiki"
- Download twiki-20060906-step17.tar.bz2 to local root and extract to twiki-20060906-step17
- Modify twiki-20060906-step17/twiki/bin/LocalLib.cfg, $twikiLibPath variable to "//htdocs/twiki/lib"
- Modify first "shebang" line of all .pl files in twiki-20060906-step17/twiki/bin to "#!/usr/bin/perl"
- Execute (cygwin) "tar -cjf twiki-20060906-step21.tar.bz2 twiki" in twiki-20060906-step17/
- Move twiki-20060906-step21.tar.bz2 to local root
- Copy twiki-20060906-step21.tar.bz2 to remote root
- Execute (remote) "tar -xjf twiki-20060906-step21.tar.bz2"
- Modify local twiki-20060906-step17/twiki/root-htaccess.txt , replacing line 13 with:
Redirect /twiki/index.html http://[your_domain]/twiki/bin/view.pl/
- Modify local twiki-20060906-step17/twiki/root-htaccess.txt , inserting following text at line 3:
<Limit GET POST>
order deny,allow
deny from all
allow from [allowed_ip_1]
allow from [allowed_ip_1]
</Limit>
- Rename twiki-20060906-step17/twiki/root-htaccess.txt to twiki-20060906-step17/twiki/.htaccess
- Upload local twiki-20060906-step17/twiki/.htaccess to remote twiki/.htaccess
- Rename /twiki/bin/.htaccess back to /twiki/bin/.htaccess.txt - apparently I wan't supposed to do that!
- View http://[your_domain]/twiki/bin/configure.pl
- View General Path Settings - changed nothing
- Click Next - as per advice in General Path Settings
- Set password to [your_password]
- Return to configuration
- View General Path Settings
- Changed {PubDir}, {TemplateDir}, {DataDir}, and {LocalesDir}, removing extraneous "bin/configure.pl" from middle of path string.
- Save settings, return to configuration
- Changed GenPathSet->{ScriptSuffix} to .pl
- Save settings, return to configuration
- Changed MiscSet->{ReplaceIfEditedAgainWithin} to 0 - NOTE: This ensures that every page save generates a revision
- Save settings, return to configuration
- Created twiki@.com account, username: [your_twiki_email_user] pwd: [your_twiki_email_password]
- Changed Mail->{SMTP}{MAILHOST} to "smtp.1and1.com"
- Changed Mail->{SMTP}{SENDERHOST} to "twiki@[your_domain]"
- Changed Mail->{SMTP}{Username} to "[your_twiki_email_user]"
- Changed Mail->{SMTP}{Password} to "[your_twiki_email_password]"
- Save settings, return to configuration
- Downloaded http://search.cpan.org/CPAN/authors/id/M/MA/MARKSTOS/CGI-Session-4.14.tar.gz archive for CGI::Session via http://search.cpan.org/search?query=CGI%3A%3ASession&mode=all , extracted to local root /CPAN_lib
- Downloaded http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Scalar-List-Utils-1.18.tar.gz archive for Scalar::Util via http://search.cpan.org/search?query=scalar%3A%3Autil&mode=all , extracted to local root /CPAN_lib
- Uploaded contents of local CPAN_lib\CGI-Session-4.14\lib directory to remote /twiki/lib/CPAN/lib/
- Uploaded contents of local CPAN_lib\Scalar-List-Utils-1.18\lib directory to remote /twiki/lib/CPAN/lib/
- First successful view of http://[your_domain]/twiki/
- Deleted twiki-20060906-step12.tar.bz2 and TWiki-4.0.4.tar that were mistakenly in remote /twiki - not sure exactly how
- Remote "tar -cjf twiki-20060906-step54.tar.bz2 twiki"
- Set Security->{UseClientSessions} on (was already)
- Set Security->{Sessions}{UseIPMatching} on (was already)
- Changed Security->{LoginManager} to "Twiki::Client::TemplateLogin"
- Set Security->{PasswordManager} to "Twiki::Users::HtPasswdUser" (was already)
- Changed Security->{MinPasswordLength} to 6
- Save settings, return to configuration
- View http://[your_domain]/twiki/ with login / register in sidebar
- Registered user Main.[your_twiki_user_name]
- Received "click to complete" email, confirmed, received confirmation email.
- Logged in successfully.
- Uploaded ".changes", "TestHTMLImport1.txt", and "TestHTMLImport1.txt,v" files from old to new twiki/data/Sandbox
- Viewed http://[your_domain]/twiki/bin/view.pl/Sandbox/TestHTMLImport1 successfully.
- Remote "tar -cjf twiki-20060906-step67.tar.bz2 twiki"
- Made sure all twiki-*.bz2 archives were in local root
- Deleted all twiki-*.bz2 archives and old twiki-something directories
--
Contributors: BryceSchober - 10 Jan 2007
Discussion
Thanks Bryce - this is a great help. Have you tried using the .htaccess templates for the pub and bin folders? Apparently TWiki is quite unsecure without them. I tried using them, but had some problems:
The pub/.htaccess includes a line "php_flag engine off" which breaks the rendering of my TWiki (even though I do have PHP 4 and 5 installed as the comments suggest are necessary for this line).
I also have a problem after creating the bin/.htaccess - the configure.pl becomes inaccessible (pops up a login box, but doesn't accept the login details that work on my site), even though I have edited the .htaccess settings to include my IP address and username.
- Update: Making some progress on this - see my comments in Support/ConfigureAuthentication.
Both issues are not completely cut and dried yet, so could still use some ideas. Of course, these lines can be commented out for now, which still leaves quite a few positive improvements (see my next comment), but for full security, they should be used.
--
EricWoods - 04 Feb 2007
I've noticed that the bin/.htaccess file includes the following lines:
# Use CGI & Perl to handle all files in 'bin' directory, i.e. run as scripts
# - this should remove the need to rename files to end in '.pl' etc,
# if your web hosting provider permits this. Remove if using mod_perl.
SetHandler cgi-script
which mean that you don't have to rename all the files in the bin directory with the .pl extension (I have tried it and it works). So it might be easier to tell people to enable this .htaccess file than it is to get them to 1) rename the files to .pl 2) add the .pl extension to configure 3) change the twiki/.htaccess redirect to go to view.pl... 4) edit about 2 to 4 other settings where it refers to view or register etc.
However, enabling the bin/.htaccess file outright will create more challenges for newbies, as there are quite a few things in there to configure. So maybe just tell them to copy the .htaccess from the parent directory, delete of its contents and just add the line "SetHandler cgi-script"...
--
EricWoods - 04 Feb 2007
I like your suggestions. While you're collaborating on this, check out
HowToInstallCpanModules. I used it to get 4.1 mostly working - but I point it out not for that, but for its method of customizing instructions. That kind of thing could make these directions much easier to follow.
--
BryceSchober - 05 Feb 2007
Cool. I'll check it out after I have sorted out those issues and have something defininte to contirbute. Thanks.
--
EricWoods - 04 Feb 2007
Hi, works with 4.2.0 thanks!
--
GustavoE - 13 Jul 2008
Not working with 4.3.1 yet. I'm stuck with a missing Unicode::String perl module. I'm trying to figure out how to install
CPAN modules locally on 1and1. If I do, I'll post what I learn.
--
KevinMills - 2009-04-30
That dependency slipped into the TWiki-4.3.1 release by mistake. See info at
TWikibug:Item4074 with description how to revert the dependency.
If you want to install
CPAN:Unicode::String see
HowToInstallCpanModules.
--
PeterThoeny - 2009-05-01
The WYSIWYG editor goofed up the bullets above, restoring...
--
PeterThoeny - 2009-05-01
Thanks a lot for this tutorial !
Here is my installation report : I had an error 500 internal server problem when lauching configure.pl. Whoever, the explanations further in the tutorial (Find-and-replace (in all open files) "#!/usr/bin/perl -wT" with "#!/usr/bin/perl".) solved this problem.
I then just had to go back in the tutorial to configure my TWiki.
May I suggest to put this part of the tutorial before the "calling configure.pl" part ? I personnally spent hours in order to solve this problem, thinking that I could not go further in this tutorial before being able to properly configure my TWiki.
--
JeremyGERMAIN - 2011-01-29
Jeremy, this is a wiki, and TWiki is a community-run project. Please
get involved help fix and improve docs.
--
PeterThoeny - 2011-01-29