Mise à jour :
1 2 3 4 |
cp /etc/apt/sources.list /etc/apt/sources.list.save && \ sudo apt update && sudo apt upgrade && \ sudo apt install aptitude && \ sudo apt dist-upgrade |
Installation Rkhunter : https://sourceforge.net/p/rkhunter/rkh_code/ci/master/tree/files/README#l119
1 2 3 4 5 6 7 |
wget 'https://sourceforge.net/projects/rkhunter/files/rkhunter/1.4.6/rkhunter-1.4.6.tar.gz' && \ tar zxf rkhunter-1.4.6.tar.gz && \ cd rkhunter-1.4.6 && \ ./installer.sh --install && \ rkhunter --update && \ rkhunter --propupd && \ rkhunter --check |
Pré-requis :
1 |
sudo apt install nano && sudo apt install htop |
Changement de port :
1 |
sudo nano /etc/ssh/sshd_config |
Modifier « Port 22 » en « Port XXXXX »
1 |
sudo service ssh restart |
Installation du PIM : https://docs.akeneo.com/latest/install_pim/manual/index.html
1 2 3 4 5 |
apt install lsb-release apt-transport-https ca-certificates && \ wget -O mysql-apt-config.deb https://dev.mysql.com/get/mysql-apt-config_0.8.7-1_all.deb && \ dpkg -i mysql-apt-config.deb && \ apt update && \ apt install mysql-server |
1 2 3 4 5 |
apt install apt-transport-https ca-certificates && \ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ sh -c 'echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list' && \ apt update && \ apt install php7.1-apcu php7.1-bcmath php7.1-cli php7.1-curl php7.1-fpm php7.1-gd php7.1-intl php7.1-mcrypt php7.1-mysql php7.1-soap php7.1-xml php7.1-zip |
1 |
apt install php7.1-imagick |
1 2 3 4 5 6 |
apt install apt-transport-https && \ wget -O - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - && \ echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list && \ apt update && \ apt install openjdk-8-jre-headless && \ apt install elasticsearch |
1 2 3 |
sysctl -w vm.max_map_count=262144 && \ echo "vm.max_map_count=262144" | tee /etc/sysctl.d/elasticsearch.conf && \ systemctl restart elasticsearch |
1 2 3 |
apt install apache2 && \ a2enmod rewrite proxy_fcgi && \ systemctl restart apache2 |
1 2 3 4 |
mysql -u root -p mysql> CREATE DATABASE akeneo_pim; mysql> GRANT ALL PRIVILEGES ON akeneo_pim.* TO akeneo_pim@localhost IDENTIFIED BY 'akeneo_pim'; mysql> EXIT |
1 |
sudo nano /etc/php/7.1/cli/php.ini |
Modifier les lignes comme ci-dessous :
1 2 |
<span class="l l-Scalar l-Scalar-Plain hljs-literal">memory_limit = 1024M</span> <span class="l l-Scalar l-Scalar-Plain hljs-literal">date.timezone = Etc/UTC</span> |
1 |
sudo nano /etc/php/7.1/fpm/php.ini |
Modifier les lignes comme ci-dessous :
1 2 |
<span class="l l-Scalar l-Scalar-Plain hljs-literal">memory_limit = 512M</span> <span class="l l-Scalar l-Scalar-Plain hljs-literal">date.timezone = Etc/UTC</span> |
1 |
sudo nano /etc/apache2/sites-available/mywebsite.com.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<VirtualHost *:80> ServerName mywebsite.com DocumentRoot /path/to/installation/pim-community-standard/web <Directory /path/to/installation/pim-community-standard/web> AllowOverride None Require all granted Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L] </Directory> <Directory /path/to/installation/pim-community-standard> Options FollowSymlinks </Directory> <Directory /path/to/installation/pim-community-standard/web/bundles> RewriteEngine Off </Directory> <FilesMatch \.php$> SetHandler "proxy:unix:/run/php/php7.1-fpm.sock|fcgi://localhost/" </FilesMatch> SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 ErrorLog ${APACHE_LOG_DIR}/akeneo-pim_error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/akeneo-pim_access.log combined </VirtualHost> |
1 2 3 |
sudo apache2ctl configtest && \ sudo a2ensite mywebsite.com && \ sudo systemctl reload apache2 |
1 2 |
sudo nano /etc/hosts 127.0.0.1 mywebsite.com |
1 2 3 |
sudo apt install curl && \ curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ apt-get install -y nodejs |
1 2 3 |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ apt-get update && sudo apt-get install yarn |
1 2 |
cd /home/ && \ wget https://download.akeneo.com/pim-community-standard-v2.3-latest.tar.gz && \ |
1 2 |
mkdir -p /path/to/installation && \ tar -xvzf pim-community-standard-v2.3-latest.tar.gz -C /path/to/installation/ |
1 |
cd /path/to/installation/pim-community-standard |
1 2 |
php -d memory_limit=3G ../composer.phar install --optimize-autoloader --prefer-dist && \ yarn install |
1 2 |
php bin/console cache:clear --no-warmup --env=prod && \ php bin/console pim:installer:assets --symlink --clean --env=prod |
1 2 |
bin/console pim:install --force --symlink --clean --env=prod && \ yarn run webpack |
Si l’erreur « No alive nodes found in your cluster » est affichée :
Tester la commande :
1 2 |
sudo service elasticsearch restart sudo service elasticsearch status |
Si une erreur du type s’affiche : « There is insufficient memory for the Java Runtime Environment to continue. »
1 |
sudo nano /etc/elasticsearch/jvm.options |
Changer les valeurs selon la mémoire disponible sur votre VPS (par exemple 1G ci-dessous) :
1 2 |
-Xms1g -Xmx1g |
Source : https://github.com/archivesunleashed/aut/issues/159
Il convient maintenant d’attribuer l’utilisateur correspondant. Dans notre cas, nous gardons l’utilisateur d’origine d’Apache : www-data. En effet, je préfère utiliser un VPS de toute petite taille pour héberger seulement un PIM. La technologie étant toute nouvelle, je préfère séparer le PIM de toutes les autres applications.
1 |
sudo chown www-data: -R /path/to/installation/pim-community-standard/ |
1 |
crontab -e -u www-data |
1 2 3 4 |
# m h dom mon dow command 0 23 * * * php /path/to/installation/pim-community-standard/bin/console pim:completeness:calculate --env=prod > /path/to/installation/pim-community-standard/var/logs/calculate_completeness.log 2>&1 0 5 * * * php /path/to/installation/pim-community-standard/bin/console pim:versioning:refresh --env=prod > /path/to/installation/pim-community-standard/var/logs/refresh_versioning.log 2>&1 0 22 * * * php /path/to/installation/pim-community-standard/bin/console pim:volume:aggregate --env=prod > /path/to/installation/pim-community-standard/var/logs/volume_aggregate.log 2>&1 |
Je vous conseille de réaliser un snapshot à cet étape.
Il vous reste à vous connecter sur mywebsite.com et le tour est joué ! Les accès par défaut sont admin/admin.
0 commentaire