LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-25-2009, 11:28 AM   #1
jckt423
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
Problems Filesharing between Fedora 11 machine using Apache and Windows XP


I am setting up a home server using Fedora 11 and am having trouble connecting to the server from another computer on the network. I want to add the network place to a computer running Windows XP. I am able to navigate to the server in my internet browser and can access the files in the directory from the browser, but I want to be able to put files in the directory from other machines on the network. To do this, I click on My Network Places, and click Add A Network Place. In the wizard that comes up, I press next, select Choose another network location, and then enter the address of the webserver in the box as http://[ipaddress]/shared where [ipaddress] is the ipaddress of my Linux computer and shared is the directory that I am attempting to access. If I type the same thing into a web browser, I see a page listing the files in the shared directory. When I click next in the wizard, a dialog box appears to Connect to [ipaddress]. When I put in the User name and Password, the box prompts again instead of authenticating. I am using Apache as my webserver. Any help is greatly appreciated. Thank you.
 
Old 10-26-2009, 04:10 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,487

Rep: Reputation: 88
If I understand you right, and what you seem to want to do, you need to use Samba.

It enables a Linux system to "look like" a Windows system to other Windows systems on the network as regards NETBIOS (i. e. Microsoft) filesharing protocol.

Fedora 11 should have Samba already installed if you chose a full install. Otherwise, take a look at the distro DVD for the .rpm and install it by doing, as root, in a console:

Code:
rpm -ivh samba...[rest of .rpm filename here]
Once it has finished installing, open the file /etc/samba/smb.conf and edit it to what you need. Here, for example, is my /etc/samba/smb.conf that gives access to my /usr/local/apache2/htdocs (i. e. my webroot on my Linux machine) to all the Windows XP machines on my local network:

/etc/samba/smb.conf - FC11:
Code:
[global]

netbios name = development
workgroup = WORKGROUP
security = share
log file = /var/log/samba.log
log level =  1
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=16384 SO_SNDBUF=16384
wins support = yes
domain logons = no
logon drive = f:
logon home = \\stefan\%U
os level = 99
preferred master = yes
local master = yes
hosts allow = 10.0.0.1 10.0.0.3 10.0.0.4 10.0.0.5 10.0.0.6 10.0.0.7 10.0.0.8 10.0.0.9 10.0.0.10 10.0.0.11 10.0.0.11
encrypt passwords = yes
browseable = yes
lanman auth = yes
lm announce = yes

[shared]
path = /usr/local/apache2/htdocs
guest ok = yes
writeable = yes
create mode = 0666
directory mode = 0777
browseable = yes
public = yes
Save the file once you have edited it.

Next, as root in a console, start samba services:

Code:
smbd -D
nmbd -D
Confirm that Samba is active, here's what my system shows:

Code:
[rylan@development generic]$ ps -A | grep smb
 1992 ?        00:00:00 smbd
 1998 ?        00:00:00 smbd
[rylan@development generic]$ ps -A | grep nmb
 1989 ?        00:00:00 nmbd
 1990 ?        00:00:00 nmbd
[rylan@development generic]$
You can also of course then put the samba startup calls in /etc/rc.local, so they get run every time the system starts up, so from then on you will always have samba connectivity once your Linux box has booted. Here's mine, for example:

Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
. /root/setupkbd.sh
mount -t ntfs-3g /dev/hdb1 /mnt/win

/sbin/ifconfig eth0 down
/sbin/ifconfig eth0 10.0.0.8 netmask 255.255.255.0 broadcast 10.254.255.255 up
/sbin/route del default
/sbin/route add default gw 10.0.0.2 eth0

/usr/local/mysql/bin/mysqld_safe --user=mysql &
/usr/local/apache2/bin/apachectl start
/usr/local/samba/sbin/nmbd -D
/usr/local/samba/sbin/smbd -D
After a few minutes have gone past, try exactly what you said in your post you did, you should now have access to your htdocs for your Apache instance on the Fedora 11 machine, from any Windows XP machine on the network.

Remember, the above is setup with minimum security and no passwords. You probably need something more secure.

Additionally, if you find that you cannot write from the Windows machine into the Linux system's share, just change permissions on the /usr/local/apache/htdocs to completely permissive. As root, in a console, do:

Code:
chmod -R a+rwx /usr/local/apache/htdocs
Note however that on anything besides a completely isolated (from the internet) Apache server used for development this is a BAD IDEA - it means anybody who can log into that system can change and delete any file in the apache htdocs folder. But, it also means that most likely write access from an XP machine to that FC11 machine will work.

For example at my workplace we have a Fedora system setup as I describe above, but there is no form of internet access from the internet into that machine or its Apache instance (it is blocked at the router). So we develop there in complete safety (besides the above risky settings, it is only a development machine, and isolated at hardware level from the internet) but when we deploy our PHP pages and websites we do it on a specially hosted Debian system that is hardened and fully secured with all the latest patches and settings for security.

Hope this helps!
 
Old 10-30-2009, 05:32 PM   #3
jckt423
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the response. I made the changes and it's still prompting for a password when I try to mount the drive. My smb.conf file looks like this:

Code:
[global]
netbios name = development
workgroup = WORKGROUP
security = share
log file = /var/log/samba.log
log level = 1
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=16384 SO_SNDBUF=16384
wins support = yes
domain logons = no
os level = 99
preferred master = yes
local master = yes
logon drive = f:
hosts allow = 192.168.0.5 //my ip address
encrypt passwords = yes
browseable = yes
lanman auth = yes
lm announce = yes

[shared]
path = /home/user/shared/
guest ok = yes writable = yes
create mode = 0666
directory mode = 0777
browseable = yes
public = yes
I did not include logon home because I didn't know what my value should be. Is this necessary? Are there any other settings that need to be configured?
 
  


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
Problems Filesharing between Fedora 11 machine using Apache and Windows XP jckt423 Linux - Server 1 10-25-2009 05:32 PM
Fedora Core 11 - Apache works locally but not from a different machine vuhuynh Linux - Newbie 5 08-26-2009 08:09 AM
Uninstall apache from the fedora core 2 machine ayomi8175 Linux - Software 5 03-12-2008 01:21 PM
Windows XP box doesn't open filesharing ports Dtsazza Linux - Networking 2 01-11-2006 12:52 PM
Linux Windows Filesharing meander Linux - Networking 15 01-29-2005 03:20 PM


All times are GMT -5. The time now is 10:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration