買了百度雲主機

  • 購買雲服務器php

    • 購買的原則很明確,便宜就行。買了百度雲的,一年99。1核/1GB/40GB/普通型IIImysql

      • 使用了centos7nginx

      • 配置ssh登陸,順便把mysql和http的端口也給開了。web

        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
      • 是防火牆生效sql

        firewall-cmd --reload
        firewall-cmd --list-ports
    • 購買域名,我看一年的都挺便宜,越日後越貴,先這樣吧,實在負擔不起就換唄。xblog.site,須要實名認證,須要一個過程。shell

  • 軟件centos

    • 一鍵安裝全部編譯工具瀏覽器

      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
    • 安裝Nginxphp7

      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;
相關文章
相關標籤/搜索