简体   繁体   English

Amazon EC 2上用户目录中的Apache VirtualHost

[英]Apache VirtualHost from user directory on Amazon EC 2

I'm coming from a non-cloud hosting background on Red Hat Enterprise Linux and/or CentOS and trying to set up an apache (2.2) server with Amazon EC2. 我来自Red Hat Enterprise Linux和/或CentOS上的非云托管背景,并试图使用Amazon EC2设置apache(2.2)服务器。 I typically host my files from a user's home directory and create a virtualhost like so: 我通常从用户的主目录托管文件,并创建一个虚拟主机,如下所示:

<VirtualHost *:80>
  ServerName userdomain.com
  DocumentRoot /home/myuser/public_html
  <Directory /home/myuser/public_html>
    AllowOverride All
    <Limit DELETE>
      Order Deny,Allow
      Deny from All
    </Limit>
  </Directory>
</VirtualHost>

However on Amazon EC2 that doesn't seem to work at all no matter how I sent the file permissions. 但是,在Amazon EC2上,无论我如何发送文件权限,这似乎都不起作用。

Is this something that just isn't allowed? 这是不允许的吗? Do I have to host files from /var/www? 我是否必须从/ var / www托管文件? What am I missing? 我想念什么?

It turns out Linux had SELinux enabled, which I have not encountered before. 事实证明Linux启用了SELinux,这是我以前从未遇到过的。

The simplest solution was to put it in "permissive" mode as described at https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html 最简单的解决方案是按照https://access.redhat.com/documentation/zh-CN/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux所述将其置于“允许”模式html的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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