Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-11-2008, 05:34 PM
Rick Onanian
 
Posts: n/a
Apache not serving from CIFS-mounted share, works if it's mounted asSMBFS

I'd like to mount a windows 2000 server fileshare on an linux/apache
server to do some basic web serving. The web server works fine and
shows other content that's stored locally just fine.

This works:
mount -t smbfs -o username=smbusername,uid=apache,ro //server/share
mountpoint/
but it complains that smbfs is deprecated and I should be using cifs.
For now, I'm using it anyway.

This seems to work:
mount.cifs //server/share mountpoint/ -
ouser=smbusername,uid=apache,ro
but it won't serve actual files. It allows browsing of the directories
and shows the filenames. It does not return an error, it just does not
send the file. I have confirmed that user 'apache' can read the file
by logging in as that user and viewing the file.

I tried a telnet test, using GET and Host commands captured from
firefox's LiveHTTPHeaders extension, like this:
-=-
telnet webserver 80
GET /directory/filename.jpg HTTP/1.1
Host: webserver
-=-

The result looks like this:
-=-
HTTP/1.x 200 OK
Date: Tue, 11 Mar 2008 15:51:07 GMT
Server: Apache/2.2.4 (Unix) PHP/5.2.0
Last-Modified: Thu, 21 Feb 2008 16:07:30 GMT
Etag: "420f8a5-180bf4-4d7a7480"
Accept-Ranges: bytes
Content-Length: 1575924
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: image/jpeg

Connection to host lost.
-=-
Reply With Quote
  #2 (permalink)  
Old 03-11-2008, 06:35 PM
Jack Snodgrass
 
Posts: n/a
Re: Apache not serving from CIFS-mounted share, works if it'smounted asSMBFS

On Tue, 11 Mar 2008 09:34:41 -0700, Rick Onanian wrote:

> I'd like to mount a windows 2000 server fileshare on an linux/apache
> server to do some basic web serving. The web server works fine and
> shows other content that's stored locally just fine.
>
> This works:
> mount -t smbfs -o username=smbusername,uid=apache,ro //server/share
> mountpoint/
> but it complains that smbfs is deprecated and I should be using cifs.
> For now, I'm using it anyway.
>
> This seems to work:
> mount.cifs //server/share mountpoint/ -
> ouser=smbusername,uid=apache,ro
> but it won't serve actual files. It allows browsing of the directories
> and shows the filenames. It does not return an error, it just does not
> send the file. I have confirmed that user 'apache' can read the file
> by logging in as that user and viewing the file.
>
> I tried a telnet test, using GET and Host commands captured from
> firefox's LiveHTTPHeaders extension, like this:
> -=-
> telnet webserver 80
> GET /directory/filename.jpg HTTP/1.1
> Host: webserver
> -=-
>
> The result looks like this:
> -=-
> HTTP/1.x 200 OK
> Date: Tue, 11 Mar 2008 15:51:07 GMT
> Server: Apache/2.2.4 (Unix) PHP/5.2.0
> Last-Modified: Thu, 21 Feb 2008 16:07:30 GMT
> Etag: "420f8a5-180bf4-4d7a7480"
> Accept-Ranges: bytes
> Content-Length: 1575924
> Keep-Alive: timeout=5, max=100
> Connection: Keep-Alive
> Content-Type: image/jpeg
>
> Connection to host lost.
> -=-


what does the apache error log show ( if anything ).
What does the apache log file show for the filename.jpg file?
If you get a good return code in the apache log... does the bytes
sent match the file size?

Does it work with smaller files and just not larger files.
Can you do cp filename.jpg /tmp and have it get copied correctly?

what does wget -O erase.me "http://127.0.0.1/directory/filename.jpg"
give you when you run it from your webserver. does the erase.me
file have the correct number of bytes when the transfer completes?


Just wondering if the web server is having access files for 'large'
files or files after 'x' bytes and your just not seeing it getting
a directory index listing.




--
D.A.M. - Mothers Against Dyslexia

see http://www.jacksnodgrass.com for my contact info.

jack - Grapevine/Richardson
Reply With Quote
  #3 (permalink)  
Old 03-12-2008, 02:24 PM
Rick Onanian
 
Posts: n/a
Re: Apache not serving from CIFS-mounted share, works if it's mountedas SMBFS

On Mar 11, 1:35*pm, Jack Snodgrass <jacks_temp_id_bf2...@verizon.net>
wrote:
> what does the apache error log show ( if anything ).
> What does the apache log file show for the filename.jpg file?
> * *If you get a good return code in the apache log... does the bytes
> sent match the file size?


Nothing. I was thinking maybe I should turn up the logging level.

> Does it work with smaller files and just not larger files.


No, I tried with very small files (~300 bytes), small files (50k), and
somewhat larger files (2mb).

> Can you do cp filename.jpg /tmp and have it get copied correctly?


Yes.

> what does wget -O erase.me "http://127.0.0.1/directory/filename.jpg"
> give you when you run it from your webserver. does the erase.me
> file have the correct number of bytes when the transfer completes?


Good idea, I hadn't thought of that. The output is interesting,
actually:
-=-
[root@student tmp]# wget 'http://127.0.0.1/~collegepictures/2006/
SmartBoard/SmartBoard.jpg'
--09:18:00-- http://127.0.0.1/~collegepictures/20...SmartBoard.jpg
=> `SmartBoard.jpg'
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 763,685 (746K) [image/jpeg]

0%
[ ]
0 --.--K/s

09:18:00 (0.00 B/s) - Connection closed at byte 0. Retrying.

--09:18:01-- http://127.0.0.1/~collegepictures/20...SmartBoard.jpg
(try: 2) => `SmartBoard.jpg'
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 763,685 (746K) [image/jpeg]
SmartBoard.jpg has sprung into existence.
Retrying.

--09:18:03-- http://127.0.0.1/~collegepictures/20...SmartBoard.jpg
(try: 3) => `SmartBoard.jpg.1'
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 763,685 (746K) [image/jpeg]

0%
[ ]
0 --.--K/s

09:18:03 (0.00 B/s) - Connection closed at byte 0. Retrying.

--09:18:06-- http://127.0.0.1/~collegepictures/20...SmartBoard.jpg
(try: 4) => `SmartBoard.jpg.1'
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 763,685 (746K) [image/jpeg]
SmartBoard.jpg.1 has sprung into existence.
Retrying.
-=-

I like that "sprung into existence" thing. :) Anyway, at that point I
gave up and hit ctrl-C.

Okay, I googled for that sprung into existence bit and found this,
which makes sense:
http://www.mail-archive.com/wget@sun.../msg07365.html
I didn't even notice but it was incrementing the filename before
saying it sprung into existence.

> Just wondering if the web server is having access files for 'large'
> files or files after 'x' bytes and your just not seeing it getting
> a directory index listing.


It's definitely not an issue of file size.
Reply With Quote
  #4 (permalink)  
Old 03-27-2008, 09:45 PM
John Chiu
 
Posts: n/a
Re: Apache not serving from CIFS-mounted share, works if it's mountedas SMBFS

I ran into this issue also and found the resolution. Here's the
information I found - http://nixforums.org/about127225.html

Just set the following in your httpd.conf file -

EnableSendfile off


On Mar 12, 6:24 am, Rick Onanian <groups.theholy...@xoxy.net> wrote:
> On Mar 11, 1:35 pm, Jack Snodgrass <jacks_temp_id_bf2...@verizon.net>
> wrote:
>
> > what does the apache error log show ( if anything ).
> > What does the apache log file show for the filename.jpg file?
> > If you get a good return code in the apache log... does the bytes
> > sent match the file size?

>
> Nothing. I was thinking maybe I should turn up the logging level.
>
> > Does it work with smaller files and just not larger files.

>
> No, I tried with very small files (~300 bytes), small files (50k), and
> somewhat larger files (2mb).
>
> > Can you do cp filename.jpg /tmp and have it get copied correctly?

>
> Yes.
>
> > what does wget -O erase.me "http://127.0.0.1/directory/filename.jpg"
> > give you when you run it from your webserver. does the erase.me
> > file have the correct number of bytes when the transfer completes?

>
> Good idea, I hadn't thought of that. The output is interesting,
> actually:
> -=-
> [root@student tmp]# wget 'http://127.0.0.1/~collegepictures/2006/
> SmartBoard/SmartBoard.jpg'
> --09:18:00-- http://127.0.0.1/~collegepictures/20...SmartBoard.jpg
> => `SmartBoard.jpg'
> Connecting to 127.0.0.1:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 763,685 (746K) [image/jpeg]
>
> 0%
> [ ]
> 0 --.--K/s
>
> 09:18:00 (0.00 B/s) - Connection closed at byte 0. Retrying.
>
> --09:18:01-- http://127.0.0.1/~collegepictures/20...SmartBoard.jpg
> (try: 2) => `SmartBoard.jpg'
> Connecting to 127.0.0.1:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 763,685 (746K) [image/jpeg]
> SmartBoard.jpg has sprung into existence.
> Retrying.
>
> --09:18:03-- http://127.0.0.1/~collegepictures/20...SmartBoard.jpg
> (try: 3) => `SmartBoard.jpg.1'
> Connecting to 127.0.0.1:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 763,685 (746K) [image/jpeg]
>
> 0%
> [ ]
> 0 --.--K/s
>
> 09:18:03 (0.00 B/s) - Connection closed at byte 0. Retrying.
>
> --09:18:06-- http://127.0.0.1/~collegepictures/20...SmartBoard.jpg
> (try: 4) => `SmartBoard.jpg.1'
> Connecting to 127.0.0.1:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 763,685 (746K) [image/jpeg]
> SmartBoard.jpg.1 has sprung into existence.
> Retrying.
> -=-
>
> I like that "sprung into existence" thing. :) Anyway, at that point I
> gave up and hit ctrl-C.
>
> Okay, I googled for that sprung into existence bit and found this,
> which makes sense:
> http://www.mail-archive.com/w...@sun.../msg07365.html
> I didn't even notice but it was incrementing the filename before
> saying it sprung into existence.
>
> > Just wondering if the web server is having access files for 'large'
> > files or files after 'x' bytes and your just not seeing it getting
> > a directory index listing.

>
> It's definitely not an issue of file size.


Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:15 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Car Finance | Mobile Phone | Mortgage | Mortgage Calculator | Bad Credit Mortgages



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114