1. 下载Magento
http://www.magentochina.org/download Magento-1.8.0.0正式版下载
2. 解压缩magento-1.8.0.0.tar.gz
cd /var/www
tar xvf magento-1.8.0.0.tar.gz
cd magento
chmod -R o+w media var
chmod o+w app/etc
Optionally delete the download file and empty directory from the extracted files:
- rm -rf magento-1.8.0.0.tar.gz
3. Install Nginx, PHP5, SSL and MySQL.
- sudo apt-get install nginx php5 php5-cli php5-cgi spawn-fcgi php5-mysql php5-mcrypt php5-curl php5-gd php5-fpm openssl mysql-server
Choose and enter a secure password for MySQL when prompted and enter again to confirm. This is called mypassword in the following steps but replace that with the password you have chosen here.
4. Install php-apc. APC is an opcode cache that can significantly speed up your PHP applications, by caching both PHP code and user variables.
- sudo apt-get install php-apc
5. Create the MySQL Database
- mysql -u root -pmypassword
- create database mymagentoshop;
- grant all privileges on mydatabasename.* to mydatabasename@localhost identified by 'mypassword';
- exit
6. Configure Nginx
- nano /etc/nginx/sites-enabled/default
- listen 80; ## listen for ipv4; this line is default and implied
- #listen [::]:80 default ipv6only=on; ## listen for ipv6
Uncomment listen links above by removing the preceding #
ctrl + x to exit and save
7. Nginx setup
ERROR FIX:
PHP extension "gd" must be loaded.
RESOLVE:
add the following two lines to the end of /etc/php5/fpm/php.ini
extension=mysql.so
extension=gd.so
restart php
sudo /etc/init.d/php5-fpm restart