簡體   English   中英

Amazon EC2 如何托管我自己的內容? 堅持進行工作測試 apache 頁面

[英]Amazon EC2 How Do I host My Own Content? Stuck on having a working test apache page

我正在使用本指南: http://codingthis.com/platforms/linux/how-to-host-simple-content-with-amazon-elastic-cloud-computing-ec2/

我的 /home/ec2-user 目錄中有一個名為 public_html 的文件夾,其中包含一個 test.html 文件。

到目前為止我做了什么:

sudo yum -y install httpd php
sudo chkconfig httpd on
chmod 755 /home/ec2-user  (I HAVE NO IDEA WHAT THIS DOES)
sudo nano /etc/httpd/conf/httpd.conf
  (changed DocumentRoot to DocumentRoot /home/ec2-user/public_html)

TLDR:如何讓它加載我的內容(我的 html 文件)而不是 apache 測試頁面

額外的:

我為我的實例啟用了一個具有規則的安全組:

ICMP Allow ALL
TCP Allow ALL
UDP Allow ALL
TCP port 80 (Http) 

chmod755/directory/directory/etc..將授予對該目錄的訪問權限。 因此,如果您的網站位於文件夾 *home/ec2-user/public_html* 中,則您需要授予對該目錄的訪問權限。 示例:chmod 755 home/ec2-user/public_html

我遇到了同樣的問題。 我通過更改 ec2-user 目錄的權限來修復它,如下所示:

chmod +x home/ec2-user

這為您的用戶目錄中的每個人提供執行權限。

您的文檔根目錄不是 public_html 而不是 www? 那么為什么你把你的頁面放在 www 目錄下呢?

如果您配置的 DocumentRoot 中沒有內容,則默認的 Apache 安裝將顯示該頁面而不是您的頁面。 此外,檢查 DirectoryIndex 配置以確保您使用的是 index.php 或 default.html 或其他配置。 默認為 index.html

我有同樣的問題。 我所要做的就是重新啟動 ec2 以應用更改。 - 需要我 2 小時:(

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM