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

相关文章

如何搭建并配置HTTPD文件服务及访问权限控制

《如何搭建并配置HTTPD文件服务及访问权限控制》:本文主要介绍如何搭建并配置HTTPD文件服务及访问权限控制的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、安装HTTPD服务二、HTTPD服务目录结构三、配置修改四、服务启动五、基于用户访问权限控制六、

pytest+allure环境搭建+自动化实践过程

《pytest+allure环境搭建+自动化实践过程》:本文主要介绍pytest+allure环境搭建+自动化实践过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录一、pytest下载安装1.1、安装pytest1.2、检测是否安装成功二、allure下载安装2.

使用vscode搭建pywebview集成vue项目实践

《使用vscode搭建pywebview集成vue项目实践》:本文主要介绍使用vscode搭建pywebview集成vue项目实践,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录环境准备项目源码下载项目说明调试与生成可执行文件核心代码说明总结本节我们使用pythonpywebv

CentOS 7 YUM源配置错误的解决方法

《CentOS7YUM源配置错误的解决方法》在使用虚拟机安装CentOS7系统时,我们可能会遇到YUM源配置错误的问题,导致无法正常下载软件包,为了解决这个问题,我们可以替换YUM源... 目录一、备份原有的 YUM 源配置文件二、选择并配置新的 YUM 源三、清理旧的缓存并重建新的缓存四、验证 YUM 源

Windows Server 2025 搭建NPS-Radius服务器的步骤

《WindowsServer2025搭建NPS-Radius服务器的步骤》本文主要介绍了通过微软的NPS角色实现一个Radius服务器,身份验证和证书使用微软ADCS、ADDS,具有一定的参考价... 目录简介示意图什么是 802.1X?核心作用802.1X的组成角色工作流程简述802.1X常见应用802.

Spring Cloud GateWay搭建全过程

《SpringCloudGateWay搭建全过程》:本文主要介绍SpringCloudGateWay搭建全过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录Spring Cloud GateWay搭建1.搭建注册中心1.1添加依赖1.2 配置文件及启动类1.3 测

SpringBoot快速搭建TCP服务端和客户端全过程

《SpringBoot快速搭建TCP服务端和客户端全过程》:本文主要介绍SpringBoot快速搭建TCP服务端和客户端全过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,... 目录TCPServerTCPClient总结由于工作需要,研究了SpringBoot搭建TCP通信的过程

Gradle下如何搭建SpringCloud分布式环境

《Gradle下如何搭建SpringCloud分布式环境》:本文主要介绍Gradle下如何搭建SpringCloud分布式环境问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录Gradle下搭建SpringCloud分布式环境1.idea配置好gradle2.创建一个空的gr

Linux搭建单机MySQL8.0.26版本的操作方法

《Linux搭建单机MySQL8.0.26版本的操作方法》:本文主要介绍Linux搭建单机MySQL8.0.26版本的操作方法,本文通过图文并茂的形式给大家讲解的非常详细,感兴趣的朋友一起看看吧... 目录概述环境信息数据库服务安装步骤下载前置依赖服务下载方式一:进入官网下载,并上传到宿主机中,适合离线环境

CentOS和Ubuntu系统使用shell脚本创建用户和设置密码

《CentOS和Ubuntu系统使用shell脚本创建用户和设置密码》在Linux系统中,你可以使用useradd命令来创建新用户,使用echo和chpasswd命令来设置密码,本文写了一个shell... 在linux系统中,你可以使用useradd命令来创建新用户,使用echo和chpasswd命令来设