当前位置: 首页 > 后端技术 > PHP

Linux开发基础环境搭建

时间:2023-03-29 17:40:17 PHP

服务器配置免密登录,配置公钥连接复制本地公钥到服务器$ssh-copy-id-i~/.ssh/id_rsa.pubroot@192.168.100.80更换阿里yum源更换centos-7.repowgethttp://mirrors.aliyun.com/repo/Centos-7.repo#备份mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backupmvCentos-7.repo/etc/yum.repos.d/CentOS-Base.repoyummakecacheyumupdate添加CentOS7EPEL仓库安装第三方yum源,这里使用Fedora的epel仓库$sudoyuminstallepel-release编译环境安装和编译环境yumgroupinstall-y'DevelopmentTools'sudoyuminstall-ygccgcc-c++autoconfautomakeopensslopenssl-develcurlcurl-develcmakecmake3gdbm-develre2cflexbisonnanolibtoollibxml2-devellibjpeg-devellibpng-develfreetype-devellibmcrypt-develbzip2-devellibcurl-devellibicu-devellibwebp-devellibzip-devzlib-devel安装Git安装git$yuminstall-ygitinstallnginxinstallNginxyuminstall-ynginxstartNginxsudosystemctlstartnginx.servicebootstartNginxsudosystemctlenablenginx.service安装Redis安装Redis$yuminstallredis启动Redis$serviceredisstart修改端口号/密码等配置$vim/etc/redis.conf测试登录$redis-cli-h127.0.0.1-p6379setbootself-startsystemctlenableredisinstallmysqlinstall#下载mysql源码安装包$wgethttp://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm#安装mysql源$yumlocalinstallmysql80-community-release-el7-1.noarch.rpm#安装mysql$yuminstallmysql-community-server#启动MySQL服务$systemctlstartmysqld$systemctlstatusmysqld#启动$systemctlenablemysqld$systemctldaemon-reload#查看密码$grep'临时密码'/var/log/mysqld.log#生成的密码root@localhost:kqeIpRI1pU-Dev#Login$mysql-uroot-p#修改密码$ALTERUSER'root'@'localhost'IDENTIFIEDBY'kqeIpRI1pU-Dev';安装php参考:https://webtatic.com/packages/php72/安装PHPyuminstallepel-releaserpm-Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpmyuminstallphp72w-fpmphp72w-opcacheyum安装php72w-ztsphp72w-cliphp72w-mysqlphp72w-mbstringphp72w-xmlphp72w-gdphp72w-develyum安装php72w-bcmathsophp72wphp72w-amqplib