以下内容都已经过试验,边走边记,懒得排版

  • 安装aphach
  yum install -y httpd

  systemctl start httpd
netstat -tulp
 
  •  安装桌面

尽量不用桌面,实在是太耗资源,1G内存立马就满了,1核cpu到60%; 

yum groupinstall -y    'Desktop'   'X Window System'  #xclock试图形化

yum -y groupinstall "X Window System" "Chinese Support" "Desktop"

yum grouplist

yum groupinstall "GNOME Desktop" "Graphical Administration Tools" //是否需要?

yum install epel-release
yum install xrdp
yum install tigervnc-server
vncpasswd root
SElinux应该关闭它
sestatus
setenforce 0
firewall-cmd --permanent --zone=public --add-port=3389/tcp

firewall-cmd --permanent --zone=public --add-port=5901-5905/tcp
firewall-cmd --reload
systemctl start xrdp

参考https://www.cnblogs.com/xiaochina/p/6900234.html

  • 安装mysql

  

yum -y remove mysql //移除所有mysql相关,包括mariadb
wget http://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
yum localinstall mysql57-community-release-el7-.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld
systemctl enable mysqld
grep 'temporary password' /var/log/mysqld.log//找密码
mysql -u root -p
set password for 'root'@'localhost'=password('MyNewPass4!');

配置文件:/etc/my.cnf 
日志文件:/var/log//var/log/mysqld.log 
服务启动脚本:/usr/lib/systemd/system/mysqld.service 
socket文件:/var/run/mysqld/mysqld.pid

如果忘记root密码,则按如下操作恢复:

在[mysqld]的段中加上一句:skip-grant-tables 保存并且退出vi。
mysql -u root
update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
flush privileges

show variables like 'port';

默认远程连接是3306端口,可以在/etc/my.cnf里加上port=???改为别的端口,但记得在阿里云服务器管理的安全组中,打开相应的端口。

记得要use mysql  update user set host='%' where user='root'

  • 安装php
yum -y install php
yum install php-mysql
yum install -y php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-bcmath
  • 安装git服务

yum -y install git

useradd -m -d /home/git -s /usr/bin/git-shell git //创建一个git连接的专用账户

passwd git //修改git用户的密码

git init --bare /home/git/??? //创建空的仓库

chown -R git:git yhmd.git  //给git用户操作权限

git@39.98.205.57:/home/git/??? //仓库地址

服务器端 git clone /home/git/yhmd.git  会在当前目录生成yhmd/.git  yhmd/yhmd  用yhmd/yhmd做为web目录即可

yhmd.git/hooks/post-receive   hook  git pull

chmod +x /home/git/yhmd.git/hooks/post-receive //增加脚本执行权限

chown -R git:git /var/www/html/yhmd/

ssh-keygen -t rsa -C "35955204@qq.com"

生成key,将.pub内容复制到authorized_keys里,另一个文件就是key

自动部署 hooks/post-receive内容

#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "接收到master分支提交,正在发布中..."
git --work-tree=/var/www/html/yhmd --git-dir=/home/git/yhmd.git checkout -f master
else
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
fi
done

记录下我的阿里云centos服务器之路的更多相关文章

  1. 记录下spingboot连接阿里云服务器上的MySQL数据库报错

    错误大概如下: create connection SQLException, url: jdbc:mysql://'IP地址':3306/code007?useUnicode=true&ch ...

  2. 阿里云(centos)下svn 服务器搭建

    安装说明 系统环境:阿里云centos安装方式:yum install subversion 检查已安装版本 #检查是否安装了低版本的SVN[root@localhost /]# rpm -qa su ...

  3. 阿里云Centos 7安装MongoDB 4.2.0

    背景:最近公司项目需要将后台接口优化到100ms内.因此需要对接口逻辑,数据优化做处理, 正好使用到了Redis缓存,mysql,mongoDB的优化,今天记录一下在阿里云centos上安装mongo ...

  4. CentOS6 配置阿里云 NTP 服务

    本文以Centos 6.5为例介绍如何修改Linux实例时区,以及开启和配置Linux NTP服务,保证实例本地时间精确同步. 前提条件 NTP服务的通信端口为UDP 123,设置NTP服务之前请确保 ...

  5. 阿里云CentOS Linux服务器上搭建邮件服务器遇到的问题

    参考文章: 阿里云CentOS Linux服务器上用postfix搭建邮件服务器 Linux系统下邮件服务器的搭建(Postfix+Dovecot) 本来想自己搭建邮件服务器,但是看到一篇资料表示阿里 ...

  6. [转]阿里云CentOS 7.1使用yum安装MySql5.6.24

    阿里云CentOS 7.1使用yum安装MySql5.6.24 作者:vfhky | 时间:2015-06-25 09:43 | 分类:web 在前面两篇文章<2015博客升级记(四):Cent ...

  7. 阿里云centos中mysql的安装及一些常识知识

    -------------------------------------------------------------------    阿里云centos中mysql的安装 工具WinSCP v ...

  8. 杂项-分布式-EDAS:深度解析阿里云EDAS服务

    ylbtech-杂项-分布式-EDAS:深度解析阿里云EDAS服务 1.返回顶部 1. 深度解析阿里云EDAS服务 弹性伸缩 摘要: 第一种只适用于业务较少的情况,而在新业务不断增加的情况下,增加新应 ...

  9. 阿里云CentOS自动备份MySql 8.0并上传至七牛云

    本文主要介绍一下阿里云CentOS7下如何对MySql 8.0数据库进行自动备份,并使用.NET Core 将备份文件上传至七牛云存储上,并对整个过程所踩的坑加以记录. 环境.工具.准备工作 服务器: ...

随机推荐

  1. JSP自定义tld方法标签

    卧槽 我们可以通过tld文件,自定义一个方法标签,以便在页面中使用,目录通常放在WEB-INF下面的tlds文件夹: 引入方式示例,直接在jsp上引入tld标签文件: <%@ taglib pr ...

  2. RHCE认证经典考题

    1:按要求创建用户组及多个用户,设置用户的候选组,设置用户的默认shell. 创建组adminuser. 创建用户natasha和harry属于该组(该组为他们的第二个组). 创建用户sarah,不属 ...

  3. 【homework #1】第一次作业被虐感受

    当大二暑假结束,我发现我还是没有熟练掌握一门编程语言时,我就知道苦日子要来了. 这不,才开学第三周,就已经被虐的体无完肤了.连编译课用C语言写的词法分析,都要写很久.Debug很久才能写出来,更别提大 ...

  4. java读取文件(更新jdk7及jdk8)

    以字节的方式读取: InputStream inputStream = new FileInputStream(file); int temp = -1; StringBuilder sb = new ...

  5. SQLServer存储引擎——06.索引的遍历与维护

    一.遍历 索引树的每个节点都是一个页面. 索引树有三种类型的节点:根节点.中间节点.叶子节点. (1) 根节点与中间节点一样,只包含下一层节点的入口值与入口指针,它们称为索引节点: (2) 叶子节点包 ...

  6. PAT1039

    小红想买些珠子做一串自己喜欢的珠串.卖珠子的摊主有很多串五颜六色的珠串,但是不肯把任何一串拆散了卖.于是小红要你帮忙判断一下,某串珠子里是否包含了全部自己想要的珠子?如果是,那么告诉她有多少多余的珠子 ...

  7. PHP共享内存的应用shmop系列

    简单的说明 可能很少情况会使用PHP来操控共享内存,一方面在内存的控制上,MC已经提供了一套很好的方式,另一方面,自己来操控内存的难度较大,内存的读写与转存,包括后面可能会用到的存储策略,要是没有一定 ...

  8. 解决报错DEFAULT_INCOMPATIBLE_IMPROVEMENTS

    freemarker整合springMVC报错如下:警告: Exception encountered during context initialization - cancelling refre ...

  9. HDU 3987 Harry Potter and the Forbidden Forest(边权放大法+最小割)

    Harry Potter and the Forbidden Forest Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65536/ ...

  10. 配置ubuntu16.04下Theano使用GPU运行程序的环境

    ubuntu16.04默认安装了python2.7和python3.5 .本教程使用python3.5 第一步:将ubuntu16.04默认的python2修改成默认使用python3 . sudo ...