You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're using a <strong>Linux</strong> distribution derived from the Red Hat family, or which uses the <strong>yum</strong> package manager, you may need to follow the [CentOS 6](installation_centos6.md) installation instructions.
24
+
If you're using a <strong>Linux</strong> distribution derived from the Red Hat family, or which uses the <strong>yum</strong> package manager, you may need to follow the [CentOS 6](installation_centos6) installation instructions.
25
25
26
26
If you're using a <strong>Windows</strong> system, you'll have to download a web stack that holds the necessary requirements, such as [WAMPServer](http://www.wampserver.com/en/), plus [msysgit](http://msysgit.github.io/).
27
27
@@ -59,7 +59,7 @@ Provide your database credentials in the `app/config/database.php` file, accordi
59
59
After that you're ready to make composer work his magic! Run the following command from the root of the folder where you cloned the repository:
60
60
61
61
composer install
62
-
62
+
63
63
#### Add permissions to the log directory
64
64
65
65
To store logs and other files, the right permissions need to be set:
Copy file name to clipboardExpand all lines: app/controllers/docs/4.1/installation_centos6.md
+46-26Lines changed: 46 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,36 @@
1
-
Installation of The DataTank on CentOS 6.5
2
-
========================================
1
+
# Installation of The DataTank on CentOS 6.5
2
+
3
+
On this page you will learn
4
+
5
+
*[Background](#background)
6
+
*[Installation of basic packages](#installation)
7
+
*[Install Composer and download tdt/core](#composer)
8
+
*[Database setup and configuration](#database)
9
+
*[Hack composer.json and run the build](#hack)
10
+
*[Set up the webserver, configure permissions and the firewall](#webserver)
11
+
12
+
13
+
14
+
This guide was contributed by [Spike Williams](https://github.com/spikewilliams)
15
+
16
+
17
+
<aid='background'class='anchor'></a>
18
+
## Background
3
19
4
-
Background
5
-
----------
6
20
When installing The DataTank, users of CentOS 6 will need to make a choice about what version of PHP they will be using to support the installation. As CentOS 6.5 is based on Red Hat Enterprise Linux - with its preference for older packages that have a proven track record of stability - the default installation of PHP is version 5.3.3.
7
21
8
-
However, the Laravel 4.0 framework, which forms the foundation upon which TheDataTank is constructed, requires PHP 5.3.7 as the minimum version, and newer versions of Laravel bump that requirement up to PHP 5.4.0. Additionally, there are a number of [PHPUnit tests](https://github.com/tdt/core/issues/170) that come with The DataTank which use syntax that requires by PHP 5.4 and above.
22
+
However, the Laravel 4.0 framework, which forms the foundation upon which The DataTank is constructed, requires PHP 5.3.7 as the minimum version, and newer versions of Laravel bump that requirement up to PHP 5.4.0. Additionally, there are a number of [PHPUnit tests](https://github.com/tdt/core/issues/170) that come with The DataTank which use syntax that requires by PHP 5.4 and above.
9
23
10
24
Thus, there are two choices when it comes to running The DataTank on CentOS 6 -- either upgrade PHP to version 5.4.x, or make the modifications, detailed below, needed to install The DataTank using the default PHP 5.3.3 installation.
11
25
12
-
When feasible, upgrading PHP to 5.4.x is perhaps the better option, because it enables forward-compatibility and will support the full complement of PHPUnit tests. [Daniel Heramb](http://danielheramb.blogspot.com/2013/03/how-to-install-laravel-on-linux.html) has written some good instructions on installing PHP 5.4 as part of a Laravel installation.
26
+
When feasible, upgrading PHP to 5.4.x is perhaps the better option, because it enables forward-compatibility and will support the full complement of PHPUnit tests. [Daniel Heramb](http://danielheramb.blogspot.com/2013/03/how-to-install-laravel-on-linux.html) has written some good instructions on installing PHP 5.4 as part of a Laravel installation.
13
27
14
-
But there may be compelling reasons for remaining on PHP 5.3.3. There may be an organizational preference for utilizing default packages, or it may be necessary to maintain 5.3.x compatibility for other PHP applications running on the server. Drupal 7, for example, will run on PHP 5.4, but "prefers" 5.3, and may generate a rather large number of warnings when running PHP 5.4.
28
+
But there may be compelling reasons for remaining on PHP 5.3.3. There may be an organizational preference for utilizing default packages, or it may be necessary to maintain 5.3.x compatibility for other PHP applications running on the server. Drupal 7, for example, will run on PHP 5.4, but "prefers" 5.3, and may generate a rather large number of warnings when running PHP 5.4.
15
29
16
30
For cases where remaining on PHP 5.3.3 is considered the best option, the following installation instructions may be used. They have been successfully tested on a virtual machine running a fresh installation of CentOS 6.5. Additionally, many of the steps below will also be of use to those installing The DataTank on top of PHP 5.4.x on a Red Hat-family Linux distribution, as they reflect a yum-based installation, Red Hat-flavored directory structures, and instructions on a required SELinux security configuration.
17
31
18
-
# Installation of basic packages
32
+
<aid='installation'class='anchor'></a>
33
+
## Installation of basic packages
19
34
20
35
As the root user, use Yum to install git, curl, the MySQL client and Apache webserver:
21
36
@@ -24,7 +39,7 @@ As the root user, use Yum to install git, curl, the MySQL client and Apache webs
24
39
yum install wget
25
40
yum install mysql
26
41
yum install httpd
27
-
42
+
28
43
Install and start memcached:
29
44
30
45
yum install memcached
@@ -42,8 +57,8 @@ Install PHP core and various PHP libraries:
42
57
yum install php-pecl-apc
43
58
yum install php-xml
44
59
45
-
The following package was recommended for optimization, but is not available in the default repositories. It is listed here for completeness only; you do not need to install it - and, indeed, may not be able to.
46
-
60
+
The following package was recommended for optimization, but is not available in the default repositories. It is listed here for completeness only; you do not need to install it - and, indeed, may not be able to.
61
+
47
62
yum install php-pecl-zendopcache
48
63
49
64
There are some additional PHP packages which must be installed from the Extra Packages for Enterprise Linux (or EPEL) RPM repository, which is a repository of Red Hat compatible binaries supported by the Fedora community. Use the following commands to install the EPEL repository
@@ -56,7 +71,8 @@ With the EPEL repository installed, you will now be able to install these two PH
56
71
yum install php-mcrypt
57
72
yum install php-mbstring
58
73
59
-
# Install Composer and download tdt/core
74
+
<aid='composer'class='anchor'></a>
75
+
## Install Composer and download tdt/core
60
76
Use the following commands to install Composer and put it in the path:
61
77
62
78
curl -sS https://getcomposer.org/installer | php
@@ -68,10 +84,11 @@ Create an installation directory and bring in the tdt code using git:
68
84
cd /opt/tdt
69
85
git clone https://github.com/tdt/core.git
70
86
71
-
# Database setup and configuration
87
+
<aid='database'class='anchor'></a>
88
+
## Database setup and configuration
72
89
If MySQL is to be hosted locally, install and start the MySQL server:
73
90
74
-
yum install mysql-server
91
+
yum install mysql-server
75
92
/etc/init.d/mysqld start
76
93
77
94
Configuring security on MySQL is outside the scope of this document. However, the following lines of SQL used to create a database and user are included for your convenience. Log into your MySQL prompt, and type the following:
@@ -94,43 +111,45 @@ Be sure to use a better password than the one provided above. Add these settings
94
111
'prefix' => '',
95
112
)
96
113
97
-
# Hack composer.json and run the build
114
+
<aid='hack'class='anchor'></a>
115
+
## Hack composer.json and run the build
98
116
99
117
For installing on PHP 5.3.3, this is where things get tricky. Those who are installing on 5.4.x can skip the edits to composer.json listed below, and move on to running composer, at the end of this section.
100
118
101
-
The reason Laravel requires PHP 5.3.7 at a minimum is that it requires bcrypt-based hashing, which is not available in 5.3.3. Howerver, [Rob Clancy](https://github.com/robclancy/laravel4-hashing) has provided a patch which overrides the bcrypt hashing code with a hash using the sha5 algorythm. Enable this patch by adding the following to the top of the "require" section of tdt's core/composer.json file:
119
+
The reason Laravel requires PHP 5.3.7 at a minimum is that it requires bcrypt-based hashing, which is not available in 5.3.3. However, [Rob Clancy](https://github.com/robclancy/laravel4-hashing) has provided a patch which overrides the bcrypt hashing code with a hash using the sha5 algorythm. Enable this patch by adding the following to the top of the "require" section of tdt's core/composer.json file:
102
120
103
-
* "robclancy/laravel4-hashing": "dev-master",
121
+
"robclancy/laravel4-hashing": "dev-master",
104
122
105
123
You will also need to trick the Composer build process into using Laravel 4.0.10 instead of 4.1.x. This is because the 4.1 series of Laravel requires PHP 5.4, and will not run with 5.3. Thus, in the same core/composer.json file as above, edit the line that referes to "laravel/framework", as follows:
106
124
107
-
* "laravel/framework": "4.0.10 as 4.1.10",
125
+
"laravel/framework": "4.0.10 as 4.1.10",
108
126
109
127
Now, run composer - this could take 20 minutes or so, depending on your setup.
110
-
128
+
111
129
cd core
112
130
composer install
113
131
114
-
# Set up the webserver, configure permissions and the firewall
132
+
<aid='webserver'class='anchor'></a>
133
+
## Set up the webserver, configure permissions and the firewall
115
134
116
135
Create a shortcut under Apache's content directory to the publicly exposed portion of your installation:
117
136
118
137
ln -s /opt/tdt/core/public /var/www/html/tdt
119
-
138
+
120
139
Edit the Apache configuration file, located at /etc/httpd/conf/httpd.conf:
121
140
122
141
* Under the configuration for <Directory "/var/www/html">, change <i>AllowOverride None</i> to <i>AllowOverride All</i>
123
-
142
+
124
143
This directory needs to be made fully accessible to the application:
125
-
144
+
126
145
chmod -R 777 /opt/tdt/core/app/storage/
127
146
128
147
Even with 777 permissions, SELinux will prevent the app from accessing that directory unless you explicitly provide that permission. Use the following command:
Alternately, if you are on a non-production machine and you just want to turn SELinux off, do this:
133
-
152
+
134
153
echo 0 > /selinux/enforce
135
154
136
155
Start the webserver
@@ -142,7 +161,8 @@ Finally, if you want to access this site from a browser on a different machine,
142
161
* -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
143
162
144
163
Then, restart the iptables firewall:
145
-
164
+
146
165
/etc/init.d/iptables restart
147
166
148
167
The DataTank should now be installed and running at http://[Your.IP.Address]/tdt/. The admin console is located at http://[Your.IP.Address]/tdt/api/admin. The default username and password are both "admin."
0 commit comments