Contao installation

Install Composer

To get Contao with Composer we have to install the package first.

root$

yum install php-soap composer

Contao directory and SELinux

Create a directory for the Contao installation.

root$

mkdir /var/www/your-domain.com.www

Make sure it is owned by the apache user and group.

root$

chown apache:apache /var/www/your-domain.com.www

Now inform SELinux to grant "httpd" write-access to this folder.

root$

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/your-domain.com.www'

root$

restorecon '/var/www/your-domain.com.www'

Composer cache

The composer cache directory must also be owned by the Apache user and group.

root$

mkdir /usr/share/httpd/.composer

root$

chown apache:apache /usr/share/httpd/.composer

Contao database and user

Login to mysql or mariadb as root and your root-password.

root$

mysql -u root -p

 

Now, create the database e.g. your_domain_com_www

mysql>

CREATE DATABASE your_domain_com_www CHARACTER SET utf8 COLLATE utf8_general_ci;

Create a user with password for the Contao database for connections on localhost e.g. your_domain_com_www

mysql>

CREATE USER 'your_domain_com_www'@'localhost' IDENTIFIED BY 'new_password';

Grant all access to the Contao database for this created user.

mysql>

GRANT ALL ON your_domain_com_www.* TO 'your_domain_com_www'@'localhost';

mysql>

FLUSH PRIVILEGES;

Configure Apache

Create a Apache configuration-file for your domain and the Contao installation.

e.g. /etc/httpd/conf.d/your-domain.com.www443.conf

<VirtualHost xxx.xxx.xxx.xxx:443>

 DocumentRoot /var/www/your-domain.com.www/web
 ServerName your-domain.com

 <Directory "/var/www/your-domain.com.www/web">
  AllowOverride all
 </Directory>

 SSLEngine on
 SSLCertificateFile /etc/letsencrypt/live/your-domain.com/cert.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem
 SSLCertificateChainFile /etc/letsencrypt/live/your-domain.com/chain.pem
 ServerAlias www.your-domain.com server.your-domain.com

</VirtualHost>

 

and redirect your http requests to https.

e.g. /etc/httpd/conf.d/your-domain.com.www80.conf

<VirtualHost xxx.xxx.xxx.xxx:80>

 DocumentRoot /var/www/your-domain.com.www/web
 ServerName your-domain.com

 <Directory "/var/www/your-domain.com.www/web">
  allow from all
  Options None
  Require all granted
 </Directory>

 Redirect / "https://www.your-domain.com/"
 ServerAlias www.your-domain.com

</VirtualHost>

Install Contao

Install Contao to the created directory, using the composer command as apache user.

root$

sudo -u apache composer create-project contao/standard-edition /var/www/your-domain.com.www

Enter the database-name, user, and password that you created above.

Start Contao

In your favorite web-browser open the install.php and follow the instructions.

e.g. https://www.your-domain.com/contao/install

Undo Speicherzeit

Per default ist die Speicherzeit für das Wiederherstellen gelöschter Datensätze auf 24 Stunden gesetzt. Gerade beim Aufbau einer Webseite, oder wenn sich ein Kunde gerade in das System einarbeitet und dabei versehentlich Elemente gelöscht werden, kann es von Vorteil sein, wenn hier die Speicherzeit erhöht wird. Setzt man den Wert in den Einstellungen unter "Speicherzeit für Undo-Schritte" auf den selben Wert wie die Speicherzeit für Versionen (7776000 Sekunden), können versehentliche Löschvorgänge bis zu 90 Tage lang rückgängig gemacht werden.

Contao Undo Speicherzeit

Config file

system/config/localconfig.php

References

Original Contao installation guide

https://docs.contao.org/books/manual/current/de/01-installation/contao-installieren.html

Contao check

https://github.com/contao/check

Kommentare

Bitte addieren Sie 5 und 3.