centos7安装nginx/php7+/swoole4+/msyql(MariaDB10.3)

1.升级系统
    yum -y update
    
2. 安装tools
    注:参考地址----> http://www.cnblogs.com/roooookie/p/8473640.html
        1.    yum -y install perl gcc gcc-c++ make cmake kernel kernel-headers kernel-devel net-tools
        2.    安装tools
        2.    vmhgfs-fuse .host:/htdocs /mnt/hgfs 
    
    
    最小化安装tools工具
    http://www.cnblogs.com/roooookie/p/8473640.html
    
    https://bbs.csdn.net/topics/392053153?locationNum=2&fps=1
    
    //这两个不知道干啥,可以作参考
    vmhgfs-fuse .host:/htdocs /mnt/hgfs 
    mount -t vmhgfs .host:/htdocs /mnt/hgfs
    
1.安装nginx 
    yum install gcc-c++ 
    yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel 
    yum -y install pcre-devel zlib zlib-devel openssl openssl-devel
    
    ./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
    ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
    make && make install
    
    useradd -M -s /sbin/nologin nginx
    
        #修改nginx配置文件
        vim /usr/local/nginx/conf/nginx.conf

        把#user nobody 改成 user nginx;
        #测试一下nginx配置文件
        /usr/local/nginx/sbin/nginx -t

        #启动nginx
        /usr/local/nginx/sbin/nginx

        #一般来说在nginx的配置文件修改后进行如下操作,
        /usr/local/nginx/sbin/nginx -t检测一下配置文件是否正确,如果正确的话
        再使用/usr/local/nginx/sbin/nginx -s reload 使nginx平滑启动
        
2.安装php
        
        参考:        
            https://blog.csdn.net/qq_39629343/article/details/81807577
        
        ##                            yum provides php 
        #更新源                        rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm 
        ##                            rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
        #移除系统自带的php-common    yum remove php-common
                                    yum remove php*
                                    
                                    rpm -qa|grep php
                            
        #安装php7.2:            yum -y install php72w* --skip-broken
            或者                yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

            或者源码编译:        ./configure --prefix=/usr/local/php  --with-mysqli=mysqlnd  --with-pdo-mysql=mysqlnd  --with-openssl --with-freetype-dir  --enable-mbstring  --with-iconv-dir  --with-jpeg-dir  --with-png-dir  --with-zlib  --with-libxml-dir=/usr  --enable-xml   --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-ftp --with-gd --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --with-config-file-path=/etc  --with-config-file-scan-dir=/etc/php.d  --with-bz2   --enable-maintainer-zts  --enable-fpm  --with-fpm-user=nginx  --with-fpm-group=nginx

            卸载 xdebug(不然swoole没法用)
                1.搜索xdebug     yum search xdebug
                2. 移除xdeug     rpm -e php72w-pecl-xdebug-2.6.0-1.w7.x86_64
3. 安装swoole
        方式一:     pecl install swoole
        方式二:        https://blog.csdn.net/chhnang2016/article/details/81011576 
        
3.    安装mysql 
            cd /etc/yum.repos.d/
            vim MariaDB.repo
            
                {
# MariaDB 10.3 CentOS repository list - created 2019-02-15 15:50 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
                }    
                
                
            yum install MariaDB-server MariaDB-client
            systemctl start mariadb
            mysql_secure_installation

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值