You are not logged in.

#1 2007-01-16 20:06:17

edge
Member
Registered: 2007-01-08
Posts: 7

Running Apache with html files on a mounted NAS device

Hi.  I am hoping someone could help me out.  I have been pulling my hair out for the past 2 days.

I am running Arch v0.8.  I have very few packages installed -- I started with base install and added Apache, MySql, PHP, Samba and a few others.

Configuration:
- I have apache running as user=apache, group=apache.  I changed this from nobody:nobody in httpd.conf.
- I have a Buffalo TerraStation on my lan.  It is called edge_nas.  It has a share called "linux".
- I successfully mounted the Buffalo share using the following entry in fstab:

//edge_nas/linux /mnt/edge_nas smbfs username=apache,password=theapachepassword,gid=apache 0 0

- I created a soft link in /home which points /home/httpd to /mnt/edge_nas/home/httpd.
- I want my web files on the Buffalo NAS device because it is raid 5. 

Problem:
- Root is able to read and write anywhere on /mnt/edge_nas.
- Apache can read /mnt/edge_nas.
- Apache can write in its home directory on /mnt/edge_nas/home/apache.
- Apache cannot write in any other directory (especially /mnt/edge_nas/home/httpd/html).

Question:
- How do I grant apache read/write access to the html root?

Any ideas?  Please be gentle.
Thank you for your help.
Edge

Offline

#2 2007-01-16 21:18:33

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Running Apache with html files on a mounted NAS device

does the apache user have write access to that directory on the NAS appliance?


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2007-01-16 21:40:15

edge
Member
Registered: 2007-01-08
Posts: 7

Re: Running Apache with html files on a mounted NAS device

cactus wrote:

does the apache user have write access to that directory on the NAS appliance?

Thanks for the quick response.

I did chmod 777 on the directory... but that did not work.

I also tried to chown to apache:apache, I got "operation not permitted".

Offline

#4 2007-01-16 21:46:42

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Running Apache with html files on a mounted NAS device

Did you do that from the NAS interface, or from the mounted share on the arch install?


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2007-01-16 23:50:36

edge
Member
Registered: 2007-01-08
Posts: 7

Re: Running Apache with html files on a mounted NAS device

cactus wrote:

Did you do that from the NAS interface, or from the mounted share on the arch install?

I created a user ("apache") via the Buffalo admin interface.
I also created a user ("apache") via Arch Linux (adduser command).

Both have same password.

Offline

#6 2007-01-17 00:35:03

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Running Apache with html files on a mounted NAS device

right. but how did the /mnt/edge_nas/home/httpd/html directory get created?


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#7 2007-01-17 00:43:36

edge
Member
Registered: 2007-01-08
Posts: 7

Re: Running Apache with html files on a mounted NAS device

cactus wrote:

right. but how did the /mnt/edge_nas/home/httpd/html directory get created?

- When logged in as root, I created that directory (with mkdir). 
- Then I added that mount to fstab.
- Then I chmod'ed it.

(Thanks for your patience, cactus.)

Offline

#8 2007-01-17 00:48:36

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Running Apache with html files on a mounted NAS device

umm. still not clear on what you did...
You logged in as root.. where?

Tell me if this is correct.
1. You logged in as root.. on the buffalo NAS.
2. mkdir /home/httpd/html
3. chmod ??? /home/httpd/html
4. profit!

Please layout a clear step by step of what you did. That might make it easier to help you.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#9 2007-01-17 03:18:55

edge
Member
Registered: 2007-01-08
Posts: 7

Re: Running Apache with html files on a mounted NAS device

cactus wrote:

umm. still not clear on what you did...
Please layout a clear step by step of what you did. That might make it easier to help you.

Ok. From the top...

On the Buffalo NAS (edge_nas):
- I logged into the Buffalo web-based admin screen.
- I created a new share called linux.
- I created a new user called apache.
- I granted read/write access to apache on the linux share.

On Arch Linux:
- I logged in locally as root.
- I created a new user apache, in group apache.
- I created a new directory called /mnt/edge_nas.
- I mounted the Buffalo share using the following entry in fstab:

//edge_nas/linux /mnt/edge_nas smbfs username=apache,password=theapachepassword,gid=apache 0 0

- I changed apache to run as apache:apache.  I changed this from nobody:nobody in httpd.conf.
- In /home/httpd, I created a softlink for /home/httpd/html, pointing it to /mnt/edge_nas/home/httpd/html.
- I chmod 777 /mnt/edge_nas/home/httpd/html.
- I restarted apache.
- I created a summy index.html in that directory to ensure apache can see the mount.

To test it out:
- I logged into arch locally as my apache user.
- I cd'ed to /home/httpd/html.
- I tried to create a new text file with vi.
- I cannot open the text file for write.

I hope that helps.  Please excuse any misuse of terminology.
Thanks.
Edge

Offline

#10 2007-01-17 03:43:41

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Running Apache with html files on a mounted NAS device

ok. is /home/httpd/html a directory on the NAS, created when you created the linux share and apache user?

I don't see in your information where that directory was created.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#11 2007-01-17 04:44:56

edge
Member
Registered: 2007-01-08
Posts: 7

Re: Running Apache with html files on a mounted NAS device

cactus wrote:

ok. is /home/httpd/html a directory on the NAS, created when you created the linux share and apache user?

I don't see in your information where that directory was created.

Yes - that directory is on the NAS.

On my arch linux drive, I have /home/httpd.  This was created when I added the apache package.

In /home/httpd, there was an empty html directory.  This is where I usually place all my web files.  I wanted to move this html directory from the arch linux hard drive... to the NAS... So I deleted the empty /home/httpd/html directory from the arch linux drive.

I then created a soft link (I hope I have terminology right) for /home/httpd/html that really points to //edge_nas/linux/home/httpd/html.  This allows me to store all my web files on the NAS device.

If I am not making any sense, please let me know.  I am experienced in the windows world (I swear!), but am a bit clueless at times in linux.

Thanks for the help.
Edge

Offline

Board footer

Powered by FluxBB