配置URL映射

时间:2015-12-09 08:37:13

标签: 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/

的网址

我想进入此域名申请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>

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

1 个答案:

答案 0 :(得分:3)

执行此操作的标准方法是通过反向代理,避免必须使用URL或框架中的高端口号。 Web上有大约一万亿个用于在Tomcat前面使用Apache w / mod_proxy的方法。