Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
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 at 18:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.