homepage Welcome to WebmasterWorld Guest from 54.211.235.255
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Sharing lan resources in apache 1.3.19
MagiCminD




msg:910260
 1:08 am on Mar 4, 2003 (gmt 0)

Hello all,

I'm very new in these things of webservices configuring.

I have a home LAN, with one box running Mandrake 8.0i and some computers in it running Windows.

One of them has an 80GB disk which I'd like to "share" trough my httpd.

I mapped the Windows share with smbmount and it works ok.
I've mapped it with the apache user and it's ok, it reads the Win share.

I also wrote this in /etc/httpd/commonhttp.conf:

Alias /sa /mnt/sharedana/

The beginning of the file reads:
### Common server configuration
#
User apache
Group apache

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin magicmind@netcabo.pt

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot /mnt/windows/MagiCminD

and this windows/MagiCminD is, of course, a local dir in hda5.

The /mnt/sharedana, on the other hand, is the shared folder in the windows XP professional computer.

It's being recognized by the httpd, but with access denied!

BTW, when mounting the share I used, under the apache account:

smbmount //ana/shared sharedana -o username=Ana Mota dmask=777 fmask=777 rw

Now...
What I see when I do an ls -la in /mnt is:

[root@magicsrv /mnt]# ls -la
total 25
drwxr-xr-x 9 root root 4096 Mar 1 20:29 ./
drwxr-xr-x 21 root root 4096 Apr 16 2002 ../
drwxrwxr-x 2 root root 4096 Apr 24 2002 ana/
drwxrwxrwx 1 root root 0 Mar 1 20:40 cdrom/
drwxrwxr-x 2 root root 4096 Mar 27 2001 disk/
drwxrwxrwx 1 root root 0 Mar 1 20:40 floppy/
drwx------ 1 root root 512 Mar 3 20:02 ftana/
drwx------ 1 root root 512 Mar 3 20:02 sharedana/
drwxrwxrwx 8 root root 8192 Jan 1 1970 windows/
[root@magicsrv /mnt]#

Which doesn't seem to be what I've asked for when I mounted the share...

Can anyone help?
I just want to share the other computer's folder...

Oh, the release of the apache server is:

Server version: Apache-AdvancedExtranetServer/1.3.19 (Linux-Mandrake/3mdk)
Server built: Apr 16 2001 07:50:02

Thank you all.

 

hakre




msg:910261
 1:44 am on Mar 4, 2003 (gmt 0)

hi MagiCminD, welcome to webmasterworld [webmasterworld.com].

before checking out the configuration of apache, be shure the mount of the windows folder/drive went right.

while using smbmount, specify the whole mount-path. in you case it seems to me that you want it mounted in /mnt/sharedana. if so, use the ls command in that path to verify wether it's working or not. if this is working as intended, you can continue with part 2 - the apache.conf. just post again then.

one tip left: for your samba share use ntfs filesystem on the windows side or samba will run into probs from time to time.

MagiCminD




msg:910262
 2:19 am on Mar 4, 2003 (gmt 0)

Thanks hakre.

Well, it does work.
The samba mapping is working fine.

[root@magicsrv conf]# cd /mnt/sharedana/
[root@magicsrv sharedana]# ls -la
total 5
drwx------ 1 root root 512 Mar 3 20:02 ./
drwxr-xr-x 9 root root 4096 Mar 1 20:29 ../
drwx------ 1 root root 512 Mar 3 20:02 Musicas/
drwx------ 1 root root 512 Mar 1 20:55 wellcome/
[root@magicsrv sharedana]# mkdir test
[root@magicsrv sharedana]# ls -la
total 6
drwx------ 1 root root 512 Mar 4 02:18 ./
drwxr-xr-x 9 root root 4096 Mar 1 20:29 ../
drwx------ 1 root root 512 Mar 3 20:02 Musicas/
drwx------ 1 root root 512 Mar 4 02:18 test/
drwx------ 1 root root 512 Mar 1 20:55 wellcome/
[root@magicsrv sharedana]#

So, what's next?

hakre




msg:910263
 2:25 am on Mar 4, 2003 (gmt 0)

I also wrote this in /etc/httpd/commonhttp.conf:
Alias /sa /mnt/sharedana/

that means if you connect to your apache server (don't know the host), and request /sa, you should get at least a directory index (if indexing is on) or a 403 forbidden message.

the url should be like:
[ip-linux-box...]

so what do you get?

MagiCminD




msg:910264
 2:29 am on Mar 4, 2003 (gmt 0)

yeap, indexing is on.
I can say this because of the other dirnams/ I have.

On this particular case I get an 403

THAT is my real problem...

I don't have a domain in that winXP, just workgroup...
The samba mapping is working with the user I told and blank pass, which is correct...

Still, I got the 403.

[magicmind.sytes.net...]
This should do it... at least to list the directories...
:/

hakre




msg:910265
 2:31 am on Mar 4, 2003 (gmt 0)

just place a simple index.html into that directory with some text like 'test' or whatever. still getting a 403?

hakre




msg:910266
 2:34 am on Mar 4, 2003 (gmt 0)

some other thing. the error.log file of apache is a good source to resolve internal errors occuring while requesting a page. maybe apache is not allowed to access the share, but this might return a 500 instead of a 403.

MagiCminD




msg:910267
 2:34 am on Mar 4, 2003 (gmt 0)

Yeap...

Forbidden
You don't have permission to access /sa/index.html on this server.

--------------------------------------------------------------------------------

Apache-AdvancedExtranetServer/1.3.19 Server at MagiCminD Port 80

hakre




msg:910268
 2:39 am on Mar 4, 2003 (gmt 0)

just posted a question about error log above your answer ;)


[root@magicsrv conf]# cd /mnt/sharedana/
[root@magicsrv sharedana]# ls -la
total 5
drwx------ 1 root root 512 Mar 3 20:02 ./

only root is allowed to access your share. so apache can't even open the shared directory. you'll need to share with more rights here!

MagiCminD




msg:910269
 2:41 am on Mar 4, 2003 (gmt 0)

No...
The access_log is showing me what I allready know...

192.168.0.2 - - [04/Mar/2003:01:14:54 +0000] "GET /sa/ HTTP/1.1" 403 302 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
192.168.0.2 - - [04/Mar/2003:01:14:55 +0000] "GET /sa/ HTTP/1.1" 403 302 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
192.168.0.2 - - [04/Mar/2003:01:14:55 +0000] "GET /sa/ HTTP/1.1" 403 302 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
192.168.0.2 - - [04/Mar/2003:02:24:59 +0000] "GET /sa/ HTTP/1.1" 403 302 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
192.168.0.2 - - [04/Mar/2003:02:25:03 +0000] "GET /sa HTTP/1.1" 301 325 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
192.168.0.2 - - [04/Mar/2003:02:25:09 +0000] "GET /sa/index.htm HTTP/1.1" 403 311 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
192.168.0.2 - - [04/Mar/2003:02:25:14 +0000] "GET /sa/index.html HTTP/1.1" 403 312 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"

hakre




msg:910270
 2:42 am on Mar 4, 2003 (gmt 0)

and what about the error.log?

MagiCminD




msg:910271
 2:44 am on Mar 4, 2003 (gmt 0)

hehehe, I saw it

I know about that permissions thing.
The problem is :

[root@magicsrv /mnt]# ls -la
total 25
drwxr-xr-x 9 root root 4096 Mar 1 20:29 ./
drwxr-xr-x 21 root root 4096 Apr 16 2002 ../
drwxrwxr-x 2 root root 4096 Apr 24 2002 ana/
drwxrwxrwx 1 root root 0 Mar 1 20:40 cdrom/
drwxrwxr-x 2 root root 4096 Mar 27 2001 disk/
drwxrwxrwx 1 root root 0 Mar 1 20:40 floppy/
drwx------ 1 root root 512 Mar 4 02:32 ftana/
drwx------ 1 root root 512 Mar 4 02:32 sharedana/
drwxrwxrwx 8 root root 8192 Jan 1 1970 windows/
[root@magicsrv /mnt]# chmod -R 777 sharedana
[root@magicsrv /mnt]# ls -la
total 25
drwxr-xr-x 9 root root 4096 Mar 1 20:29 ./
drwxr-xr-x 21 root root 4096 Apr 16 2002 ../
drwxrwxr-x 2 root root 4096 Apr 24 2002 ana/
drwxrwxrwx 1 root root 0 Mar 1 20:40 cdrom/
drwxrwxr-x 2 root root 4096 Mar 27 2001 disk/
drwxrwxrwx 1 root root 0 Mar 1 20:40 floppy/
drwx------ 1 root root 512 Mar 4 02:32 ftana/
drwx------ 1 root root 512 Mar 4 02:32 sharedana/
drwxrwxrwx 8 root root 8192 Jan 1 1970 windows/
[root@magicsrv /mnt]# chmod -R ugo+rw sharedana/
[root@magicsrv /mnt]# ls -la
total 25
drwxr-xr-x 9 root root 4096 Mar 1 20:29 ./
drwxr-xr-x 21 root root 4096 Apr 16 2002 ../
drwxrwxr-x 2 root root 4096 Apr 24 2002 ana/
drwxrwxrwx 1 root root 0 Mar 1 20:40 cdrom/
drwxrwxr-x 2 root root 4096 Mar 27 2001 disk/
drwxrwxrwx 1 root root 0 Mar 1 20:40 floppy/
drwx------ 1 root root 512 Mar 4 02:32 ftana/
drwx------ 1 root root 512 Mar 4 02:32 sharedana/
drwxrwxrwx 8 root root 8192 Jan 1 1970 windows/
[root@magicsrv /mnt]#

As you can see, even if I change the permissions to that directory, seems to have no effect...

MagiCminD




msg:910272
 2:46 am on Mar 4, 2003 (gmt 0)

The error log doesn't say nothing.
Clean!
really!

hakre




msg:910273
 2:52 am on Mar 4, 2003 (gmt 0)

i picked up this command line parameter of smbmount:
uid=<arg>
sets the uid that will own all files on the mounted filesystem. It may be specified as either a username or a numeric uid.

if you set this to apaches' userid, 403 should go away.

MagiCminD




msg:910274
 3:03 am on Mar 4, 2003 (gmt 0)

Almost there.
Seems that the uid parameter should stay BEFORE the username parameter...

Now it's working with the HTML file...
NOT without it.
I still get the 403 error if I don't have an index.html file.
If I do, it works ok.
I know index is working, just don't have sure if it is working for that dir. Any way I can check this?

Thanks for all your help!

[root@magicsrv /mnt]# smbmount //ana/shared sharedana -o uid=apache username=Ana Mota
Password:
[root@magicsrv /mnt]# ls -la
total 25
drwxr-xr-x 9 root root 4096 Mar 1 20:29 ./
drwxr-xr-x 21 root root 4096 Apr 16 2002 ../
drwxrwxr-x 2 root root 4096 Apr 24 2002 ana/
drwxrwxrwx 1 root root 0 Mar 1 20:40 cdrom/
drwxrwxr-x 2 root root 4096 Mar 27 2001 disk/
drwxrwxrwx 1 root root 0 Mar 1 20:40 floppy/
drwx------ 1 root root 512 Mar 4 02:32 ftana/
drwx------ 1 apache root 512 Mar 4 02:32 sharedana/
drwxrwxrwx 8 root root 8192 Jan 1 1970 windows/
[root@magicsrv /mnt]#

hakre




msg:910275
 3:11 am on Mar 4, 2003 (gmt 0)

if you get a 403, normally auto-indexing is switched off if you don't get a 403 on an existing index.html (or any other file which is setup as default index file) ;)

to enabled indexing in that specific dir, place a .htaccess file into it with the following line:

Options +Indexes

that should to the job.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved