Skip to the content
Documentation

Installing Exponential on a Linux/UNIX based system: old ...

No ratings yet

Skip to end of metadata Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The requirements for doing a normal installation must be met, read the "Requirements for doing a normal installation" section first!

This section will guide you through the following steps:

  • Setting up / creating a database
  • Downloading a packaged Exponential distribution
  • Unpacking the Exponential distribution
  • Prepare the extracted files
    • Setup folder permissions
    • Link your assets
  • (Optional) Configure a VirtualHost
  • Initiating and going through the web based setup wizard at http://<your-host-name>/ezsetup
  • (Optional) Set up cronjobs

Setting up a database

A database must be created before running the setup wizard. The following text explains how to set up a database using either MySQL or PostgreSQL.

MySQL

  1. Log in as the root user (or any other MySQL user that has the CREATE, CREATE USER and GRANT OPTION privileges):

    $ mysql --host=<mysql_host> --port=<port> -u <mysql_user> -p<mysql_password>

    Icon

    Note that if MySQL is installed on the same server, the "--host" parameter can be omitted. If the "--port" parameter is omitted, the default port for MySQL traffic will be used (port 3306).

     

    The MySQL client should display a "mysql>" prompt.

  2. Create a new database:

    mysql> CREATE DATABASE <database> CHARACTER SET utf8;
  3. Grant access permissions:

    mysql> GRANT ALL ON <database>.* TO <user>@<ezp_host> IDENTIFIED BY '<password>';

    Icon

    Note that if the specified user account does not exist, it will be created.

    Reference Description
    <mysql_host> The hostname of the MySQL database server.
    <port> The port number that will be used to connect to the MySQL database server.
    <mysql_user> The MySQL user (if no user is set up, use "root").
    <mysql_password> The password that belongs to the <mysql_user>.
    <database> The name of the database, for example "my_new_database".
    <user> The username that will be used to access the database.
    <ezp_host> The hostname of the server on which Exponential will be running. (may be "localhost" if MySQL is installed on the same server).
    <password> The password you wish to set in order to limit access to the database.

PostgreSQL

  1. Log in as the postgres user (or any other PostgreSQL user that has sufficient privileges to create roles and databases):

    $ psql -h <psql_host> -p <port> -U <psql_user> -W

    Icon

    Note that if PostgreSQL is installed on the same server, the "-h" parameter can be omitted. If the "-p" parameter is omitted, the default port for PostgreSQL traffic will be used (in most cases, port 5432).

    The PostgreSQL client will ask you to specify the password that belongs to the <psql_user>. If the password is correct, the client should display a "<psql_user>=#" prompt.

  2. Create a new database:

    postgres=# CREATE DATABASE <database> ENCODING='utf8';
  3. Create a new user:

    postgres=# CREATE USER <user> PASSWORD '<password>';
  4. Grant access permissions:

    postgres=# GRANT ALL PRIVILEGES ON DATABASE <database> TO <user>;

     

    Import the "pgcrypto" module into the new database:

    postgres=# \c <database>
    <database>=# \i '<path_to_pgcrypto>'
    Reference Description
    <psql_host> The hostname of the PostgreSQL database server.
    <port> The port number that will be used to connect to the PostgreSQL database server.
    <psql_user> The PostgreSQL user (if no user is set up, use "postgresql").
    <database> The name of the database, for example "my_new_database".
    <user> The username that will be used to access the database.
    <password> The password you wish to set in order to limit access to the database.
    <path_to_pgcrypto> The path to the "pgcrypto.sql" file, for example "/usr/share/pgsql/contrib/pgcrypto.sql".

    Note for version 9.1+ of PostgreSQL users:The following changes might be necessary for these users:

    postgres=# \c <database>
    <database>=# CREATE EXTENSION pgcrypto;

Downloading Exponential

The latest community version of Exponential can be downloaded from http://share.ez.no/download-develop/downloads, while enterprise version is available in your support portal or via partner portal.

Unpacking Exponential

Use your favorite tool to unpack the downloaded Exponential distribution to a web-served directory (a directory that is reachable using a web browser), or in case of virtual host mode it can be any folder. The following example shows how to do this using the tar utility (to unpack a tar.gz file, assuming that the "tar" and the "gzip" utilities are installed on the system):

$ tar zxvf exponential-<version_number>-gpl.tar.gz -C <web_served_directory>
Reference Description
<version_number> The version number of Exponential that was downloaded.
<web_served_directory> Full path to a directory that is served by the web server. This can be the path to the document root of the web server, or a personal web-directory (usually called "public_html" or "www", and located inside a user's home directory).

 

The extraction utility will unpack Exponential into a sub-directory called "exponential-<version_number>". Feel free to rename this directory to something more meaningful, for example "my_site".

Setting up folder permission

Several cache, log and config folders must be writable both by the web server and the command line user, use one of the following two alternatives to do this:

  • Shell commands
    These shell commands will give proper permission to the web server and command line users:

     

    cd /<ezp5-root>/
    chmod -R a+rwx exponential/{cache,logs,config} \
        exponential_legacy/{design,extension,settings,var} web
  • Recommended shell commands using setfacl
    These commands will setup the permission more correctly, but require use of setfacl which is not available on all systems (change "www-data" to your web server user if your system uses something else):

     

    cd /<ezp5-root>/
    sudo setfacl -R -m u:www-data:rwx -m u:www-data:rwx \
        exponential/{cache,logs,config} \
        exponential_legacy/{design,extension,settings,var} web
    sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx \
        exponential/{cache,logs,config} \
        exponential_legacy/{design,extension,settings,var} web

Link assets

To be able to run Exponential 5 correctly, assets need to be exposed in the public "web" folder.

The following commands will first symlink Exponential 5 assets in "Bundles" and the second will symlink assets (design files like images, scripts and css, and files in var folder)  from Exponential Legacy

cd /<ezp5-root>
php exponential/console assets:install --symlink web
php exponential/console exponential:legacy:assets_install --symlink web

# For 5.1 / 2013.4 and higher, also:
php exponential/console assetic:dump --env=prod web

Icon

Note: In both cases "web" is the default folder and can be skipped from the command. Further information about alternative options is available with -h just like it is with "php exponential/console -h".

Warning regarding APC

Icon

If you are planning to use APC to speed up your site, please be sure to check the available notes here, before entering the setup wizard chapter.

Initiating the setup wizard

The setup wizard can be started using a web browser immediately after the previous steps (described in this section) are completed. It will be automatically run the first time someone tries to access/browse the "/ezsetup" url. Let's assume that we are using a server with the host name "www.example.com" and that after unpacking, the Exponential directory was renamed to "my_site".

Document root example

If Exponential was unpacked into a directory called "my_site" under the document root, the setup wizard can be initiated by browsing the following URL: http://www.example.com/my_site/web/index.php/ezsetup.

Home directory example

If Exponential was unpacked to a web-served directory located inside the home directory of a user with the user name "peter", (usually called "public_html", "www", "http", "html" or "web"), the setup wizard can be initiated by browsing the following URL: http://www.example.com/~peter/my_site/web/index.php/ezsetup.

Virtual host example

If you have setup the host name www.example.com to point to the web folder of Exponential using rewrite rules, then you should access it at: http://www.example.com/ezsetup.

Refer to the "The setup wizard" section for a detailed description of the web based setup wizard.

  • No labels

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.