apache - 配置 URL 映射

标签 apache ubuntu linode

我在 Linode 有一个云托管。这是我的 IP:123.456.789.111

我有这个配置文件
/etc/apache2/sites-available/nunitocalzada.com.conf

# domain: example.com
# public: /var/www/nunitocalzada.com/public_html/

    <VirtualHost *:80>
      # Admin email, Server Name (domain name), and any aliases
      ServerAdmin webmaster@nunitocalzada.com
      ServerName  www.nunitocalzada.com
      ServerAlias nunitocalzada.com

      # Index file and Document Root (where the public files are located)
      DirectoryIndex index.html index.php
      DocumentRoot /var/www/nunitocalzada.com/public_html
      # Log file locations
      LogLevel warn
      ErrorLog  /var/www/nunitocalzada.com/log/error.log
      CustomLog /var/www/nunitocalzada.com/log/access.log combined
    </VirtualHost>

我在同一台服务器上也有一个 tomcat 应用程序。
这是应用程序 http://123.456.789.111:8080/myapp/ 的 URL

我想进入这个域 www.nunitocalzada.com 中的应用程序

所以我创建了这个文件 /var/www/nunitocalzada.com/public_html/index.html :
<html><head><title>Nunito Calzada</title></head>
<frameset cols="*">
 <frame name="main" src="http://123.456.789.111:8080/myapp/" scrolling="auto" noresize>
 <noframes>
 <body>

 Your browser does not support frames

 </body>
 </noframes>
</frameset>
</html>

但我想有更好的方法来做到这一点

最佳答案

执行此操作的标准方法是通过反向代理,这样可以避免在 URL 或帧中使用高端口号。网络上有大约一万亿种在 Tomcat 前使用带有 mod_proxy 的 Apache 的方法。

关于apache - 配置 URL 映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34174144/

相关文章:

apache - htaccess - 重定向到子文件夹而不更改浏览器 URL

c# - 在 Ubuntu 上使用带有 Mono 的 HttpWebResponse 清空响应数据

linux - 每次从我的 apache 服务器访问某个文件时向我发送电子邮件

Apache 以 404 而不是 403 响应,忽略 F 标志

linux - 使用 supervisord 优于 monit 有什么优势

java - 关闭tomcat 8并启动tomcat 9

git - 在本地和服务器上处理多个 Git Head

node.js - 生产环境中随机出现 "502 bad gateway",但在开发机器上没问题(express js)

java - 从 map 获取 key 中的类型不匹配:预期的org.apache.hadoop.io.Text,收到org.apache.hadoop.io.LongWritable错误

ubuntu - 如何在 ubuntu 服务器上的 svn 中将端口号添加到工作副本 url