Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-23-2010, 10:59 AM   #1
LQ Newbie
Registered: Dec 2010
Posts: 1

Rep: Reputation: 0
Help me with httpd virtual host set to mount to samba share folder.

The scenario like this.

I'm working on Ubuntu 10.10. I've enable samba sharing with full guest access enable.

In my office I had another server (CentOS 5.5) installed just for me and I've created a Apache VirtualHost which root document pointed to share folder on my comp

This is my fstab setting
//my ubuntu computer name/sharing/www /media/www cifs context=system_ubject_r:httpd_sys_content_t:s0,username=username,password=******,iocharset=utf8,fi le_mode=0777,dir_mode=0777 0 0

After label the mount folder as httpd_sys_content_t the Apache web server working in correct way (duno much but at least it can index files and excute some php code so)

then the troll come in : if some file was created by my ubuntu (personal comp) then the file would be listed in Apache virtualhost correctly.

But if I'm ssh to CentOS server goto /media/www which was mounted to my unbuntu computer. Then type command like $mkdir something
Suprising that folder ./something could not be accessed by Apache anymore except I remount by umount and mount it again or "setenforce 0"

What is wrong with my system can anyone point me out of this headache

Last edited by InfernalAngel; 12-23-2010 at 11:02 AM.
Old 12-24-2010, 05:45 AM   #2
Registered: Apr 2008
Distribution: Slackware64 13.37, Solaris 10, RHEL5/6
Posts: 92

Rep: Reputation: 19
Most likely the se context of /media/www and /media/www/something is different. Run below commands and compare:

# ls -lZ /media/www
# ls -lZ /media/www/something

If they do differ, run these commands to change its context:

# semanage fcontext -a -t httpd_sys_content_t "/media/www(/.*)?"
# restorecon /media/www/something

Now any directories created below /media/www/ should inherit the same context and you should be ok.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
do configurations in httpd.conf trickle down to the Virtual Host level fobster Linux - General 2 01-31-2008 12:53 PM
HTTPD Virtual Host limit forbidden error, how to increase? norbul Linux - Software 1 05-11-2006 05:59 AM
virtual host on httpd jkmartha Linux - Newbie 2 04-11-2005 07:25 AM
samba mount to windows share folder lewkh Red Hat 1 03-01-2005 03:31 PM
can't mount to windows share folder using samba yawhum80 Linux - Software 4 10-24-2003 11:52 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration