Amazon EC2 How Do I Host a PDF File on my Instance?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 08:52:55

问题


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 index.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)

Now when I go to my www.mywebsite.com it will hit my index.html file. I tried to put a pdf file in my public_html directory, I tried to go to www.mywebsite.com/pdffile.pdf and it says page not found. How do I host my pdf file on my ec2 instance?

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) 

回答1:


user848118 answered his/her own question: URLs are case sensitive.




回答2:


Suppose your machine's IP is myipaddress Put the PDF file in /var/www and browse

http://myipaddress.com/file.pdf

Works for me.



来源:https://stackoverflow.com/questions/6721582/amazon-ec2-how-do-i-host-a-pdf-file-on-my-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!