ISPConfig | |
ISPConfig is an open source hosting control panel for Linux which is capable of managing multiple servers from one control panel. ISPConfig is licensed under the BSD license. This page is the document optimal configuration for Tiki. For general info about ISPConfig, please link to ispconfig.org |
1.1. Create a Client | |
You can use a predefined template (or create a new client-template first). Please Note It seems ISPConfig allows to omit that and then there is sort-of default client0 but that can cause troubles later with databases e.g. so yes please, create one. |
1.2. Create a web space | |
|
1.3. Create a DB | |
Create a database user first: "Sites > Databases : Database Users > Add new User"
Then, add a database: "Sites > Databases : Databases > Add new Database"
|
1.4. Adding JailRoot SSH users | |
The client needs to have the option ssh-chroot option set to "Jailkit" mode. Log in as a client (if permissions are granted for such task), or as ISPConfig admin, and go to "Sites > Command line > Shell user > Add new Shell-user" |
1.5. Installing Tiki | |
Get your tiki as usual. See, for instance: In this example, we will consider that you have fetched Tiki9 LTS into the folder Copy to clipboard
|
1.6. PHP Tweaks | |
Remember that most php modes in ISP Config do not allow tweaking php options in a .htaccess, but they need to be set on a per-directory php.ini file. See the ISP config manual for more information. In case you want to change some settings for all your sites, like rising the minimum upload size in php for all sizes, you can edit: command server side to edit your default php.ini settings for all sites Copy to clipboard
And change these two settings Copy to clipboard
|
1.7. Backups | |
You can setup that per site, at: "Sites > Websites : Website > Add new website (or edit a previous one by clicking on its name in the list)", and go to the tab "backup":
|
1.7.1. Paths inside and outside the chrooted environment | |
New sites are associated with clients, and some ssh users can be created associated with that client and site. ssh users have their chrooted environents in this absolute path in the server: Copy to clipboard
For instance, for the test case of the tiki01 site (http://tiki01.example.com) for user 'john', client 'smith' is #1 (N in hte path above), ssh user smithjohn, and the website is #8 (M in the path above). Therefore, his website will be here: Copy to clipboard
And when he logs in through ssh, he will be at the apparentpath for him: Copy to clipboard
His website http://tiki01.example.com will be initially fed with the contents at the file (chrooted, apparently absolute path for him): Copy to clipboard
Which in fact, will be the real paths at the server for his home directory and website are: Copy to clipboard
|
1.8. Multitiki setup and permissions | |
Which permissions does the web folder have by default for a site? Copy to clipboard
If you check the attributes of those folders, they all seem ok: Copy to clipboard
However, if you check the attributes of the parent folder web8, you will see that it has the immutable bit enabled: Copy to clipboard
Therefore, you need to change that immutable bit attribute, in order to be able to remove the web subfolder and replace it with a symlink to the multitiki installation. Do these steps:
|
1.9. Where to store files outside the web root | |
See below "Open_basedir restrictions for storing uploaded files on disk" Or add an .htaccess to avoid browsing |
1.10. Open_basedir restrictions for storing uploaded files on disk | |
If you plan to setup file galleries, wiki attachments, tracker file uploads, etc., to use storage on disk instead of in database, then you are recommended to indicate a subfolder with the base path private of the site folder, with the absolute path: Copy to clipboard
Therefore, for file galleries, we could use the folder "tiki_file_gals", with an ending slash, and therefore, the absolute path would be: Copy to clipboard
This seems to be necessary to comply with the few open_basedir folders allowed by ISPConfig. Alternatively, you could add new folders to the PHP open_basedir param in the ISPConfig Admin Panel: "ISPConfig > Sites > (click on a web site name) > Options (tab) > PHP open_basedir"
Permissions of the folders and files under this folder can be set to 750 for user web8 and client1, following with the previous example. Copy to clipboard
But if you plan to setup several sites based on a multitiki install, and having two different sites (different domains, and site folders on disk, except that web folder will be a symplink to the real multitki installation, etc), then you have to set permissions of the Copy to clipboard
|
1.11. Fix 'No input file specified.' from web sites in subfolders of a previous site | |
If the website to be allowed in a subfolder of another one, is a symlink to another folder in the different path, you need to add that other path in the Open_Basedir directive of PHP. You can do so thorugh the ISP_Config interface for that parent website (mysite.example.com, in this case) which hosts a web site in a subfolder (mysite.com/mysubsite/ for instance), because In this case, we had to add: /var/www/tiki12svnfarm_subdir: to PHP open_basedir parameter for the site mysite.example.com:
Another approach, if the site is not in a multitiki installation, like the mrbs (for the mysite.example.com/bookings/ ) is to move the external file tree inside the path of the parent site, so that you avoid using symlinks. this way, no need to tweak the open base dir directive. |
1.12. ISPConfig Manual Notes | |
1.12.1. Documentation pages about jailrooted ssh users | |
[+]
Rellevant pages at the current manual (ISPconfig v3.0.5.2),
|
1.13. Adding Tiki to Client Websites | |
For instance, to copy the svn installation of tiki12 under the user 'xavi' home folder over the website of a client (lets say: client1 (smith) web8 (john) (i.e. http://tiki01.example.com ), you can do that with: Copy to clipboard
The force option is needed since the destination folder already exists. And the svn export is preferred (if no svn is needed) because of the space savings reducing it down to aprox. 40% of the initial size on disk (As a simple reference, 453 Mb for the svn-enabled version of tiki09svn, 181 Mb for the non-svn-enabled version). At this point, the client user can proceed with the installation of Tiki as usual through the web interface that he will see when he goes to his website url; in this example: http://tiki01.example.com
Later on in step4 of the installation, he will need to provide the db credentials that were create for him in earlier step by the ispconfig admin (see above; in this example, db name: c1tiki01, db user: c1tiki01, and the db password you used at that step). |
1.14. Grant SVN to chrooted users | |
Run this: Copy to clipboard
Some users have reported to get error messages reporting that some folders are not owned by root:root, like this one below, Copy to clipboard
In such case, the problem was solved by changing ownership to root for these folders like etc, and running the first command jk_cp again: Copy to clipboard
|
1.15. PHP modes | |
PHP-FCGI is the default PHP mode used in ISPConfig3 admin panels. But you can change it to other PHP modes if desired.
The other PHP modes are:
We'll show how to fix some usual errors with some of them. |
1.15.1. Using PHP mode PHP-FCGI | |
1.15.1.1. Error 500 in PHP mode PHP-FCGI: Allow uploading bigger files than 1MbIf you hit error 500 when attempting to upload files bigger than 1 Mb, and error.log shows something like: Copy to clipboard
then you need to increase this directive in your vhost, to something like 2MB (131Kb by default) Copy to clipboard
More in: |
1.15.2. Using PHP mode PHP-FPM | |
You might want to use another PHP mode for your website. For instance, PHP-FPM (FastCGI Process Manager), which is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.. According to the ISPConfig3 pdf manual, you need to install these packages: Commands in a terminal Copy to clipboard
1.15.2.1. Error 500 in PHP mode PHP-FPM: File is not in document root of VhostYou may choose another PHP mode for your site. For instance, suPHP, or PHP-FPM. In such case, some features like replacing a file in a file gallery might produce this type of error 500: Copy to clipboard
As indicated here, the solution to this is to pop open the suphp config file (/etc/suphp/suphp.conf) and tell it to stop checking that scripts are under the document root like this: File edited: /etc/suphp/suphp.conf Copy to clipboard
And restart Apache. Copy to clipboard
You will get then this other error when visiting any url of the tiki site: Copy to clipboard
As indicated here, Suphp, by default, won't allow any scripts to run with a user or group ID under 100. Since Tiki has all its files installed owned by the user www-data (UID 33) when it's installed, this poses quite a problem. One solution is to set the min_uid and min_gid values in the suphp config file to 33 which allows the scripts to run as www-data. File edited: /etc/suphp/suphp.conf Copy to clipboard
Restart Apache, and you'll be able to replace files in file galleries again. Errors1.15.2.2. Unsolved error: Handler for (null) returned invalid result code 70007/14These errors are produced on some pages in one ISPConfig3-powered Tiki 12.x site, on intervals, and it doesn't seem an easily reproducible scenario to reproduce the errors: Copy to clipboard
or Copy to clipboard
Looking at the apache log, they seem to be triggered by tiki-register.php (when we had real users attempting to register to a course site), and edits to simple pages: Copy to clipboard
Those wiki pages contain some plugins, but they have been edited dozens of times, in a server without ISPConfig3, and in Tiki versions <= 11.x, and they never produced an error 500. PHP mode for that site is PHP-FPM. Googlging for these type of errors, nothing conclusive was found; just this type of information (e.g., from here): 7 is "time up" and 14 is "EOF", so the root cause of this is probably a read timeout during the upload. The 70000 prefix means they are APR status codes. They are logged poorly here because they the core of apache is expecting a different type of error code then what is returned — these are APR or "filter" return codes but the core of httpd is expecting a HTTP status code or 0 for OK. The most odd, is that, just waiting 5 minutes or so, and doing an F5 (browser refresh) of that edition of a wiki page, produced a normal output: page edited saved and shown, with no issues at all. So something related to server load? Internal Timeout? ... Hints welcome at xavi (a) tiki.org Alias names for this page: |