标签:范围 防火墙 exp 图片 ble ted iptable copy zlib
Magento国内又被称为:麦进斗,被认为是全球范围内最实用、最完整的电子商务网站架构系统,它的可扩展性、灵活性、系统安全性和可靠性方面都处于领先地位,其版本1和2的安装方式对系统及其依赖软件有很苛刻的版本要求,本文就以选定的一个版本来做下安装演示。安装环境:
0:OS:Centos6 kernel:2.6.32-504.el6.x86_64
1:Web:Apache版本:2.4.34
2:应用:PHP版本:7.1.0
3:数据库:MySQL:5.6.40
4:Magento2:Magento:2-2.2.5
详细步骤如下:
1:Web:Apache版本:2.4.34
1.1:配置系统参数
1.1.1:关闭防火墙
[root@localhost ~]# /etc/init.d/iptables stop
[root@localhost ~]# chkconfig iptables off
1.1.2:关闭selinux
[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config
1.2:安装编译依赖包文件
1.2.1:编译需要的软件包
yum -y install gcc gcc-c++ automake autoconf libtool make ncurses-devel expat-devel bzip2-devel libicu-devel readline-devel recode-devel libtidy-devel libxml2 libxml2-devel libmcrypt mhash mcrypt libmcrypt-devel mhash-devel gd-devel mcrypt-devel openssl openssl-devel libxslt libxslt-devel curl curl-devel pcre-devel epel-release libmcrypt-devel
1.2.2:安装apr
APR(Apache portable Run-time libraries,Apache可移植运行库)的目的如其名称一样,主要为上层的应用程序提供一个可以跨越多操作系统平台使用的底层支持接口库。
cd /usr/local/src
wget http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.3.tar.gz
tar zxf apr-1.6.3.tar.gz &&
cd apr-1.6.3 &&
./configure --prefix=/usr/local/apr &&
make &&
make install &&
cd ..
1.2.3安装apr-util (复制执行)
cd /usr/local/src
wget http://mirrors.shu.edu.cn/apache/apr/apr-util-1.6.1.tar.gz &&
tar zxf apr-util-1.6.1.tar.gz &&
cd apr-util-1.6.1 &&
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr &&
make &&
make install &&
cd ..
1.3:下载使用源码包文件编译、安装 (复制执行)
cd /usr/local/src
wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.34.tar.gz &&
tar -zxf httpd-2.4.34.tar.gz &&
cd httpd-2.4.34
编译选项:
#./configure \
--prefix=/usr/local/apache \
--sysconfdir=/usr/local/apache/etc \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--enable-mods-shared=most \
--enable-mpms-shared=all \
--with-mpm=prefork
编译、安装
make && make install
1.4:配置Apache配置文件
1.4.1:启用rewrite模块
编辑httpd.conf查找下面的行,去掉前面的#号
#LoadModule rewrite_module modules/mod_rewrite.so
1.4.2:打开当前主机下面的地址重写功能
AllowOverride None修改成:AllowOverride All
1.4.3:启动对PHP的支持
修改Apache的配置文件httpd.conf中
DirectoryIndex index.html index.php` #添加index.php
找到:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
添加如下内容
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php
1.5:配置自动启动脚本文件
#cp /usr/local/apache/bin/apachectl /etc/init.d/httpd`
修改/etc/init.d/httpd
vi /etc/init.d/httpd在第二行添加下面两行
#chkconfig: 35 79 80
#description: Apache
示例如下:
[root@localhost httpd-2.4.34]# head /etc/init.d/httpd
#!/bin/sh
#chkconfig: 35 79 80 #本次添加
#description: Apache #本次添加
#Licensed to the Apache Software Foundation (ASF) under one or more
#contributor license agreements. See the NOTICE file distributed with
#this work for additional information regarding copyright ownership.
#The ASF licenses this file to You under the Apache License, Version 2.0
#(the "License"); you may not use this file except in compliance with
#the License. You may obtain a copy of the License at
[root@localhost httpd-2.4.34]#
添加系统启动
[root@localhost httpd-2.4.34]# chkconfig httpd --add
[root@localhost httpd-2.4.34]# /etc/init.d/httpd start
1.6:访问
2:应用:PHP版本:7.1.0
3:数据库:MySQL:5.6.40
4:Magento2:Magento:2-2.2.5
访问验证:
标签:范围 防火墙 exp 图片 ble ted iptable copy zlib
原文地址:http://blog.51cto.com/lifeng/2150701