apache - 在同一个 apache http 服务器上启动两个应用程序
问题描述
我正在开发两个应用程序,并将它们放在同一个 Apache 服务器上。我为每个应用程序在 conf 和 bin 上创建了一个文件: apache/conf/httpd_app1.conf : application1 apache/conf/httpd_app2.conf : application2
apache/bin/apachectl_app1 apache/bin/apachectl_app2
我配置了每一个的虚拟主机,
但是当我指向第一个应用程序时,它会将我重定向到另一个应用程序,有时会反过来。我不明白我错过了什么以及我必须做什么。
解决方案
将此代码添加到 httpd.conf
<VirtualHost 172.20.30.40:80>
ServerAdmin webmaster@www1.example.com
DocumentRoot "/www/vhosts/www1"
ServerName www1.example.com
ErrorLog "/www/logs/www1/error_log"
CustomLog "/www/logs/www1/access_log" combined
</VirtualHost>
<VirtualHost 172.20.30.50:80>
ServerAdmin webmaster@www2.example.org
DocumentRoot "/www/vhosts/www2"
ServerName www2.example.org
ErrorLog "/www/logs/www2/error_log"
CustomLog "/www/logs/www2/access_log" combined
</VirtualHost>
推荐阅读
- security - Izito 和类似网站不断出现在我的谷歌搜索结果中
- go - 工厂模式中的结构继承
- sqlite - SQLite 通过列选择查询 foreach
- google-cloud-logging - Google Cloud CDN 未记录无服务器 Negs
- android - 我正在尝试将多个图像从 firebase 显示到 viewpager
- github - 如何在 github 上轻松查看带有 ipynb 扩展名的文件
- docker - Docker、微服务和网络
- java - 运行spring批处理作业时无法反序列化执行上下文异常
- javascript - Angular 8对象数组上的多个过滤器
- python - 多项式回归:ValueError:形状(88,1)和(3,1)未对齐:1(dim 1)!= 3(dim 0)