CentOS 7.3 搭建OpenCart

2024-05-23 23:58
文章标签 搭建 centos opencart 7.3

本文主要是介绍CentOS 7.3 搭建OpenCart,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!


title: CentOS 7.3 搭建OpenCart
date: 2017-07-19 20:24:01
tags: [OpenCart,CentOS]
categories: [PHP]

环境

  • Centos 7.3 64-bit
  • OpenCart 2.3.0.2

安装LAMP环境和OpenCart

  • How To Install OpenCart On CentOS 7 Linux

  • 配置支持SEO ,在OpenCart项目部署根目录下创建.htaccess文件,内容如下(需要在OpenCart后台打开SEO支持)

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.# 2. In your opencart directory rename htaccess.txt to .htaccess.# For any support issues please visit: http://www.opencart.comOptions +FollowSymlinks# Prevent Directoy listing
Options -Indexes# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch># SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/RewriteBase /
### rewrite all request to https
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
### rewrite all request to httpsRewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200# 7. disable open_basedir limitations
# php_admin_value open_basedir none
  • 配置支持https(需要在OpenCart后台打开https支持)

    • yum install mod_ssl openssl

    • 申请https支持证书(我自己是直接在阿里云上购买的免费的证书)

    • 将证书文件上传到服务器,并修改/etc/httpd/conf.d/ssl.conf文件,配置对应的证书文件(此处以阿里的说明为例子)

      # 添加 SSL 协议支持协议,去掉不安全的协议
      SSLProtocol all -SSLv2 -SSLv3
      # 修改加密套件如下
      SSLCipherSuite HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM
      SSLHonorCipherOrder on
      # 证书公钥配置
      SSLCertificateFile cert/public.pem
      # 证书私钥配置
      SSLCertificateKeyFile cert/xxxx.key
      # 证书链配置,如果该属性开头有 '#'字符,请删除掉
      SSLCertificateChainFile cert/chain.pem
      
    • 修改OpenCart项目下的config.phpadmin/config.php文件

      • config.php

        // HTTPS
        define('HTTPS_SERVER', 'http://yourdomain/');改成// HTTPS
        define('HTTPS_SERVER', 'https://yourdomain/');
      • admin/config.php

        // HTTPS
        define('HTTPS_SERVER', 'http://yourdomain/admin/');
        define('HTTPS_CATALOG', 'http://yourdomain/');改成// HTTPS
        define('HTTPS_SERVER', 'https://yourdomain/admin/');
        define('HTTPS_CATALOG', 'https://yourdomain/');
    • 重启httpd systemctl restart httpd

这篇关于CentOS 7.3 搭建OpenCart的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/996790

相关文章

Mycat搭建分库分表方式

《Mycat搭建分库分表方式》文章介绍了如何使用分库分表架构来解决单表数据量过大带来的性能和存储容量限制的问题,通过在一对主从复制节点上配置数据源,并使用分片算法将数据分配到不同的数据库表中,可以有效... 目录分库分表解决的问题分库分表架构添加数据验证结果 总结分库分表解决的问题单表数据量过大带来的性能

Java汇编源码如何查看环境搭建

《Java汇编源码如何查看环境搭建》:本文主要介绍如何在IntelliJIDEA开发环境中搭建字节码和汇编环境,以便更好地进行代码调优和JVM学习,首先,介绍了如何配置IntelliJIDEA以方... 目录一、简介二、在IDEA开发环境中搭建汇编环境2.1 在IDEA中搭建字节码查看环境2.1.1 搭建步

Python基于火山引擎豆包大模型搭建QQ机器人详细教程(2024年最新)

《Python基于火山引擎豆包大模型搭建QQ机器人详细教程(2024年最新)》:本文主要介绍Python基于火山引擎豆包大模型搭建QQ机器人详细的相关资料,包括开通模型、配置APIKEY鉴权和SD... 目录豆包大模型概述开通模型付费安装 SDK 环境配置 API KEY 鉴权Ark 模型接口Prompt

鸿蒙开发搭建flutter适配的开发环境

《鸿蒙开发搭建flutter适配的开发环境》文章详细介绍了在Windows系统上如何创建和运行鸿蒙Flutter项目,包括使用flutterdoctor检测环境、创建项目、编译HAP包以及在真机上运... 目录环境搭建创建运行项目打包项目总结环境搭建1.安装 DevEco Studio NEXT IDE

CentOS系统使用yum命令报错问题及解决

《CentOS系统使用yum命令报错问题及解决》文章主要讲述了在CentOS系统中使用yum命令时遇到的错误,并提供了个人解决方法,希望对大家有所帮助,并鼓励大家支持脚本之家... 目录Centos系统使用yum命令报错找到文件替换源文件为总结CentOS系统使用yum命令报错http://www.cppc

搭建Kafka+zookeeper集群调度

前言 硬件环境 172.18.0.5        kafkazk1        Kafka+zookeeper                Kafka Broker集群 172.18.0.6        kafkazk2        Kafka+zookeeper                Kafka Broker集群 172.18.0.7        kafkazk3

【IPV6从入门到起飞】5-1 IPV6+Home Assistant(搭建基本环境)

【IPV6从入门到起飞】5-1 IPV6+Home Assistant #搭建基本环境 1 背景2 docker下载 hass3 创建容器4 浏览器访问 hass5 手机APP远程访问hass6 更多玩法 1 背景 既然电脑可以IPV6入站,手机流量可以访问IPV6网络的服务,为什么不在电脑搭建Home Assistant(hass),来控制你的设备呢?@智能家居 @万物互联

pico2 开发环境搭建-基于ubuntu

pico2 开发环境搭建-基于ubuntu 安装编译工具链下载sdk 和example编译example 安装编译工具链 sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib 注意cmake的版本,需要在3.17 以上 下载sdk 和ex

centos 6安装 vim

centos 安装vim 1.首先查询当前当前vim所依赖的包存在不存在.检查缺少哪个几个依赖包 [root@bogon firstCopy]# rpm -qa|grep vivimvim-common-7.4.160-5.el7.x86_64vim-enhanced-7.4.160-5.el7.x86_64vim-filesystem-7.4.160-5.el7.x86_64vim-

NGINX轻松管理10万长连接 --- 基于2GB内存的CentOS 6.5 x86-64

转自:http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=190176&id=4234854 一 前言 当管理大量连接时,特别是只有少量活跃连接,NGINX有比较好的CPU和RAM利用率,如今是多终端保持在线的时代,更能让NGINX发挥这个优点。本文做一个简单测试,NGINX在一个普通PC虚拟机上维护100k的HTTP