繁体   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