Home>

I'm learning web apps in amazon linux 2 + S3 environment
Can only ec2-user write to S3?

The problem is that the web application saves the data received by POST
Because the save user is "apache", it is "permission denied" and cannot be saved.

Directory structure of S3
/ data/WEBAPP01<== I want to save it here
/ data/WEBAPP02

Mount S3 with/mnt/S3
drwxr-xr-x 9 ec2-user ec2-user 245 Nov 28 08:34 ec2-user
lrwxrwxrwx 1 root root 14 Nov 28 13:15 share->/mnt/S3/data/

/home/share/=>/mnt/S3/data/is symbolized.

The web application can receive files received via POST
/home/share/WEBAPP01/hogehoge.dat
Attempting to save to will result in "permission denied".

chmod 777/mnt/S3/data/WEBAPP01
I want to do it, but EC2 can't do that ...

Are you just starting out with AWS?

  • Answer # 1

    A little information is missing ...

    Isn't the Apache user authorized to write to

    /mnt/S3/data/?

    The first question is

    How is S3 mounted first (via Storage Gateway?)

    Why bother to save to the mounted S3 via local
    I think it should be uploaded directly to S3 ...
    The mount of S3 does not mount the storage directly in any way, but I think that it will only be synchronized via something, so there seems to be many cases that do not work as expected I will.

      

    chmod 777/mnt/S3/data/WEBAPP01
      I want to do it, but EC2 can't do that ...

    There is

    , but I don't understand what I can do here.

  • Answer # 2

    /home/ec2-user/go/bin/goofys # s3_test/mnt/S3 fuse _netdev, allow_other,-file-mode = 0777,- -dir-mode = 0777,-uid = 1000,-gid = 1000 0 0


    By adding the declaration --dir-mode = 0777, other users (processes) can now write.