如何在 ubuntu 18.04 安裝 AKENEO 4.0
Akeneo PIM 可以集中管理產品的數據,讓你的產品資料同步至各個系統中。Akeneo PIM 可分為社群版與企業版,今天我們要講的是社群版的手動安裝,讓你可以更清楚Akeneo的架構。
請先準備好 ubuntu 18.04請在root權限下執行指令
- 安裝MySQL 8.0
apt-get install lsb-release apt-transport-https ca-certificates wget gnupg wget -O mysql-apt-config.deb https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb dpkg -i mysql-apt-config.deb apt update && apt-get install mysql-server
建議禁用MySQL Workbench和MySQL Router
- 安裝PHP 7.3
apt-get install software-properties-common add-apt-repository ppa:ondrej/php apt update apt-get install php7.3-cli php7.3-apcu php7.3-bcmath php7.3-curl php7.3-fpm php7.3-gd php7.3-intl php7.3-mysql php7.3-xml php7.3-zip php7.3-zip php7.3-mbstring php7.3-imagick php7.3-exif
- 安裝ELASTICSEARCH 7.5
apt-get install apt-transport-https wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list apt update && apt-get install elasticsearch service elasticsearch start
- 安裝 Apache
apt-get install apache2 a2enmod rewrite proxy_fcgi service apache2 restart
- 為你的AKENEO產生DB與使用者
//請先進入MYSQL mysql -u root -p //新增名為akeneo_pim的DB CREATE DATABASE akeneo_pim; //新稱使用者akeneo_pim CREATE USER akeneo_pim@localhost IDENTIFIED WITH mysql_native_password BY '你的使用者密碼'; //給予使用者登入DB權限與限制localhost才可以使用 GRANT ALL PRIVILEGES ON akeneo_pim.* TO akeneo_pim@localhost; //離開MYSQL EXIT
- 更改PHP設定
vim /etc/php/7.3/cli/php.ini //加大memory memory_limit = 1024M //設定時區 date.timezone = UTC //重新啟動PHP service php7.3-fpm restart
- 設定/etc/apache2/sites-available/akeneo-pim.local.conf
<VirtualHost *:80> #你的AKENEO網址 ServerName akeneo-pim.local #/path/to/installation/pim-community-standard/public 換成AKENEO的位置 DocumentRoot /path/to/installation/pim-community-standard/public <Directory /path/to/installation/pim-community-standard/public> AllowOverride None Require all granted Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] </Directory> <Directory /path/to/installation/pim-community-standard/public/bundles> RewriteEngine Off </Directory> <FilesMatch \.php$> SetHandler "proxy:unix:/run/php/php7.3-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>
- 重啟APACHE
sudo apache2ctl configtest 這會回應 'Syntax OK' sudo a2ensite akeneo-pim.local sudo service apache2 reload
- 添加HOST
127.0.0.1 akeneo-pim.local
- 安裝Node.js
apt-get install curl curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh bash nodesource_setup.sh apt-get install -y nodejs
- 安裝yarn
curl -sL 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 update && apt-get install yarn
- 到這裡我們已經所需的環境都準備好了,接下來安裝AKENEO,使用Composer
php -d memory_limit=4G /usr/local/bin/composer create-project --prefer-dist \ akeneo/pim-community-standard /srv/pim "4.0.*@stable
- 配置環境檔 你的AKENEO目錄在 /sev/pim 必須與第7部所設定的路徑相同
vim .env 檔 //你的AKENEO執行環境 APP_ENV=dev 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' //APP_DATABASE*為DB連線設定 //APP_INDEX_HOSTS 為連接Elasticsearch 預設port為9200
- 以開發人員模式啟動PIM
NO_DOCKER=true make dev
進入http://localhost:8080/ 你現在可以看到ANENEO了,預設帳密為 admin/admin。
以上是本次針對如何在ubuntu 18.04中安裝Akeneo 4.0的教學,喜歡這篇文章的讀者們,別忘了追蹤我們的臉書粉絲團、Instagram,以及訂閱歐斯瑞電子報唷!
我要留言