Thứ Bảy, 31 tháng 5, 2014

// // Leave a Comment

Cài đặt Magento trên Debian - LAMP - NGINX - MEMCACHE Proxy

Trước tiên chạy lệnh sau để đảm bảo dữ liệu của các gói phần mềm đã đc update lên phiên bản mới nhất
root@nazing:~# apt-get update
Cài đặt apache2:
root@nazing:~# apt-get install apache2 -y
trong khi cài đặt hoặc restart apache ta có thể thấy cảnh báo:
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
nguyên nhân của lỗi này là do máy chủ cài đặt apache ko thể xác định được tên của chính nó, nó cần phải xác định tên của chính nó trong 1 số trường hợp nhất định
để tắt thông báo này, ta sẽ tạo ra 1 tập tin “servername.conf ” lưu trữ tên cho server apache, nội dung “ServerName localhost”:
root@nazing:~# cat /etc/apache2/conf.d/servername.conf
ServerName localhost
ta khởi động lại apache và thông báo không còn xuất hiện nữa:
root@nazing:~# service apache2 restart
[ ok ] Restarting web server: apache2 ... waiting .
một trong những tính năng của magento là chứ năng URL rewriting. Mặc đinh magento sẽ sử dụng category và product ID để tạo URL, nhưng với công cụ rewriting tool nó sẽ tạo ra nhiều url thân thiện cho SEO
Ví dụ thay vì sử dụng URL:
/ky-thuat-so/may-anh-cannon/view/id/16
thì url đc tạo ra sẽ là:
/may-anh-cannon-gia-re.html
Để tận dụng chức năng này, ta phải kích hoạt modun rewrite của Apache:
a2enmod rewrite
service apache2 restart
Cài đặt PHP:
Magento yêu cầu PHP 5.2.13 và các phần mở rộng:
  • PDO_MySQL
  • simplexml
  • mcrypt
  • hash
  • GD
  • DOM
  • iconv
  • curl
  • SOAP
Do đó ta sẽ cài đặt PHP bằng lệnh sau:
(chưa đc cài đặt)
#apt-get install php5 php5-curl php5-gd php5-mcrypt php5-mysql
Để kiểm tra xem 1 exten (module) đã đc cài đặt chưa, ta dùng lệnh:
root@nazing:~# dpkg --list|grep curl
ii  curl                               7.26.0-1+wheezy9              amd64        command line tool for transferring data with URL syntax
ii  libcurl3:amd64                     7.26.0-1+wheezy9              amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl3-gnutls:amd64              7.26.0-1+wheezy9              amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)

(đã đc cài đặt)
root@nazing:~# dpkg --list|grep curl
ii  curl                               7.26.0-1+wheezy9              amd64        command line tool for transferring data with URL syntax
ii  libcurl3:amd64                     7.26.0-1+wheezy9              amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl3-gnutls:amd64              7.26.0-1+wheezy9              amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  php5-curl                          5.4.4-14+deb7u9               amd64        CURL module for php5
Cài đặt Database Mysql Server:
# apt-get install mysql-server -y
 Tạo user và cấu hình cho phép truy cập:
Tạo 1 user và add user này vào group www-data
root@magento:~# useradd -m thehai
root@magento:~# usermod -g www-data thehai
Tạo folder chưa web và gán quyền truy cập:
# mkdir /home/thehai/public_html
# chgrp www-data /home/thehai/public_html/
# chmod 2750 /home/thehai/public_html/

Tạo thư mục chứa sourch và chứa file log:
mkdir -p /home/thehai/public_html/haiquynh.com/{public,log}

Cấu hình Virtoal Host nooij dung:
root@magento:/etc/apache2/sites-available# more haiquynh.com
<VirtualHost *:80>
    ServerAdmin webmaster@haiquynh.com
    ServerName haiquynh.com
    ServerAlias www.haiquynh.com

    DocumentRoot /home/thehai/public_html/haiquynh.com/public

    ErrorLog /home/thehai/public_html/haiquynh.com/log/error.log
    CustomLog /home/thehai/public_html/haiquynh.com/log/access.log combined

KIch hoa va khoi dong lai apache

# a2ensite magento-store.com
# service apache2 restart


http://davidtsadler.com/archives/2012/06/03/how-to-install-magento-on-ubuntu/



https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-12-04
http://davidtsadler.com/archives/2012/06/03/how-to-install-magento-on-ubuntu/

0 nhận xét:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.