本人阿里云购买的center os7.2系统,小程序只支持https,因此需要配置https

安装apache

yum -y install httpd

systemctl start httpd

apache配置虚拟目录

<VirtualHost *:80>
  DocumentRoot /var/www/html
  ServerName www.linuxprobe.org
</VirtualHost>
 
<VirtualHost *:80>
  DocumentRoot /var/www/html/qq
  ServerName www.virtual.host
  ServerAdmin webmaster@virtual.host
</VirtualHost>
 

安装php

yum -y install php php-mbstring php-pear

安装php的扩展
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

安装ssl模块

yum install httpd mod_ssl

证书可在阿里云免费申请,申请通过后,可得到一个含有四个文件的压缩包,解压后得到四个文件,可传到比如七牛云存储备用

在httpd目录下创建文件夹cert  (文件目录可自行选择,但下面修改配置文件时要根据实际目录)

mkdir cert

将证书文件下载到cert目录

wget http://7d9lp7.com1.z0.glb.clouddn.com/214473667220217.key

wget http://7d9lp7.com1.z0.glb.clouddn.com/214473667220217.pem
wget http://7d9lp7.com1.z0.glb.clouddn.com/chain.pem
wget http://7d9lp7.com1.z0.glb.clouddn.com/public.pem

修改httpd/conf.d/ssl.conf

# 证书公钥配置
SSLCertificateFile etc/httpd/cert/public.pem
# 证书私钥配置
SSLCertificateKeyFile etc/httpd/cert/214473667220217.key
# 证书链配置,如果该属性开头有 '#'字符,请删除掉
SSLCertificateChainFile etc/httpd/cert/chain.pem 如果是腾讯云,则三个文件名称有些改变:分别是1_root_bundle.crt,2_www.tinystudio.cn.crt,3_www.tinystudio.cn.key
分别对应修改如下:
SSLCertificateFile etc/httpd/cert/2_www.tinystudio.cn.crt
SSLCertificateKeyFile etc/httpd/cert/3_www.tinystudio.cn.key
SSLCertificateChainFile etc/httpd/cert/1_root_bundle.crt

安全组增加443端口

当使用vim一不小心编辑目录时,可用去q!命令退出。。。。。。

用到的参考链接:http://www.jb51.net/article/97434.htm

安装mysql

开始安装


rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

yum install -y mysql-server

设置开机启动Mysql


systemctl enable mysqld.service

开启服务


systemctl start mysqld.service

查看mysql默认密码
grep 'temporary password' /var/log/mysqld.log
登录:
mysql -p
修改密码:alter user root@localhost identified by 'tyzZ001!';
相关参考链接:https://yq.aliyun.com/articles/277545?spm=5176.10695662.1996646101.searchclickresult.2d7e94ba8an3tZ 安装ftp

1.安装vsftpd

1
2
# yum check-update
# yum -y install vsftpd

2.配置参数

1
# vi /etc/vsftpd/vsftpd.conf

修改为如下参数

1
2
3
4
5
6
anonymous_enable=NO
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=40100

local_umask = 022为文件创建初始权限,与chmod的用法正好相反

假设umask为022,则对于一个文件夹的话,它的默认属性为 777-022=755,这也就是我们平时建立文件夹的权限。而对于一般的文件的话,则是用 666-022=644.

umask是unix操作系统的概念,umask决定目录和文件被创建时得到的初始权限
umask = 022 时,新建的目录 权限是755,文件的权限是 644
umask = 077 时,新建的目录 权限是700,文件的权限时 600

3.重启ftp

1
2
# systemctl restart vsftpd.service
# systemctl enable vsftpd.service

4.修改防火墙配置

1
2
3
# firewall-cmd --permanent --add-service=ftp
# firewall-cmd --reload
# setsebool -P ftp_home_dir on

5.为ftp创建一个用户test1(指定目录为/home/www,不允许远程登录shell)

1
# useradd -d /var/www -m test1 -s /sbin/nologin

6.为ftp用户设置一个密码

1
# passwd test1
7、修改目录权限:chmod -R 777 /var/www

支持mcrypt:    yum install php-mcrypt  (可参考这个:http://www.leixuesong.cn/63   不一定就对)
还有参考这个:https://www.cnblogs.com/huangzhen/archive/2012/09/12/2681861.html

center os7.2 apache+php+mysql环境配置并设置https访问的更多相关文章

  1. Apache+php+mysql环境配置

    Apache+PHP+MySQL环境搭建 标题格式 正文格式 阶段性完成格式 正文中强调格式 ————————————————————————————— 前语:本文是从我写过的doc文档迁移过来的,由 ...

  2. windows 7 64bit 下apache php mysql 环境配置

    在64位环境下安装apache,php和配置过程 准备好安装包.(64位版本) Apache 下载地址:http://www.apachelounge.com/download/ Php 下载地址:h ...

  3. Apache+Django+Mysql环境配置

    环境要求:Apache:2.2  Mysql:5.5 Django:1.5 python:2.7 首先下载mod_wsgi-win32-ap22py27-3.3.so 下载下来后,改名成mod_wsg ...

  4. windows下apache+php+mysql 环境配置方法

    一 准备 1 下载apache http://httpd.apache.org/download.cgi#apache24 httpd-2.2.22-win32-x86-openssl-0.9.8t. ...

  5. os mac apache+php+mysql环境配置

    1.启用系统自带的apache 服务 打开终端(terminal) #sudo apachectl start #sudo vi /etc/apache2/httpd.conf 修改 LoadModu ...

  6. Ubuntu+Apache+PHP+Mysql环境搭建(完整版)

    Ubuntu+Apache+PHP+Mysql环境搭建(完整版) 一.操作系统Ubuntu 14.04 64位,阿里云服务器 二.Apache 1.安装Apache,安装命令:sudo apt-get ...

  7. Linux(Centos7)搭建LAMP(Apache+PHP+Mysql环境)

    目录 Linux搭建LAMP(Apache+PHP+Mysql环境)Centos7 一. 检查系统环境 1.确认centos版本 2.检查是否安装过apache 3.检查是否安装过Mysql 4.清理 ...

  8. Ubuntu+Apache+PHP+Mysql环境搭建(完整版)(转)

    http://www.2cto.com/os/201505/401588.html Ubuntu+Apache+PHP+Mysql环境搭建(完整版) 一.操作系统Ubuntu 14.04 64位,阿里 ...

  9. Apache+PHP+MySQL环境搭建

    准备安装包:Apache: apache_2.2.11-win32.msi (http://pan.baidu.com/s/1nvdiNcH)PHP: php-5.2.5-Win32.zip (htt ...

随机推荐

  1. LeetCode-Lowest Common Ancestor of a Binary Tre

    Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...

  2. Array.prototype.filter(Boolean)

    ES5 中的数组有这个方法:Array.prototype.filter ,具体使用参考MDN,这里讲一个特殊应用: 回顾下语法: new_array = arr.filter(callback[, ...

  3. HDU 5701 中位数计数 百度之星初赛

    中位数计数 Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Sub ...

  4. 小程序 修改按钮button样式:去边框、圆角及文字居左对齐、修改按钮高度

    因为有要button和view显示的样式相同的需要 所以要去掉按钮的边框,圆角,背景色,文字需要居左对齐,代码如下: 关键是按钮的样式: 1. 去掉边框: .user-phone-btn::after ...

  5. mysql 创建函数ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_f

    mysql 创建函数的时候 报错 ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL D ...

  6. Python 3.5 中的异步HTTP请求写法

    Python 3.5 增加了对async def and await的支持,同样的异步代码看起来干净了很多,也更易读. import aiohttp import asyncio async def ...

  7. SpringBoot-URL路由:@Controller和@RequestMapping

    SpringBoot定义URL处理方法:@Controller和@RequestMapping @Controller标注的类表示的是一个处理HTTP请求的控制器(即MVC中的C),该类中所有被@Re ...

  8. (2.5)Mysql之SQL基础——数据类型

    (2.5)Mysql之SQL基础——数据类型 关键词:mysql数据类型 目录: 一.整数型 二.小数型(以下均不能使用无符号) 三.日期时间型 四.字符串型 一.整数型 额外参数示例: int [( ...

  9. Linux PHP7的openssl扩展安装

    Linux环境下使用PHPmailer发送邮件时,出现如下错误: SMTP -> ERROR: Failed to connect to server: Unable to find the s ...

  10. PAT 1093 Count PAT's[比较]

    1093 Count PAT's (25 分) The string APPAPT contains two PAT's as substrings. The first one is formed ...