0

我有一個運行tomcat(8080)的EC2網站,並且在同一個實例中我有apache2(80)給一個android應用程序提供靜態文件(圖片)。我需要這兩者,但協作並不是必須的。如何將我的網站在EC2中重定向到我的域名

那麼,我的問題是,如果我有這個網址:http://ec2-54-72-116-252.eu-west-1.compute.amazonaws.com:8080/OcioTurismoMontoro 我該如何將我的www.montoroturismo.tk重定向到它? 在域面板中,我只能放置我的主機的IP地址,但無論端口是上下文(/ OcioTurismoMontoro)。

請幫幫我。

回答

0

您必須在實例本身上管理端口轉發。如果你想在端口80上提供其他的東西,也許你可以在Apache上創建虛擬主機。把它放在<Apache>/conf/sites-enabled/OcioTurismoMontoro.conf:

<virtualhost *:80> 

     ServerAdmin [email protected] 
     ServerName www.montoroturismo.tk 
     ProxyRequests off 
     <proxy *> 
     Order deny,allow 
     Allow from all 
     </proxy> 
     ProxyPass/http://127.0.0.1:8080/OcioTurismoMontoro/ 
     ProxyPassReverse/http://127.0.0.1:8080/OcioTurismoMontoro/ 
</VirtualHost> 

你需要Apache的mod代理。

相關問題