Download opencart from https://www.opencart.com
Then extract it in your root web directory
Read install.txt file to setup and install opencart
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
... 2. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php 3. For Linux/Unix make sure the following folders and files are writable. chmod 0755 or 0777 system/storage/cache/ chmod 0755 or 0777 system/storage/download/ chmod 0755 or 0777 system/storage/logs/ chmod 0755 or 0777 system/storage/modification/ chmod 0755 or 0777 system/storage/session/ chmod 0755 or 0777 system/storage/upload/ chmod 0755 or 0777 system/storage/vendor/ chmod 0755 or 0777 image/ chmod 0755 or 0777 image/cache/ chmod 0755 or 0777 image/catalog/ chmod 0755 or 0777 config.php chmod 0755 or 0777 admin/config.php If 0755 does not work try 0777. ... |
Set the file permissions
|
1 2 3 4 5 |
teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo chmod -R 0755 system/* [sudo] password for teddy: teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo chmod -R 0755 image/* teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo chmod -R 0755 config.php teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo chmod -R 0755 admin/config.php |
Setup with Nginx
|
1 |
teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo gedit /etc/nginx/sites-available/opencart3.test |
Here is the content
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
server { listen 80; listen [::]:80; root /home/teddy/Documents/works/opencart-3.0.3.2/upload; #your document root server_name www.opencart3.test opencart3.test ; # Your server name index index.php index.html index.htm ; # Webfonts,fonts location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { add_header "Access-Control-Allow-Origin" "*"; expires 1y; access_log off; add_header Cache-Control "public"; } # Media: images, icons, video, audio, HTC location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1y; access_log off; add_header Cache-Control "public"; } # Js, Css location ~* \.(?:css|js)$ { expires 1y; access_log off; add_header Cache-Control "public"; } # Serve static files without touching php location / { try_files $uri $uri/ /index.php?$args; } # pass requests for dynamic content to site location ~ [^/]\.php(/|$) { try_files $uri /index.php; fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_buffers 1024 4k; fastcgi_read_timeout 600s; fastcgi_connect_timeout 600s; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #include fastcgi_params; #FOR DEVELOPMENT MODE ONLY - BEGIN fastcgi_param MAGE_IS_DEVELOPER_MODE true; fastcgi_param PHP_VALUE display_startup_errors=on; fastcgi_param PHP_VALUE display_errors=on; fastcgi_param PHP_VALUE html_errors=on; fastcgi_param PHP_VALUE log_errors=on; fastcgi_param PHP_VALUE error_log=/home/teddy/Documents/works/opencart-3.0.3.2/upload/var/log/system.log; #FOR DEVELOPMENT MODE ONLY - END include fastcgi_params; } gzip on; gzip_disable "msie6"; gzip_comp_level 6; gzip_min_length 1100; gzip_buffers 16 8k; gzip_proxied any; gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss image/svg+xml; gzip_vary on; # Banned locations (only reached if the earlier PHP entry point regexes don't match) location ~* (\.php$|\.htaccess$|\.git) { deny all; } } |
NOTE: don’t forget to create the log file in var/log/system.log
Then
|
1 |
teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo ln -s /etc/nginx/sites-available/opencart3.test /etc/nginx/sites-enabled/opencart3.test |
Then
|
1 |
teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo gedit /etc/hosts |
Insert this line:
|
1 2 3 |
... 127.0.0.1 opencart3.test ... |
Then check the nginx config and restart nginx
|
1 2 3 4 5 |
teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo nginx -t nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo service nginx restart |
Set the files owner
|
1 |
teddy@teddy:~/Documents/works/opencart-3.0.3.2/upload$ sudo chown www-data:www-data -R . |
Open it on your browser http://opencart3.test. For the first time, it’ll install OpenCart.
Note: Create a new database ‘opencart3’ with collation utf8-general-ci
Admin:
Then follow the instructions
NOTE: I also need to change the PHP setting in php.ini (IN THE opencart DIR). Change some settings like
|
1 2 3 4 |
... ;memory_limit = 64M memory_limit = 1280M ... |
admin url: http://opencart3.test/admin
opencart version 3.0.3.2 (/home/teddy/Documents/works/opencart-3.0.3.2/upload/index.php)
Create Apache2 Setting
CREATE A CONF
|
1 |
sudo gedit /etc/apache2/sites-available/opencart3.test.conf |
CONTENT
|
1 2 3 4 5 6 7 8 9 10 11 12 |
<VirtualHost opencart3.test:80> ServerName opencart3.test DocumentRoot "/home/satria/Documents/projects/opencart-3.0.3.8/upload" DirectoryIndex index.php <Directory "/home/satria/Documents/projects/opencart-3.0.3.8/upload"> AllowOverride All Allow from All Require all granted </Directory> ErrorLog /var/log/apache2/opencart3.error.log CustomLog /var/log/apache2/opencart3.access.log combined </VirtualHost> |
ENABLE THE VIRTUALHOST
|
1 |
sudo a2ensite opencart3.test.conf |
RELOAD APACHE2
|
1 |
sudo systemctl reload apache2 |
CREATE THE HOST
|
1 |
sudo gedit /etc/hosts |
|
1 |
127.0.0.1 opencart3.test |
RELOAD APACHE2
|
1 |
sudo systemctl reload apache2 |
RENAME config-dist.php AND admin/config-dist.php TO config.php TO admin/config.php
SET THE FILE PERMISSIONS & RELOAD APACHE2
|
1 2 3 4 5 |
satria@teddy:~/Documents/projects/opencart-3.0.3.8/upload$ sudo chmod -R 0755 . satria@teddy:~/Documents/projects/opencart-3.0.3.8/upload$ sudo chmod -R 0777 system/storage/ satria@teddy:~/Documents/projects/opencart-3.0.3.8/upload$ sudo chmod 777 config.php satria@teddy:~/Documents/projects/opencart-3.0.3.8/upload$ sudo chmod 777 admin/config.php satria@teddy:~/Documents/projects/opencart-3.0.3.8/upload$ sudo chmod -R 777 image/ |
Open: http://opencart3.test