安装
您不必成为Web开发人员或程序员来安装Tiki。 Tiki有一个易于使用,基于向导的安装程序,它将为您完成大部分工作。其余的可以从你的虚拟主机的控制面板完成。你也可以使用tw:1-click installers.
如果你是一个完整的新手(或者只是不进入DIY(即do it yourself)'' ) 考虑使用 tw:Tiki friendly hosts,来完成您的Tiki安装。
概观
这些视频提供了Tiki安装的基本概述。参阅Tiki TV 和 Tiki Movies 获取更多视频。
分步安装
在你开始之前
在安装Tiki之前,请阅读Requirements 并使用 Server Check 工具。适当的规划可确保无忧安装。如果您需要Tiki的虚拟主机,请参阅tw:Tiki Friendly Hosts.
这些说明有意通用,并应适用于大多数共享主机安装。参阅Installation Guides 有关操作系统和Web服务器特定组合的说明。
先决条件
在开始教程前请准备
- 通过FTP或SSH(shell)访问PHP5 Web服务器(如Apache)
- 访问MySQL数据库(应由您的虚拟主机提供)
1.1. 创建数据库
Tiki需要一个MySQL数据库。
许多主机提供点击界面来创建数据库和数据库用户。例如,如果您的虚拟主机有cPanel 你大概可以查看 phpMyAdmin 在主菜单或标记为“Databases”的部分中。
创建数据库(和数据库用户)是一个非常简单的操作。本质上,您将创建一个空的(empty)数据库,Tiki安装程序稍后将填充正确的表和数据。
数据库设置的三个步骤
- 创建一个数据库。
- 您可以将数据库命名为任何您想要的名称,但不要使用该名称 - 您可以使用tiki。根据您的虚拟主机,您在phpMyAdmin中的完整数据库可能被列为accountname_tiki.
注意: 默认情况下,Tiki使用UTF-8来进行数据库编码。我们强烈建议您选择"utf8" 在 "collation" 在phpmyadmin(或类似的软件中)下拉框中,在下图中显示的字段中:
如果您选择不同的编码方式,您可能需要手动更新 ../db/local.php 文件。
小窍门: 如果您计划安装多个Tiki,请不要使用tiki作为数据库名称。 - 一定要记录数据库名称,稍后您将需要它。
- 您可以将数据库命名为任何您想要的名称,但不要使用该名称 - 您可以使用tiki。根据您的虚拟主机,您在phpMyAdmin中的完整数据库可能被列为accountname_tiki.
- 创建一个数据库user(带密码)。
- Again, don't get fancy with the database username. 实际上,您可以使用与数据库相同的名称(在步骤1中)。
- 选择一个高强度密码。如果需要,您可以轻松地恢复数据库用户名和密码(通过查看Tiki目录中的 - +../db/local.php+ - 文件)。
- 一定要记住用户名和密码。您稍后需要它。
- 将all数据库权限分配给您创建的数据库用户(在步骤2中)。
恭喜。您现在有一个可以使用的数据库以及具有必要权限的数据库用户(和密码)。
1.2. 直接从SVN仓库安装Tiki
该方法需要a。一个具有shell(命令行)访问权的服务器和b这个服务器上正在运行的SVN实例。
对于SVN部分,请查看页面dev:Get+Code。在这个页面上,如果需要的话还有相关的页面,你会发现有关SVN命令的注释以及你需要在命令行中使用的特定路径来自动检出或更新正确的Tiki版本到预期的安装目录(tikiroot folder)。
一个新校验的例子(也推荐用于主要升级)
Method 1
创建一个新的文件夹(您将指定)
$ svn checkout https://svn.code.sf.net/p/tikiwiki/code/branches/15.x mynewfolder
Method 2
检出到当前文件夹(当您创建预期的tikiroot并在校验前将其更改到此目录中):
$ svn checkout https://svn.code.sf.net/p/tikiwiki/code/branches/15.x .
次要更新示例:
不要忘记切换到你想要更新的Tiki的tikiroot
$ svn up
你现在必须运行 composer!
composer 将从外部来源自动下载并安装所谓的 'vendor files' 。
供应商文件是外部脚本和库,我们不在自己的仓库中进行管理。
这些供应商文件的例子是Bootstrap代码,jQuery库,Tablesorter,Elfinder等。
在大多数服务器上,你还必须修改某些文件权限。
两者都可以通过在shell (即 command line) 中启动setup.sh脚本之后回答许多问题来完成。
This procedure is quite self-explaining. Just follow the instructions of the script.
启动setup.sh,(在tikiroot中)::
$ sh setup.sh
有关使用setup.sh的更多信息,另请参阅下面的1.4.1故障排除部分或运行 sh setup.sh -h
。在本节中,我们仅处理Composer部分,该部分仅适用于使用存储库中的安装。
要启动Composer,您必须在启动setup.sh脚本后使用选项 "c":
$ sh setup.sh Your choice [c or f]? c
FAQ: 在我的服务器上,composer脚本没有启动。当我收到以下错误消息时,我该怎么办?
Wrong PHP version: phpABC < required PHP version. A version >= phpXYZ is necessary.
The problem is, that many shared hosting providers keep the setting of the default local PHP version of the shell (command-line) to an outdated PHP version which does not match the PHP requirements of Tiki or of the composer. Alternativ PHP settings in the .htaccess or in the php.ini file or in the user.ini file have no effect to the PHP version in the shell (command line).
However most of these servers have newer PHP versions available in the shell (command line), which can be used alternatively.
For Tiki 16, likely soon backported to Tiki 15, an option is provided that allows composer to be run with an alternative up-to-date PHP version, given that one is available on the particular server.
Another issue to be addressed is that providers have different naming conventions regarding how to distinguish their available PHP versions. To address this issue, the option "-p" is implemented for the setup.sh script to provide the option to manually change the PHP version used by the script:
$ sh setup.sh -p PHPVERSION
在第一步中,setup.sh脚本会自动查询普遍在许多服务器上使用三种常用版本的最新版本,,并使用第一个匹配的版本:
php55 php5.5 php5.5-cli
如果脚本找到其中之一,则应在自动启动composer之前收到以下消息:
Wrong PHP version: phpABC < required PHP version. A version >= phpXYZ is necessary. Searching for typically named alternative PHP version ... ... correct PHP version phpDEF detected and used Local PHP version >= required PHP version XYZ - good Loading composer repositories with package information Installing dependencies from lock file (...)
现在你完成了。问题解决了。
此外 如果这些选项都无法解决,您将收到以下错误消息:
Wrong PHP version: phpABC < required PHP version. A version >= phpXYZ is necessary. Searching for typically named alternative PHP version ... ... no alternative php version found. Please provide an alternative PHP version with the -p option. Example: sh setup.sh -p phpXYZ. You can use the command-line command 'php[TAB][TAB]' to find out available versions.
This should be self-explanatory. You simply have to use the php command in the shell, followed by twice typing the TAB key without any space or other key and then the Enter. Then the shell (command line) will provide a list of the available PHP versions which you can use (obviously using the naming convention used on the particular server):
例子:
$ php[TAB][TAB] php php-53 php-54 php-55 php-56 php-70
如何使用这些信息:
鉴于所需的PHP版本是php 5.5,但您的提供者默认使用php 5.3,您只需输入以下命令以启动setup.sh并为composer(在这个特殊情况下php-55)使用正确的PHP版本。 ...
$ sh setup.sh -p php-55 Your choice [c]? c
然后,setup.sh将在以下消息之后使用php 5.5启动composer:
Wrong PHP version: phpABC < required PHP version. A version >= php55 is necessary. Searching for typically named alternative PHP version ... ... correct PHP version php55 detected and used Local PHP version >= required PHP version 55 - good
如果您知道安装了较新版本的php,但是它不是通过上面的TAB方法找到的,则表示它不在您的PATH环境变量中。如果你能找到它的位置,你可以使用-p选项和完整路径,如:
$ sh setup.sh -p /opt/rh/rh-php70/root/bin/php Your choice [c]? c
Now you need only to follow the setup.sh dialog to fix directory permissions (option f is reasonably secure works on most average servers. If you need a more secure setting or if your server needed a less restrictive setting (better change the server then), you can use another option. To find out which permission option is best n your server, you can use Permission Check.
你现在就完成了,可以去你的网站运行安装程序。
1.3. 安装Tiki release文件
1.3.1. 下载并解压缩
Download the current version of Tiki to your local computer from http://tiki.org/download.
The full Tiki archive file download is 20-50MB depending on the version and compression (zip, bz2, etc,).
After downloading the Tiki archive file, decompress (unzip) the file to your local PC.
1.3.1.1. 上传到您的虚拟主机
Use FTP (or SCP, SFTP, Rsync, SSH, etc) to connect to your webhost.
Once connected, find your web directory. It is often called www
or public_html
.
注意: 此目录名称可能会有所不同,具体取决于您的网络主机的设定
将所有Tiki文件从您的PC上传到您的网络主机。
- If you upload the Tiki files to the root of your web directory, Tiki will be accessible directly from the URL: http://example.org
- If you have installed (or plan to install) other applications on your webhost, you may consider putting Tiki in its own subdirectory (for example: http://example.org/tiki/). Keep in mind that this might mean that you will have to manually edit the file .htaccess to activate the Tiki subdirectory (for example this "RewriteRule ^(.+)$ /tiki-index.php?page=$1 [QSA,L]" might need to become this "RewriteRule ^(.+)$ /tiki/tiki-index.php?page=$1 [QSA,L]")
1.3.1.2. 示例1:使用lftp进行安装
lftp -u username ftp.example.com
lcd /path/to/local/tiki
cd /path/to/web/tiki
set ftp:ssl-allow no
mirror -R ./
A ftp testing upload session to an external webhoster needed approximately two hours, and the limitation was the provider's setting. The local internet connection was not saturated.
Time for more coffee?
1.3.1.3. 示例2:使用shell访问进行安装
Run setup.sh to set permissions on the directories. The defaults should do.
/var/www/tiki# sh setup.sh
1.4. 转到您的网站并运行安装程序
Open your web browser and access the web directory in which you copied the Tiki files (for example: http://example.org/tiki/ or simply http://example.org if you copied Tiki to the root of your web directory.
After a fresh installaton, the installer starts automatically. Tiki will switch to the URL yoursite.tld/path/to/tikiroot/tiki-install.php or yoursite.tld/tiki-install.php .
After a minor update (for ex via the command line using "svn up") you will have to type in the url manually to the address bar of your browser.
The Tiki Installer Welcome screen appears.
From Tiki for Dummies Smarties
You should see a message indicating that Tiki could not connect to the database and prompting you to run the Tiki installer (tiki-install.php).
The Tiki Installer includes important links to the ReleaseNotes and Documentation. Be sure to review these documents before installing Tiki.
1.4.1. Troubleshooting
2012-09: A new Server Check script has been developed that will make everything easier! Just upload a single PHP file to your server and you will get advice on your server configuration.
If your browser returns an error such as Parse error: syntax error, unexpected T_STRING, you may have the incorrect PHP version.
Starting with Tiki 3.0, Tiki requires PHP5. Review the _htaccess file included in the Tiki archive file for instructions on activating PHP5.
See the Tiki FAQs for more help.
1.4.2. File and Folder permissions
If your server is unhappy with Tiki file and folder permissions (this is dependent on server configuration), you may get an error message or blank pages. These failed attempts are typically in the error log (ask your web host to know where they are as it's different depending of your setup)
Too few permissions
If a message appears indicating that specific directories are not writable, you will need to change the permissions on the indicated directories. Tiki will attempt to verify that it can read (and write) to all necessary directories. This error message will include instructions about how to resolve the issue.
Too many permissions
If you are getting Internal Server Error 500, blank pages or similar, it could be that the permissions on the files are not appropriate for your webhost.
If your permissions are currently at "777", use your FTP client to change the files to "755". If Tiki is installed in a directory, make sure to also change the permission of the folder which contains the tiki files.
If you have shell access, you can run:
sh setup.sh
and answer any questions. If you don't know what to answer, just click "enter" to keep the defaults.
root@yourserver:/var/www/tiki# sh setup.sh Tiki setup.sh - your options ============================ Composer: If you are installing via a released Tiki package (zip, tar.gz, tar.bz2, 7z), you can and should skip using Composer. If you are installing and upgrading via SVN, you need to run Composer after 'svn checkout' and 'svn upgrade'. More info at https://dev.tiki.org/Composer c run composer and exit (recommended to be done first) For all Tiki instances (via SVN or via a released package): f fix file & directory permissions (classic default) o open file and directory permissions (classic option) S clear screen predefined Tiki Permission Check models: ---------------------------------------- 1 paranoia 2 paranoia-suphp w suphp workaround 3 sbox W sbox workaround 4 mixed 5 worry 6 moreworry 7 pain 8 morepain 9 risky a insane q quit x exit There are some other commands recommended for advanced users only. More documentation about this: https://doc.tiki.org/Permission+Check Your choice [f]?
The option preselected in "Our choice" will initially be "c", to run "composer" script and get the required php dependencies for you. and in a second step, it will suggest "f", to fix file and directory permissions (classic default option). You can choose at any time the letter that best suits your needs, among the options offered.
If "sh setup.sh" doesn't work for you, you may try, in your ./tiki/ directory
chmod -R 777 ./db ./dump ./img/wiki ./img/wiki_up ./img/trackers ./modules/cache ./temp ./temp/cache ./temp/templates_c ./templates ./styles ./whelp/
Another way is to set permissions for all directories and then set permissions for all files. For example, to set the permissions for all directories to 777 and the permissions for all files to 644, use the following separate commands through shell access:
find [YOURDIR] -type d -exec chmod 777 {} \; find [YOURDIR] -type f -exec chmod 644 {} \;
After correcting any directory or file permission problems, visit tiki-install.php to continue.
1.4.3. SuPHP Problems
Systems with SuPHP need permissions 755 at maximum. Group must not be allowed to write. This includes the complete path in the filesystem, not only document root of the webserver. Wrong permissions may lead to 500 Internal Server Error here. On the other hand less permissions (namely 750 without x/execute/subdir entry for webserver) may lead to 403 Forbidden Error.
1.4.4. Permission Matrix
Several usecases and minimum to maximum permissions you may try if something doesn't work properly. Permissions refer to data directly accessed by the webserver (files included by Tiki itself may and should have less permissions):
Ownership username:groupname | no SuPHP files / subdirectories | with SuPHP
files / subdirectories |
webserver:webserver | 600 - 666 / 700 - 777 | ?
|
user:user | 604 - 666 / 705 - 777 | 600 - 644 / 701 - 755
|
user:webserver | 660 - 666 / 770 - 777 | ?
|
webserver:user | 660 - 666 / 770 - 777 | ? |
1.4.4.1. Option
find . -type d -exec chmod 755 {} \; ; chmod 755 . ; find . -type f -exec chmod 755 {} \; ; chmod 751 db/local.php
1.4.4.2. Option
The following commands might be useful. In particular, it might help you use an IDE (PhpStorm), etc:
$ export PathToTiki="/var/www/tiki" $ export WebServerOwner="www-data" $ sudo usermod -aG ${WebServerOwner} $(whoami) $ sudo chown -R ${WebServerOwner}: ${PathToTiki} $ sudo chmod -R g+rw ${PathToTiki}
In English, the above code adds you to the web-server group; forces the tiki tree to be owned by the web-server user and group; and then makes sure the tiki tree is readable and writable by the web-server group (you). Suggestions welcome!
1.5. 运行Tiki安装程序 (tiki-install.php)
打开Web浏览器并输入: http://example.org/tiki-install.php (或者 http://example.org/tiki/tiki-install.php 如果你在一个子目录中安装Tiki)。
Tiki安装程序的第一页出现,此安装程序将允许您:
- 选择一种语言
- 测试您的服务器设置
- 如果安装程序检测到某些服务器设置不合适,则会提示更改以符合requirements.
- 输入您的数据库主机,名称,用户名和密码。
这是您之前创建的数据库中的信息。你 记得 写下来吧!对于非默认端口号使用语法 "example.com;port=3307" - Create/update the database
- 注意:在osx安装上,mysql套接字有点不同。在 /etc/php.ini, 改变所有的实例为 /var/mysql/mysql.sock to /tmp/mysql.sock 然后重新启动Web服务器
- 设置一些首选项,例如管理员电子邮件
- 禁用安装脚本
- 还有更多
完成Tiki安装程序的每个页面。
1.5.1. 安装期间的安全选择
安装过程中有几个重要的安全选择,如下所示:
1.5.1.1. 安全登录
在安装期间配置常规设置时,可以选择 "要求安全(https)登录"。建议选择此选项,以便在浏览器和站点服务器之间发送的数据保持私密。
为了实现安全登录,除了选择此选项之外,您还需要为您的域提供安全证书和专用IP地址。这些可以从您的网络托管公司获得或购买,如果是安全证书,则可以从第三方获得。
1.5.1.2. 为安装程序上锁
In the last step of the installer, the installer is locked by default once you click the button to enter your Tiki. There is an option to elect to not lock the installer in that last step of the installation. It is highly recommneded that you lock the installer for any production site. The option is provided for concenience for development sites only. The installer allows a user to change or destroy the site's database through the browser so it is very important to keep it locked once the installation or upgrade is complete.
1.5.2. 可选的“步骤5”,不使用tiki-install.php。
If you are unable to complete the Tiki Installer, continue with a Manual Installation.
1.6. Log in for the first time
Log in using the login box in the right-hand column.
- Enter this information:
- user: Enter admin
- pass: Enter admin
- Click login.
1.7. Change the default password.
Use a strong password. You may want to logout right away, and login again, letting your password manager record your password.
1.8. Congratulations!
It is recommended to create a new user and give him admin privileges instead of regularly using the admin account. You can now explore the interface but you should check the extra steps before to get you started.
1.9. Configure Your Tiki
Please visit Initial Configuration to explain the recommended next steps, or configuration for the table of contents related to configuring Tiki.
Add new features through post-install Profiles
You can enable a set of settings/permissions/content features in a single action, in order to provide a common feature at your Tiki site (make it multilingual, add freetags, configure it as a collaborative environment, etc.) with a just few clicks using the Profile Manager from "Admin > Profiles".
Read more about it at Profiles.
For more information on the Tiki installation process...
Related pages:
Installation FAQ Installation Guides - recipes, tips and detailed knowledge about specific hosting environments Migrate to Tiki Move Tiki to a new server Reinstall - to point tiki to a new database or re-run an upgrade |
Tiki in Ten minutes - a recipe for command line installations. Fantastico Installation Using SSH (for newbies) Manual Installation MultiTiki |