Installation

From The Smartest Wiki
Jump to: navigation, search

Requirements

Most of the time, installing Smartest is extremely easy. There are a few common requirements that make Smartest able to be as fast and secure as it is.

PHP Versions

Despite its advanced feature set, Smartest is supported and runs perfectly on PHP 5.3, 5.4, 5.5 and 5.6.

Support for PHP 5.2 has been dropped. Versions of Smartest with server-side responsive functionality (After revision 668) do not support PHP 5.2.

Setting permissions

To install Smartest, you will need to be able to set file and folder permissions (read,write,execute) on your server. This can usually be done via most FTP clients, and of course is also possible via a shell or terminal. If you have shell access to your copy of Smartest, it is quicker to run the shell script generated by the installer that sets the permissions for you.

Create databases

Smartest needs its own database. Currently only MySQL is supported, but support for MariaDB and PostgreSQL will be implemented if there is enough demand. Installation of Smartest will require a database, plus a database user account with CREATE and ALTER permissions, as well as the standard SELECT, INSERT, DELETE, UPDATE.

URL Rewriting

Smartest uses URL rewriting heavily. Under Apache, this requires the use of mod_rewrite. Other web servers can be used, but the crucial requirement is that all requests for non-literal (ie non-existent) file paths are mapped to:

YOUR_SMARTEST_DIR/Public/index.php

Configuring Apache

Under Apache 2, the directory where your Smartest installation lives should be set up like so:

<Directory /YOUR_SMARTEST_DIR/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

And your VirtualHost entry should look something like this:

<VirtualHost *:80>                                                                                                                                     
    DocumentRoot /YOUR_SMARTEST_DIR/Public/                                                                                                              
    ServerName www.yourhostname.com                                                                                                                                
    ServerAlias yourhostname.com                                                                                                                                   
</VirtualHost>

A .htaccess file will be generated automatically for you when you run the installer.

Configuring Nginx

Your Nginx server block should look like this:


server {

        listen 80;
        listen [::]:80;

        root /YOUR_SMARTEST_DIR/Public/;
        index index.php;

        # Make site accessible from http://HOSTNAME/
        server_name HOSTNAME;
        
        # If you are using HHVM, uncomment this line
        # include hhvm.conf;
        # Otherwise:
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #      NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
        #
        #       # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
        #       fastcgi_pass unix:/var/run/php5-fpm.sock;
        #       fastcgi_index index.php;
        #       include fastcgi_params;
        }

        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ /\.ht {
                deny all;
        }

}

Installation steps

To start the installer, simply place your copy of Smartest on a web server, and access its Public/ directory. It is recommended that you set up Smartest with its own host name. The document root for this host name (Virtual Host in Apache terms) should point to Smartest's Public/ directory.

Smartest's installation has four simple steps:

  1. Set Folder Permissions
  2. Set up database access
  3. Choose admin user account details
  4. Choose site name and domain

Setting permissions

Smartest will present you with a list of places in the filesystem that the web server needs to be able to write files. You can change these to being writable one at a time, or run the shell script that Smartest will automatically generate for you, which will be instant and save you some time.

Database settings

Next you'll be asked to give Smartest some details so that it can access the database and build the table structure that it will use to store your data.

You'll need to provide:

  • The name of a database
  • A username for an account with access to this database, and with CREATE and ALTER permissions
  • A password for that same account
  • Database hostname, which should be 'localhost' unless you are an advanced user and know what you're doing. Enough said.

Admin user account details

Next you'll asked to choose how you will log in to Smartest. More user accounts can be created later, but the account you create here will be a root user within Smartest's permission system. At the top of the form, you'll give a username, and a password, twice to be sure. Below that, you'll input your full name and email, which both personalises Smartest's interface and makes it possible for Smartest to send you notifications by email.

SIte details

Finally, you'll choose your first site's name and hostname. Then click "Finish and Log in" and use the username and password you chose in step 3.