Amazon EC2 如何在我的实例上托管 PDF 文件?
我的 /home/ec2-user 目录中有一个名为 public_html 的文件夹一个index.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)
现在,当我访问 www.mywebsite.com 时,它将访问我的 index.html 文件。我试图将 pdf 文件放入我的 public_html 目录中,我尝试访问 www.mywebsite.com/pdffile.pdf,但它说找不到页面。如何在我的 ec2 实例上托管 pdf 文件?
额外:
我为我的实例启用了一个安全组,规则如下:
ICMP Allow ALL
TCP Allow ALL
UDP Allow ALL
TCP port 80 (Http)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
user848118 回答了他/她自己的问题:URL 区分大小写。
user848118 answered his/her own question: URLs are case sensitive.
假设你机器的IP是myipaddress
将 PDF 文件放入 /var/www 并浏览
http://myipaddress.com/file.pdf
即可为我。
Suppose your machine's IP is myipaddress
Put the PDF file in /var/www and browse
http://myipaddress.com/file.pdf
Works for me.