Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   Magento (http://quantrinet.com/forum/forumdisplay.php?f=551)
-   -   Hướng dẫn cài đặt LAMP (Apache 2.4, MariaDB 10 và PHP 5, PHP 7 cho Magento CentOS 7 (http://quantrinet.com/forum/showthread.php?t=10061)

hoctinhoc 22-10-2016 09:15 PM

Hướng dẫn cài đặt LAMP (Apache 2.4, MariaDB 10 và PHP 5, PHP 7 cho Magento CentOS 7
 
Hướng dẫn cài đặt LAMP (Apache 2.4, MariaDB 10 và PHP 5.4 or PHP 7 cho Magento) on CentOS 7

1. Update Centos 7

yum update -y

2. Cài đặt Apache 2.4


yum install httpd openssl mod_ssl
systemctl restart httpd
systemctl status httpd
systemctl enable httpd

Cấu hình:

vi /etc/httpd/conf/httpd.conf

===================

<VirtualHost *:80>
ServerAdmin admin@quantrinet.com
DocumentRoot /var/www/html/
ServerName quantrinet.com
ServerAlias www.quantrinet.com
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/quantrinet.com-error_log
CustomLog /var/log/httpd/quantrinet.com-access_log common
</VirtualHost>


3. Cài đặt MariaDB 10


vi /etc/yum.repos.d/MariaDB10.repo


=============


# MariaDB 10.0 CentOS repository list – created 2014-10-13 13:04 UTC
# http://mariadb.org/mariadb/repositories/


[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

==============

yum -y install MariaDB-server MariaDB-client


Bảo mật DB

mysql_secure_installation

Tạo DB

mysql -u root -p
CREATE DATABASE magentodb;
GRANT ALL PRIVILEGES ON magentodb . * TO magentouser@'localhost' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
FLUSH PRIVILEGES;

4. Cài đặt PHP 5.4

yum install php php-gd php-mysql php-tidy php-xmlrpc php-common php-cli php-xml php-mcrypt

or for php7

yum -y install epel-release
wget https://dl.fedoraproject.org/pub/epe...t-6.noarch.rpm
wget https://centos6.iuscommunity.org/ius-release.rpm
rpm -Uvh ius-release*.rpm
yum -y update
yum install -y http://dl.iuscommunity.org/pub/ius/s...os7.noarch.rpm
yum -y install php70u php70u-pdo php70u-mysqlnd php70u-opcache php70u-xml php70u-mcrypt php70u-gd php70u-devel php70u-mysql php70u-intl php70u-mbstring php70u-bcmath php70u-json php70u-iconv

systemctl restart httpd
systemctl status httpd

Test

/var/www/html/info.php

====
<?php
phpinfo();
?>

====

vi /etc/php.ini

======

date.timezone = Asia/Ho_Chi_Minh
max_execution_time = 18000
max_input_time = 6000
memory_limit = 1024M
post_max_size = 128M
upload_max_filesize = 32M

======



5. Cài đặt Magento

https://www.magentocommerce.com/download
unzip magento*.zip
cp -rf magento/* /var/www/html/

chown -R apache:apache /var/www/html/
chmod -R 755 /var/www/html/

Vào file: local.xml trong thư mục: app/etc/ để điền thông tin kết nối sql

hoặc truy cập vào : http://quantrinet.com để cài đặt Magento



APC cache for PHP

https://www.mervcodes.com/install-ap...d-fedora-2021/

6. Mở port Web trên Firewall

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload


Bây giờ là 10:58 PM. Giờ GMT +7

Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.