I have a windows drive that's mounted onto my Linux server. PHP and Apache web server needs to create folders on the windows drive with (mkdir) but I get permission error.

I have mounted my windows network shared drive as apache:root. I want to be able to login as the user apache and create a folder.

Is there a command where I can issue

mkdir -asapacheuser folder? when I'm logged in as any user on my linux box to see if the mounted drive lets me create folders?

My webserver user is apache which is httpd.

1 Answer 1


You should be able to use

install -o apache -d /my/test/directory

but as usual, you'll need to be root to create files/dirs with somebody else's ownership. (At that point, you could as easily sudo -u apache /bin/bash to gain a shell as the apache user.

  • this was really helpful in figuring out if apache user can create directory on the mounted windows drive. i figured out it was my code that was causing the issue because it was a older source that was crating directories on the mounted windows drive following windows style directory navigation.
    – unixmiah
    Jan 12, 2015 at 18:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .