Message-ID: <644418483.4044.1485856452187.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_4043_486270391.1485856452187" ------=_Part_4043_486270391.1485856452187 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Installing eZ Publish on a Linux-UNIX based system

Installing eZ Publish on a Linux-UNIX based system

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

Installing eZ Platform?

This page covers install of eZ Publish 5.x (includi= ng community versions like v2014.11), for eZ Platform= see INSTALL.md bundled with t= he installation.

 

This section will guide you through the following steps:

=20 =20

Follow the status labels for the right version :=20 5.= X=20 5.0= 5.1 5.2 =20 >= =3D 5.3 / 2014.05

Setting up a database 5.X

A database must be created before running the setup wiz= ard. The following text explains how to set up a database using either MySQ= L or PostgreSQL.

MySQL

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

    =20
    # mysql --host=3D<mysql_host> --port=3D<port> -u <m=
    ysql_user> -p<mysql_password>
    =20

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

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

  2. Create a new database:

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

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

    Note that if the specified user account does not exist, it will be creat= ed.

    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 dat= abase.
    <ezp_host> The hostname of the server on which eZ Publish w= ill be running. (may be "localhost" if MySQL is installed on t= he same server).
    <password> The password you wish to set in order to limit a= ccess to the database.

PostgreSQ= L

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

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

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

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

  2. Create a new database:

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

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

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

     

    Import the "pgcrypto" module into = the new database:

    =20
    postgres=3D# \c <database>
    <database>=3D# \i '<path_to_pgcrypto>'
    =20
    Reference Description
    <psql_host> The hostname of the PostgreSQL database server.<= /td>
    <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 dat= abase.
    <password> The password you wish to set in order to limit a= ccess 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 followin= g changes might be necessary for these users:
    =20
    postgres=3D# \c <database>
    <database>=3D# CREATE EXTENSION pgcrypto;
    =20

Downloading eZ Publish 5.X

The latest community version of eZ Publish can be downloaded from=20 http://share.ez.no/downloads

Enterprise version is available in your support portal or via partne= r portal.

Unpacking eZ Publish 5.X

Use your favorite tool to unpack the downloaded eZ Publish distribution = to a web-served directory (a directory that is reachable using a web browse= r), 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 fil= e, assuming that the "tar" and the "gzip" utilities are installed on the sy= stem):

=20
$ tar zxvf ezpublish-<version_number>-gpl.tar.gz -C <web_serv=
ed_directory>
=20
Reference Description
<version_number> The version number of eZ Publish that was downlo= aded.
<web_served_directory> Full path to a directory that is served by the w= eb 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 eZ Publish into a sub-directory calle= d "ezpublish-<version_number>". Feel free to rename this= directory to something more meaningful, for example "my_site"= .

Setting up folder permission 5.X

Important

In the 3 first folder permission setup options, always ensure to run app= lication scripts and the web server with the appropriate UNIX user (must be= same as you setup rights for below).

As for Apache you can control which user to use in your Apache configura= tion. Using PHP-FPM or SuExec mod= ule, you can even specify a user per virtual host.

Several cache, log and config folders must be writable both by the web s= erver and the command line user, use one of the following alternat= ives to do this:

  • Using ACL on a system that supports chmod +a
    The= se shell commands will give proper permission to the web server and command= line users.

    5.3 / 2014.05 and higher: >=3D 5.3 / 2014.05

    =20
        $ cd /<ezp5-root>/
        $ sudo chmod +a "www-data allow delete,write,append,file_inherit,direct=
    ory_inherit" \
          ezpublish/{cache,logs,config,sessions} ezpublish_legacy/{design,exten=
    sion,settings,var} web
        $ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,direct=
    ory_inherit" \
          ezpublish/{cache,logs,config,sessions} ezpublish_legacy/{design,exten=
    sion,settings,var} web
    =20

    5.0, 5.1 and 5.2: 5.0 5.1 5.2

    =20
        $ cd /<ezp5-root>/
        $ sudo chmod +a "www-data allow delete,write,append,file_inherit,direct=
    ory_inherit" \
          ezpublish/{cache,logs,config} ezpublish_legacy/{design,extension,sett=
    ings,var} web
        $ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,direct=
    ory_inherit" \
          ezpublish/{cache,logs,config} ezpublish_legacy/{design,extension,sett=
    ings,var} web
    =20


  • Using ACL on a system that does not support chmod +a
    Some systems don't support chmod +a, but do support another utility ca= lled setfacl. You may need to enable ACL support on your partition and inst= all setfacl before using it (as is the case with Ubuntu).
    5.3 / 2014.05 and higher: >=3D 5.3 / 2014.05

    =20
        $ cd /<ezp5-root>/
        $ sudo setfacl -R -m u:www-data:rwx -m u:www-data:rwx \
          ezpublish/{cache,logs,config,sessions} ezpublish_legacy/{design,exten=
    sion,settings,var} web
        $ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx \
          ezpublish/{cache,logs,config,sessions} ezpublish_legacy/{design,exten=
    sion,settings,var} web
    =20

    5.0, 5.1 and 5.2: 5.0 5.1 5.2=

    =20
        $ cd /<ezp5-root>/
        $ sudo setfacl -R -m u:www-data:rwx -m u:www-data:rwx \
          ezpublish/{cache,logs,config} ezpublish_legacy/{design,extension,sett=
    ings,var} web
        $ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx \
          ezpublish/{cache,logs,config} ezpublish_legacy/{design,extension,sett=
    ings,var} web
    =20
  • Using chown on systems that don't support ACL
    So= me systems don't support ACL at all. You will either need to set your web s= erver's user as the owner of the required directories.
    <= strong>5.3 / 2014.05 and higher: >=3D 5.3 / 2014.05

    =20
        $ cd /<ezp5-root>/
        $ sudo chown -R www-data:www-data ezpublish/{cache,logs,config,sessions=
    } ezpublish_legacy/{design,extension,settings,var} web
        $ sudo find {ezpublish/{cache,logs,config,sessions},ezpublish_legacy/{d=
    esign,extension,settings,var},web} -type d | xargs sudo chmod -R 775
        $ sudo find {ezpublish/{cache,logs,config,sessions},ezpublish_legacy/{d=
    esign,extension,settings,var},web} -type f | xargs sudo chmod -R 664
    = =20

    5.0, 5.1 and 5.2: 5.0 5.1 5.2=

    =20
        $ cd /<ezp5-root>/
        $ sudo chown -R www-data:www-data ezpublish/{cache,logs,config} ezpubli=
    sh_legacy/{design,extension,settings,var} web
        $ sudo find {ezpublish/{cache,logs,config},ezpublish_legacy/{design,ext=
    ension,settings,var},web} -type d | xargs sudo chmod -R 775
        $ sudo find {ezpublish/{cache,logs,config},ezpublish_legacy/{design,ext=
    ension,settings,var},web} -type f | xargs sudo chmod -R 664
    =20
  • Using chmod
    If you can't use ACL and aren't allo= wed to change owner, you can use chmod, making the files writable by everyb= ody. Note that this method really isn't recommended as it allows any user t= o do anything.
    5.3 / 2014.05 = and higher: >=3D 5.3 / 2014.05

    =20
        $ cd /<ezp5-root>/
        $ sudo find {ezpublish/{cache,logs,config,sessions},ezpublish_legacy/{d=
    esign,extension,settings,var},web} -type d | xargs sudo chmod -R 777
        $ sudo find {ezpublish/{cache,logs,config,sessions},ezpublish_legacy/{d=
    esign,extension,settings,var},web} -type f | xargs sudo chmod -R 666
    = =20

    5.0, 5.1 and 5.2: 5.0 5.1 5.2=

    =20
        $ cd /<ezp5-root>/
        $ sudo find {ezpublish/{cache,logs,config},ezpublish_legacy/{design,ext=
    ension,settings,var},web} -type d | xargs sudo chmod -R 777
        $ sudo find {ezpublish/{cache,logs,config},ezpublish_legacy/{design,ext=
    ension,settings,var},web} -type f | xargs sudo chmod -R 666
    =20

Install Composer 5.X

If you use a version control system, take care of versioning the compose= r.lock file.

Install Composer by running one of the following command from you= eZ Publish root folder :

If you have curl installed:

=20
curl -sS https://getcomposer.org/installer | php
=20

If you don't have curl installed:

=20
php -r "eval('?>'.file_get_contents('https://getcomposer.org/instal=
ler'));"
=20

=3D5.3/2014.05">For 5.3 and higher : get latest v= ersions of packages >=3D 5.3 / 2014.05

When Composer is installed, run update to get latest versions of package= s before you continue with installation.

Learn more on how to keep system further up to date =20 Using Composer

For 5.2 : for Symfony and its dependencies 5.2

Use composer for Symfony and its dependencies only, not for eZ Publish a= nd it's dependencies.

Error rendering macro 'excerpt-include' : User 'null' does not have permiss= ion to view the page 'glossary:Symfony'.

 

For all 5.x versions : Inst= all Zetacomponents for a pure legacy setup 5.X

As of eZ Publish 5.2, if you plan to use eZ Publish legacy only,= as standalone (as in pointing apache to ezpublish_legacy folder o= r extracting only ezpublish_legacy), then Zetacomponents must be installed = if you don't already have it via PEAR.

After Composer installation (see above for Composer installation instruc= tions) run the following command from the ezpublish_legacy= / folder :

=20
php composer.phar install
=20

Composer will need GD to run.

 

Before 5.2 : Link assets < 5.2 <= /strong>

The download file should already have generated these assets for you as of = 5.2 / 2013.07 during composer install, but in case file has been extracted = on Windows, make sure to run these commands.

To be able to run eZ Publish 5 correctly, assets need to be exposed in t= he public "web" folder.

The following commands will first symlink eZ Publish 5 assets in "Bundle= s" and the second will symlink assets (design files like images, scripts an= d css, and files in var folder)  from eZ Publish Legacy

=20
cd /<ezp5-root>
php ezpublish/console assets:install --relative --symlink web
php ezpublish/console ezpublish:legacy:assets_install --relative --symlink =
web
php ezpublish/console assetic:dump --env=3Dprod web
=20

Note: In both cases "web" is the default f= older and can be skipped from the command. For symlinks on the first two co= mmands you can either use --relative, --symlink, or none to get the command= to copy assets. However make sure to also update "symfony-assets-install" = in composer.json if you prefer something else then --relative which is the = default.

Further information about alternative options is available wit= h -h on each command, just like it is with the console itself = using "php ezpublish/console -h".

Warning regarding APC usercache

If you are planning to use APC usercache for eZ Publish Persistence cach= e, please be sure to check the available notes here, before enter= ing the setup wizard chapter.

Initiating the setup wizard 5.X

The setup wizard can be started using a web browser immediately after th= e previous steps (described in this section) are completed. It will be auto= matically run the first time someone tries to access/browse the "/ezs= etup" url.

 

------=_Part_4043_486270391.1485856452187--