centos7下yum安装nginx+apache+mysql
- 2016-03-02 15:40:50
- 运维
- 24
- shevechco
下载对应当前系统版本的nginx包(package)
01.wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
建立nginx的yum仓库
01.rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
下载并安装nginx
01.yum install nginx
启动nginx服务
01.systemctl start nginx.service #启动nginx02.systemctl enable nginx.service #加入到开机启动
默认的配置文件在 /etc/nginx 路径下,使用该配置已经可以正确地运行nginx;如需要自定义,修改其下的 nginx.conf 等文件即可。
安装mariadb
01.yum install mariadb mariadb-server #询问是否要安装,输入Y即可自动安装,直到安装完成02.systemctl start mariadb.service #启动MariaDB03.systemctl stop mariadb.service #停止MariaDB04.systemctl restart mariadb.service #重启MariaDB05.systemctl enable mariadb.service #设置开机启动06.cp /usr/share/mysql/my-huge.cnf /etc/my.cnf #拷贝配置文件(注意:如果/etc目录下面默认有一个my.cnf,直接覆盖即可)
安装apache及其扩展
01.yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql02.systemctl start httpd.service #启动apache03.systemctl stop httpd.service #停止apache04.systemctl restart httpd.service #重启apache05.systemctl enable httpd.service #设置开机启动
安装php及其扩展
01.yum -y install php php-cli php-curl php-intl php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-mysql php-odbc php-mbstring php-devel
nginx配置文件在/etc/nginx/nginx.conf
apache配置文件在/etc/httpd/conf/httpd.conf
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.sulao.cn/post/190
相关推荐
- flask使用nginx代理以后图片上传和加载问题解决方法
- nginx反向代理http/https、rpc/grpc、ws/wss
- centos7安装CUDA Tookit+CUDA Samples+NCCL+OpenMPI
- centos7添加交换分区swap
- centos7升级systemd并切换cgroup v1到cgroup v2
- centos7下程序运行提示报错version `GLIBCXX_3.4.20` not found
- centos7安装GUI图形界面
- centos7使用haproxy部署k8s高可用集群
- nginx四层负载均衡配置解析以及卡顿问题的处理
- centos7删除POD一直Terminating无法销毁