开发者

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

开发者 https://www.devze.com 2023-03-20 16:24 出处:网络
I am using this guide: http://codingthis.com/platforms/linux/how-to-host-simple-content-with-amazon-elastic-cloud-computing-ec2/

I am using this guide: http://codingthis.com/platforms/linux/how-to-host-simple-content-with-amazon-elastic-cloud-computing-ec2/

I have a folder named public_html in my /home/ec2-user directory with a test.html file.

What I have do开发者_运维知识库ne so far:

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: How do I make it load my content (my html file) instead of the apache test page

EXTRA:

I have a security group enabled for my instance with rules:

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


isnt your document root public_html instead of www? so why did u put ur pages under www directory?


If you have no content in the DocumentRoot that you configured then the default Apache install will show you that page instead of yours. Also, check the DirectoryIndex configuration to make sure that if you're using index.php or default.html or something else that this is configured as well. It defaults to index.html


Chmod755/directory/directory/etc.. Will give access to that directory. So if your website is in the folder *home/ec2-user/public_html* you would then need to give access to that directory. Example: chmod 755 home/ec2-user/public_html


I was having the same issue. I fixed it by changing the permissions on the ec2-user directory like so:

chmod +x home/ec2-user

This give execution permissions to everyone on your user directory.


I had the same problem. All I have to do was just restarting the ec2 to apply the changes. - takes me 2h :(

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号