如何安装 PIM 社区版
How to install PIM Community Edition
(这是修改后的指南,对我有用)
如何在 Ubuntu 20.04 LTS 中为 testing/dev 安装 Akeneo PIM(我的方式)
更改本地主机名(可选):
sudo nano /etc/hosts
(add this or modify)
127.0.0.1 localhost
127.0.0.1 akeneo-pim.local
安装 apache2 和模块:
sudo apt install apache2 curl aspell php-apcu-bc php-pear php-apcu php7.4-fpm php7.4 libapache2-mod-php7.4 php7.4-cli php7.4-common php7.4-xml php7.4-mysql php7.4-gd php-imagick php7.4-tidy php7.4-xmlrpc php7.4-curl php7.4-mbstring php7.4-zip php7.4-soap php7.4-bcmath php7.4-intl php7.4-xsl php7.4-json zip unzip --install-recommends
(同时修改php.ini)
sudo nano /etc/php/7.4/cli/php.ini
sudo nano /etc/php/7.4/fpm/php.ini
memory_limit = 2G
date.timezone = America/New_York
apc.enable_cli = 1
a2enmod rewrite proxy_fcgi
sudo nano /etc/php/7.4/fpm/pool.d/www.conf
user = www-data
group = www-data
listen = /run/php/php7.4-fpm.sock
listen.owner = www-data
listen.group = www-data
## Optional: this can help to optimize if you have little memory in your virtual machine.
# pm = ondemand
# pm.max_children = 80
# pm.process_idle_timeout = 10s
# pm.max_requests = 200
sudo service apache2 restart
sudo service php7.4-fpm restart
将 Akeneo 站点添加到 Web 服务器:
sudo mv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf.bak
sudo nano /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerName akeneo-pim.local
DocumentRoot /var/www/html/public
<Directory /var/www/html/public>
AllowOverride None
Require all granted
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
<Directory /var/www/html/public/bundles>
RewriteEngine Off
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost/"
</FilesMatch>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=[=13=]
ErrorLog ${APACHE_LOG_DIR}/akeneo-pim_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/akeneo-pim_access.log combined
</VirtualHost>
测试配置中是否一切正常(您可能会收到一些警告,稍后会解决)
sudo apache2ctl configtest
sudo service apache2 restart
安装Mysql,创建db/user:
sudo apt install mysql-server mysql-client --install-recommends
(Install phpmyadmin if you like):
sudo apt install phpmyadmin --install-recommends
创建数据库和用户:
sudo mysql -u root -p
CREATE DATABASE akeneo_pim;
CREATE USER akeneo_pim@localhost IDENTIFIED WITH mysql_native_password BY 'akeneo-pim';
GRANT ALL PRIVILEGES ON akeneo_pim.* TO akeneo_pim@localhost;
FLUSH PRIVILEGES;
EXIT
Configure root with password (optional):
GRANT ALL PRIVILEGES ON *.* TO root@localhost;
FLUSH PRIVILEGES;
EXIT;
Add other users as root (optional):
CREATE USER 'youruser'@'localhost' IDENTIFIED BY 'CFKLDLNA';
GRANT ALL PRIVILEGES ON *.* TO youruser@localhost;
FLUSH PRIVILEGES;
EXIT;
安装 JDK 和 ElasticSearch:
sudo apt install -y openjdk-11-jdk --install-recommends
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
sudo apt update
sudo apt install elasticsearch
限制内存使用的选项(根据需要进行测试)
sudo nano /etc/elasticsearch/jvm.options.d/jvm.options
-Xms2g
-Xmx2g
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo service elasticsearch start
如果 Elasticsearch 不会在启动时启动,请给它多一点超时等待:
sudo mkdir /etc/systemd/system/elasticsearch.service.d
echo -e "[Service]\nTimeoutStartSec=250" | sudo tee /etc/systemd/system/elasticsearch.service.d/startup-timeout.conf
sudo systemctl show elasticsearch | grep ^Timeout
Akeneo 选项:
sudo sysctl -w vm.max_map_count=262144
sudo nano /etc/sysctl.d/elasticsearch.conf
vm.max_map_count=262144
sudo service elasticsearch restart
安装 NODE12:
cd ~
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install -y nodejs
安装 YARN:
cd ~
wget https://dl.yarnpkg.com/debian/pubkey.gpg
sudo apt-key add pubkey.gpg
sudo nano /etc/apt/sources.list.d/yarn.list
deb https://dl.yarnpkg.com/debian/ stable main
sudo apt update && sudo apt install yarn
安装作曲家:
cd ~
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
安装 Akeneo-PIM:
sudo rm /var/www/html/*
(必须是空文件夹)
cd /var/www/html
sudo chown -R $USER:$USER /var/www/html
php -d memory_limit=4G /usr/local/bin/composer create-project --prefer-dist akeneo/pim-community-standard . "5.0.*@stable"
(接受允许插件)
配置 .env,因为你需要匹配之前输入的内容:
nano /var/www/html/.env.local
APP_ENV=prod
APP_DATABASE_HOST=localhost
APP_DATABASE_PORT=null
APP_DATABASE_NAME=akeneo_pim
APP_DATABASE_USER=akeneo_pim
APP_DATABASE_PASSWORD=akeneo_pim
APP_INDEX_HOSTS='localhost:9200'
在生产模式下开始安装:
(如果需要,请安装:sudo apt make gcc)
cd /var/www/html
NO_DOCKER=true make prod
sudo chown -R www-data:www-data /var/www/html
sudo chmod ug+rw /var/www/html/var/cache /var/www/html/var/logs /var/www/html/public
创建管理员用户:
cd /var/www/html
sudo -u www-data php bin/console pim:user:create
User/Pass: youruser/CFKLDLNA
Akeneo 的 Cron 作业:
sudo -u www-data /usr/bin/php /var/www/html/bin/console akeneo:batch:job-queue-consumer-daemon --env=prod -vvv >>/var/www/html/var/logs/daemon_logs.log 2>&1
那是 apache 配置错误。如果你不使用 docker-setup 你将没有 8080,除非配置。该指南适用于 docker,如果您不使用它,则需要自己调整配置。
{pim-install}/public
文件夹是您的 apache 配置仅指向 {pim-install}
的主要入口点。调整主机配置就可以了。看这部分:https://docs.akeneo.com/latest/install_pim/manual/system_requirements/system_install_ubuntu_2004.html#id1
Document-Root 指向 .../public
路由将处理其他调用(例如 bundles/...
)。
我可以解决问题。
official 手动安装指南告诉您在端口 *:80 上创建一个名为 /etc/apache2/sites-available/akeneo-pim.local.conf 的新虚拟主机
然后使用 a2ensite 启用它。如果这样做,您还将启用 000-default.conf,因为它默认启用了 apache。
因此,您必须将 000-default.conf 内容替换为 whats is in the guide here
然后重新启动 apache,它就可以工作了,但是在端口 80 中(不是指南中所说的 por 8080,认为那只是为了 docker)
您还需要创建一个新的 user/pass,因为 admin/admin 仅用于 docker 安装,您可以在文档中使用此命令 运行 创建用户-根 akeneo 文件夹。您必须 运行 使用与 运行s apache 和文档根目录 akeneo 目录权限相同的用户(否则会出现 write/access 错误)
在我的例子中,apache 和 php7.4-fpm 运行s 以 www-data 作为 /var/www/html/ 中的权限(安装了 akeneo CE 的我的文档根目录)
所以要添加用户:
CD /var/www/html
sudo -u www-data php bin/console pim:user:create
希望对您有所帮助,如果对其他人有帮助,我会尝试添加干净的指南,或者只是询问,如果可以,我会提供帮助。
(这是修改后的指南,对我有用) 如何在 Ubuntu 20.04 LTS 中为 testing/dev 安装 Akeneo PIM(我的方式)
更改本地主机名(可选):
sudo nano /etc/hosts
(add this or modify)
127.0.0.1 localhost
127.0.0.1 akeneo-pim.local
安装 apache2 和模块:
sudo apt install apache2 curl aspell php-apcu-bc php-pear php-apcu php7.4-fpm php7.4 libapache2-mod-php7.4 php7.4-cli php7.4-common php7.4-xml php7.4-mysql php7.4-gd php-imagick php7.4-tidy php7.4-xmlrpc php7.4-curl php7.4-mbstring php7.4-zip php7.4-soap php7.4-bcmath php7.4-intl php7.4-xsl php7.4-json zip unzip --install-recommends
(同时修改php.ini)
sudo nano /etc/php/7.4/cli/php.ini
sudo nano /etc/php/7.4/fpm/php.ini
memory_limit = 2G
date.timezone = America/New_York
apc.enable_cli = 1
a2enmod rewrite proxy_fcgi
sudo nano /etc/php/7.4/fpm/pool.d/www.conf
user = www-data
group = www-data
listen = /run/php/php7.4-fpm.sock
listen.owner = www-data
listen.group = www-data
## Optional: this can help to optimize if you have little memory in your virtual machine.
# pm = ondemand
# pm.max_children = 80
# pm.process_idle_timeout = 10s
# pm.max_requests = 200
sudo service apache2 restart
sudo service php7.4-fpm restart
将 Akeneo 站点添加到 Web 服务器:
sudo mv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf.bak
sudo nano /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerName akeneo-pim.local
DocumentRoot /var/www/html/public
<Directory /var/www/html/public>
AllowOverride None
Require all granted
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
<Directory /var/www/html/public/bundles>
RewriteEngine Off
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost/"
</FilesMatch>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=[=13=]
ErrorLog ${APACHE_LOG_DIR}/akeneo-pim_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/akeneo-pim_access.log combined
</VirtualHost>
测试配置中是否一切正常(您可能会收到一些警告,稍后会解决)
sudo apache2ctl configtest
sudo service apache2 restart
安装Mysql,创建db/user:
sudo apt install mysql-server mysql-client --install-recommends
(Install phpmyadmin if you like):
sudo apt install phpmyadmin --install-recommends
创建数据库和用户:
sudo mysql -u root -p
CREATE DATABASE akeneo_pim;
CREATE USER akeneo_pim@localhost IDENTIFIED WITH mysql_native_password BY 'akeneo-pim';
GRANT ALL PRIVILEGES ON akeneo_pim.* TO akeneo_pim@localhost;
FLUSH PRIVILEGES;
EXIT
Configure root with password (optional):
GRANT ALL PRIVILEGES ON *.* TO root@localhost;
FLUSH PRIVILEGES;
EXIT;
Add other users as root (optional):
CREATE USER 'youruser'@'localhost' IDENTIFIED BY 'CFKLDLNA';
GRANT ALL PRIVILEGES ON *.* TO youruser@localhost;
FLUSH PRIVILEGES;
EXIT;
安装 JDK 和 ElasticSearch:
sudo apt install -y openjdk-11-jdk --install-recommends
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
sudo apt update
sudo apt install elasticsearch
限制内存使用的选项(根据需要进行测试)
sudo nano /etc/elasticsearch/jvm.options.d/jvm.options
-Xms2g
-Xmx2g
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo service elasticsearch start
如果 Elasticsearch 不会在启动时启动,请给它多一点超时等待:
sudo mkdir /etc/systemd/system/elasticsearch.service.d
echo -e "[Service]\nTimeoutStartSec=250" | sudo tee /etc/systemd/system/elasticsearch.service.d/startup-timeout.conf
sudo systemctl show elasticsearch | grep ^Timeout
Akeneo 选项:
sudo sysctl -w vm.max_map_count=262144
sudo nano /etc/sysctl.d/elasticsearch.conf
vm.max_map_count=262144
sudo service elasticsearch restart
安装 NODE12:
cd ~
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install -y nodejs
安装 YARN:
cd ~
wget https://dl.yarnpkg.com/debian/pubkey.gpg
sudo apt-key add pubkey.gpg
sudo nano /etc/apt/sources.list.d/yarn.list
deb https://dl.yarnpkg.com/debian/ stable main
sudo apt update && sudo apt install yarn
安装作曲家:
cd ~
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
安装 Akeneo-PIM:
sudo rm /var/www/html/*
(必须是空文件夹)
cd /var/www/html
sudo chown -R $USER:$USER /var/www/html
php -d memory_limit=4G /usr/local/bin/composer create-project --prefer-dist akeneo/pim-community-standard . "5.0.*@stable"
(接受允许插件)
配置 .env,因为你需要匹配之前输入的内容:
nano /var/www/html/.env.local
APP_ENV=prod
APP_DATABASE_HOST=localhost
APP_DATABASE_PORT=null
APP_DATABASE_NAME=akeneo_pim
APP_DATABASE_USER=akeneo_pim
APP_DATABASE_PASSWORD=akeneo_pim
APP_INDEX_HOSTS='localhost:9200'
在生产模式下开始安装: (如果需要,请安装:sudo apt make gcc)
cd /var/www/html
NO_DOCKER=true make prod
sudo chown -R www-data:www-data /var/www/html
sudo chmod ug+rw /var/www/html/var/cache /var/www/html/var/logs /var/www/html/public
创建管理员用户:
cd /var/www/html
sudo -u www-data php bin/console pim:user:create
User/Pass: youruser/CFKLDLNA
Akeneo 的 Cron 作业:
sudo -u www-data /usr/bin/php /var/www/html/bin/console akeneo:batch:job-queue-consumer-daemon --env=prod -vvv >>/var/www/html/var/logs/daemon_logs.log 2>&1
那是 apache 配置错误。如果你不使用 docker-setup 你将没有 8080,除非配置。该指南适用于 docker,如果您不使用它,则需要自己调整配置。
{pim-install}/public
文件夹是您的 apache 配置仅指向 {pim-install}
的主要入口点。调整主机配置就可以了。看这部分:https://docs.akeneo.com/latest/install_pim/manual/system_requirements/system_install_ubuntu_2004.html#id1
Document-Root 指向 .../public
路由将处理其他调用(例如 bundles/...
)。
我可以解决问题。
official 手动安装指南告诉您在端口 *:80 上创建一个名为 /etc/apache2/sites-available/akeneo-pim.local.conf 的新虚拟主机
然后使用 a2ensite 启用它。如果这样做,您还将启用 000-default.conf,因为它默认启用了 apache。
因此,您必须将 000-default.conf 内容替换为 whats is in the guide here
然后重新启动 apache,它就可以工作了,但是在端口 80 中(不是指南中所说的 por 8080,认为那只是为了 docker)
您还需要创建一个新的 user/pass,因为 admin/admin 仅用于 docker 安装,您可以在文档中使用此命令 运行 创建用户-根 akeneo 文件夹。您必须 运行 使用与 运行s apache 和文档根目录 akeneo 目录权限相同的用户(否则会出现 write/access 错误)
在我的例子中,apache 和 php7.4-fpm 运行s 以 www-data 作为 /var/www/html/ 中的权限(安装了 akeneo CE 的我的文档根目录)
所以要添加用户: CD /var/www/html sudo -u www-data php bin/console pim:user:create
希望对您有所帮助,如果对其他人有帮助,我会尝试添加干净的指南,或者只是询问,如果可以,我会提供帮助。