Home>Article>Operation and Maintenance> Can apache and nginx be installed together?

Can apache and nginx be installed together?

(*-*)浩
(*-*)浩 Original
2019-06-06 16:17:21 8526browse

Can apache and nginx be installed together?

can be installed together. If there is no need to contact each other, just use different ports. For example, nginx uses 80 and apache uses 8080. If you want to use 8080 for access, you can use nginx as the front end of apache.

The following is the installation method:

apache: yum source installation method

1. yum source installation ( Internet connection required to download)

首先关闭apache服务 yum install httpd # 中间过程中输入:y

Result:

作为依赖被安装: apr.x86_64 0:1.4.8-3.el7_4.1 apr-util.x86_64 0:1.5.2-6.el7 httpd-tools.x86_64 0:2.4.6-67.el7.centos.6 mailcap.noarch 0:2.1.41-2.el7 完毕!

Nginx installation dependency package

//一键安装上面四个依赖 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

Download and unzip the installation Package

//创建一个文件夹 cd /usr/local mkdir nginx cd nginx //下载tar包 wget http://nginx.org/download/nginx-1.13.7.tar.gz

Install nginx

//进入nginx目录 cd /usr/local/nginx //执行命令 ./configure //执行make命令 make //执行make install命令 make install

For more Nginx related technical articles, please visit theNginx usage tutorialcolumn to learn!

The above is the detailed content of Can apache and nginx be installed together?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn