买了百度云主机

  • 购买云服务器

    • 购买的原则很明确,便宜就行。买了百度云的,一年99。1核/1GB/40GB/普通型III

      • 使用了centos7

      • 配置ssh登录,顺便把mysql和http的端口也给开了。

        systemctl start firewalld
        systemctl status firewalld
        systemctl enable firewalld
        
        firewall-cmd --permanent --add-port=3306/tcp
        firewall-cmd --permanent --add-service=http
        firewall-cmd --permanent --add-service=ssh
        firewall-cmd --permanent --add-port=80/tcp
        firewall-cmd --permanent --add-port=8080/tcp
        
      • 是防火墙生效

        firewall-cmd --reload
        firewall-cmd --list-ports
        
    • 购买域名,我看一年的都挺便宜,越往后越贵,先这样吧,实在负担不起就换呗。xblog.site,需要实名认证,需要一个过程。

  • 软件

    • 一键安装所有编译工具

      yum groupinstall "Development Tools" "Server Platform Development" -y
      
    • Yum添加 Epel源

      wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
      rpm -ivh epel-release-latest-7.noarch.rpm
      yum repolist
      
    • 安装Nginx

      yum -y install nginx   使用yum安装nginx
      systemctl start nginx  启动nginx,浏览器输入ip就可以看到nginx的欢迎页
      
    • nginx 开启php解析(暂时空着)

    • 安装PHP

      # 配置源
      rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
      rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
      # 安装
      yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64 -y
      yum install php70w-fpm -y
      
    • 启动php-fpm

      systemctl start php-fpm
      
    • 配置php,关闭fix_pathinfo

      vi /etc/php.ini 按下esc进入命令模式,输入:/cgi.fix_pathinfo,按n
      进行下一个查找,找到指定cgi.fix_pathinfo, 修改为=0;
      
    • 安装mysql

      yum –y install mysql
      yum –y install mysql-devel
      # 添加官方mysql-server的yum源
      rpm -ivh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
      # 安装mysql-server
      yum -y install mysql-community-server
      
    • 启动mysql

      systemctl start mysqld
      
    • 配置mysql root密码

      mysql -uroot
      use mysql;
      UPDATE user SET Password = PASSWORD('root') WHERE user = 'root';
      FLUSH PRIVILEGES;
      
posted @ 2018-12-19 09:22  麦兜爱学习  阅读(204)  评论(0编辑  收藏  举报