LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-02-2009, 11:31 AM   #1
fuzioneer
LQ Newbie
 
Registered: Feb 2009
Distribution: CentOs 5.2
Posts: 6

Rep: Reputation: 0
Configure apache to use windows share as webroot ?


I have a soho network with a NAS box, sbs2003 server, centos5.2 dev server and multiple clients

The centos server is a recent addition and I wanted to configure it so that one of the shares on my server "web" is the webroot somehow on apache so that any sites i am doing Dev work on can be browsed locally to test before uploading to live server elsewhere.

I can do basic nix admin work and sysadmin a couple of servers but have a friend who is more a guru than I if needed to help me out lol

I have apache installed and up and running with default install
I have access to the shares from the centos box and can see the content accessed over my domain on \\mydomain\myserver\web

below this share are multiple sites I run fileroots, it would be superb if I could create a virtual host for each site so that i can access all sites locally.

Any pointers on this when configuring apache ?

i.e. what do i put for Document root directory ?
 
Old 02-03-2009, 03:56 AM   #2
jimvin
Member
 
Registered: May 2004
Posts: 71

Rep: Reputation: 15
Hi,
You will want to mount the windows share on the centos server.

mount -t smbfs //servername/sharename /mountdirectory -o <options>

Depending on how you have the share set up you may need to provide the username, password and domain to access the share. Once the share is mounted it will looks like any other part of the file system and you can set this as you document root.

You can use the Alias directive in Apache to create the references to each document root you have on the share e.g.

Alias /work /mnt/smb/my_work
Alias /mp3 /mnt/smb/music

Check out the apache documentation for mod_alias for more information. The apache docs are good and well worth a read.

http://httpd.apache.org/docs/1.3/mod/mod_alias.html

Regards,
Jim
 
Old 01-12-2010, 05:38 PM   #3
fuzioneer
LQ Newbie
 
Registered: Feb 2009
Distribution: CentOs 5.2
Posts: 6

Original Poster
Rep: Reputation: 0
Well its been a while but I have revisited configuring this

I have got some way to getting it working but still have issues

i have samba running on the nix server and a windows share of \\mydomaincontroller\websitename

I have an entry in /etc/fstab as follows:-

//mydomaincontroller/websitename /mnt/Websites/websitename cifs user,uid=500,rw,suid,username=myuser,password=mypassword 0 0

this works in that i can now cd to /mnt/Websites/websitename and can view the files within

I have an entry in the httpd.conf as follows:-
<Directory "/mnt/Websites/mywebsitename">
Options Indexes Includes FollowSymLinks
AllowOverride None
Allow from all
Order allow,deny
</Directory>

I can fire up a browser on my pc and enter in http://192.168.1.4/mywebsitename/ and i get a blank white page, i have a few test html files in the mywebsitename root folder but again if i try and view these in my browser all i get is a blank page, if i view source it is empty

This would make me think its a permissions issue

if i list the files in the /mnt/Websites folder i see the mywebsitename folder and it is owned by the uid 500 user account with group of root and 777 permissions, the files within the mywebsitename folder are the same

any pointers much appreciated ??
 
Old 01-13-2010, 03:54 AM   #4
jimvin
Member
 
Registered: May 2004
Posts: 71

Rep: Reputation: 15
Hi there,
There are a number of possible reasons for the files not showing up. Have you checked the apache error logs? There may be a useful message as to why it's not working. If your DocumentRoot set to /mnt/Websites? If not have you added an Alias for this directory?

Regards,
Jim
 
Old 01-13-2010, 05:33 AM   #5
fuzioneer
LQ Newbie
 
Registered: Feb 2009
Distribution: CentOs 5.2
Posts: 6

Original Poster
Rep: Reputation: 0
turns out it was selinux blocking access
 
Old 01-13-2010, 05:59 AM   #6
jimvin
Member
 
Registered: May 2004
Posts: 71

Rep: Reputation: 15
Well spotted! How did you work this out, it might help other users with the same problem.

Regards,
Jim
 
Old 01-13-2010, 06:03 AM   #7
fuzioneer
LQ Newbie
 
Registered: Feb 2009
Distribution: CentOs 5.2
Posts: 6

Original Poster
Rep: Reputation: 0
tail -f on the messages log file whilst trying to access the website via browser
 
Old 01-13-2010, 04:41 PM   #8
fuzioneer
LQ Newbie
 
Registered: Feb 2009
Distribution: CentOs 5.2
Posts: 6

Original Poster
Rep: Reputation: 0
hmmm i thought I had cracked it but found another issue

I can see my site when i browse it but many things are missing like logo, css file hasn't been inserted etc

If i try and browse direct to a single image like http://mywebserver/logo.gif then I get a 200 showing in access log but the browser doesn't display the image

??
 
Old 01-14-2010, 06:13 AM   #9
fuzioneer
LQ Newbie
 
Registered: Feb 2009
Distribution: CentOs 5.2
Posts: 6

Original Poster
Rep: Reputation: 0
Well i have checked everything and can't suss it at all

selinux is disabled

full permissions granted to everyone on the windows share and files

i have tried different variations on the mounted file / folder permissions

but some images do display properly but not all !!!
 
  


Reply


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
Apache writing to smb share on windows box? darthfoolish Linux - Server 2 08-14-2008 05:51 PM
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 12:28 PM
Apache Alias Samba share to a Windows box kitkit201 Linux - Newbie 2 04-18-2007 07:11 PM
Can't Access Windows Share through Apache boardoms Linux - Networking 2 12-02-2005 12:19 PM
Apache alias point to mounted windows share johnnypezz Linux - Newbie 0 09-13-2004 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:51 PM.

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