简体   繁体   中英

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

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 done 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) 

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM