下面是小编给各位读者分享的UnixWAre and Open unix8下如何配置SAMBA。Windows系统(共含6篇),欢迎大家分享。同时,但愿您也能像本文投稿人“Pinetree”一样,积极向本站投稿分享好文章。
HowdoIdownload,compileandinstallthelatestversionofSAMBAfor Unix Ware/OpenUNIX8.0.0 Keywords uw7 unix wareunixware7uware7.1.07.1.1710711sambaskunkwarenetstat139afpsvisionfscdmclientdrivemappinggzipcompilercc5gccdevelopmentkitmakeconfigurein
How do I download, compile and install the latest version of SAMBA forUnixWare/Open UNIX 8.0.0
Keywords
uw7unixware unixware7 uware 7.1.0 7.1.1 710 711 samba skunkware netstat 139 afps visionfs cdm client drive mapping gzip compiler cc 5 gcc development kit make configure install swat 901 inetd.conf inetd services smb.conf netbiosworkgroup nt security net use access denied system error 1240 86 network neighborhood neighbourhood account specified password authorised login station authorized domain pdc bdc authentication 7.0.1 701 ou8 openunix openunix8
Release
UnixWare Release 7.0.1, 7.1.0., 7.1.1
Caldera Open UNIX 8.0.0
Problem
I wish to download, compile and install the latest version of SAMBA,
version 2.2.3a
Solution
Use the following steps:
1. Run “netstat -an | grep 139” at the root prompt to see if you
already have a file and printer server product running on your
server. For example:
- A previous version of SAMBA
- Advanced File & Print Services (AFPS)
- VisionFS
- Tarantella 3.1x running Client Drive Mapping (CDM)
2. Visit www.samba.org and select a download site nearest to
you.
The FTP Site should identify an image file to download, for
example:
samba-2.2.3a.tar.gz
Download this file to your server into a directory:
/local/samba
3. To unpack the file, you will need a copy of “gzip”. To obtain a
copy, visit:
www.caldera.com/skunkware/shutils/#gzip
and download the latest GZIP distribution for UnixWare 7. For
example:
gzip-1.2.4-dist.tar
and download it to into the directory:
/
Alternatively, visit the SkunkWare CD provided with your Media
Kit to obtain the software.
To install GZIP, untar the file with the command:
tar xvf gzip-1.2.4-dist.tar
Once completed, ensure that /use/local/bin is in your PATH.
4. To unpack the SAMBA file:
cd /local/samba
gunzip samba-2.2.3a.tar.gz
tar xvf samba-2.2.3a
This will generate a /local/samba/samba-2.2.3a directory.
5. Check the contents of:
samba-2.2.3a/packaging/Caldera/OpenServer/README
6. If you have the GNU compiler installed, you will be able to follow
the instructions detailed in the README file.
Alternatively, you can:
cd ../../../source
./configure
to compile using the built-in UnixWare 7 compiler, assuming your
server has the necessary “cc” compiler installed ('ccs' package).
7. Now, run the command:
make
This will create the binaries. Once it's successfully compiled
you can use:
make install
to install the binaries and manual pages. You can install the
binaries and/or man pages separately using:
make installbin
and
make installman
Note: if you are upgrading for a previous version of SAMBA, you
might like to know that the old versions of the binaries will be
renamed with a “.old” extension. You can go back to the previous
version with:
make revert
8. Once completed, you should find your new binaries in:
/usr/local/samba
9. To access the Web version of SAMBA Administration (SWAT), you will
need to:
using your favorite editor, modify /etc/inetd.conf with the
following line:
swat stream tcp nowait root /usr/local/samba/bin/swat swat
and add the following line to /etc/services:
swat 901/tcp
To start the services, you will need to restart the “inetd”
process. To find the process number of this process, run:
ps -ef | grep inetd
root 928 922 TS 80 0 11:49:54 ? 0:00 /usr/sbin/inetd
In this example, the process id is “928”. You need to run:
kill -1 928
You should now be able to access SWAT with your favorite browser
by going to the URL:
Note: A Web server does not need to be running on your server.
Note: When prompted, you can log in as the “root” user.
10.You should then have access to the following URL:
This document will explain how to initially configure your SAMBA
and start the appropriate daemons to start testing access to your
server.
You will find example “smb.conf” files to copy to:
/usr/local/samba/lib
in:
/local/samba/samba-2.2.3a/examples/simple
or:
/local/samba/samba-2.2.3a/packaging/Caldera/UnixWare
or:
Simply create one with just the entries:
[global]
workgroup =
[homes]
guest ok = no
read only = no
11.Should you have problems with connection from a PC client, there
is a document called “DIAGNOSIS.txt”, which is located in the
/local/samba directory structure to help you identify problems.
/local/samba/samba-2.2.3a/docs/textdocs/DIAGNOSIS.txt
In addition:
When connecting with the command:
net use d: servernameservice
and you are getting errors such as:
System error 5 has occurred
Access is denied
or:
System error 1240 has occurred
The account is not authorized to login from this station
or:
System error 86 has occurred
The specified network password is not correct
It is likely your username is not being properly authenticated.
If you already have a Windows NT domain in your organization,
you may wish to add:
security = server
password server =
to the “global” section of “smb.conf” or use a simpler
“smb.conf” to start with. See the above examples.
If you do not have a Windows NT domain in your organisation
then you may wish to add:
encrypt passwords = Yes
to the “global” section of “smb.conf” then run:
/usr/local/samba/bin/smbpasswd -a
then enter a password.
You should then be able to connect to the SAMBA server from your
Windows client.
12.Your SAMBA server should appear in the Network Neighborhood or
“My Network Places” under the WorkGroup or Domain detailed in the
“smb.conf” file. You should be able to click on the server and,
assuming you have an account there, have access to your
$HOME directory.
13.Check the number of connections you can have buy connecting to this
server using smbclient. For example:
#!/bin/sh
:
i=0
while [ ${i} -lt 300 ]
do
smbclient //
let i+=1
done
sleep 2
echo “Press RETURN to kill ...”
read a
kill `ps -e | grep smbclient | awk '{ print $1 }'`
Tune the kernel value FLCKREC from the default value of 300 to
allow more connections.
NOTE: Downloaded SAMBA and SkunkWare products are unsupported by Caldera.
Below is the DIAGNOSIS.txt file:
--------------------------------------------------------------------------------
!==
!== DIAGNOSIS.txt for Samba release 2.2.0-alpha3 24 Mar
!==
Contributor: Andrew Tridgell
Updated: November 1,
Subject: DIAGNOSING YOUR SAMBA SERVER
===========================================================================
This file contains a list of tests you can perform to validate your
Samba server. It also tells you what the likely cause of the problem
is if it fails any one of these steps. If it passes all these tests
then it is probably working fine.
You should do ALL the tests, in the order shown. I have tried to
carefully choose them so later tests only use capabilities verified in
the earlier tests.
If you send me an email saying “it doesn't work” and you have not
followed this test procedure then you should not be surprised if I
ignore your email.
ASSUMPTIONS
-----------
In all of the tests I assume you have a Samba server called BIGSERVER
and a PC called ACLIENT both in workgroup TESTGROUP. I also assume the
PC is runningwindowsfor workgroups with a recent copy of the
microsoft tcp/ip stack. Alternatively, your PC may be running Windows
95 or Windows NT (Workstation or Server).
The procedure is similar for other types of clients.
I also assume you know the name of an available share in your
smb.conf. I will assume this share is called “tmp”. You can add a
“tmp” share like by adding the following to smb.conf:
[tmp]
comment = temporary files
path = /tmp
read only = yes
THESE TESTS ASSUME VERSION 2.0.6 OR LATER OF THE SAMBA SUITE. SOME
COMMANDS SHOWN DID NOT EXIST IN EARLIER VERSIONS
Please pay attention to the error messages you receive. If any error message
reports that your server is being unfriendly you should first check that you
IP name resolution is correctly set up. eg: Make sure your /etc/resolv.conf
file points to name servers that really do exist.
Also, if you do not have DNS server access for name resolution please check
that the settings for your smb.conf file results in “dns proxy = no”. The
best way to check this is with “testparm smb.conf”
TEST 1:
-------
In the directory in which you store your smb.conf file, run the command
“testparm smb.conf”. If it reports any errors then your smb.conf
configuration file is faulty.
Note: Your smb.conf file may be located in: /etc
Or in: /usr/local/samba/lib
TEST 2:
-------
run the command “ping BIGSERVER” from the PC and “ping ACLIENT” from
the unix box. If you don't get a valid response then your TCP/IP
software is not correctly installed.
Note that you will need to start a “dos prompt” window on the PC to
run ping.
If you get a message saying “host not found” or similar then your DNS
software or /etc/hosts file is not correctly setup. It is possible to
run samba without DNS entries for the server and client, but I assume
you do have correct entries for the remainder of these tests.
Another reason why ping might fail is if your host is running firewall
software. You will need to relax the rules to let in the workstation
in question, perhaps by allowing access from another subnet (onLinux
this is done via the ipfwadm program.)
TEST 3:
-------
Run the command “smbclient -L BIGSERVER” on the unix box. You
should get a list of available shares back.
If you get a error message containing the string “Bad password” then
you probably have either an incorrect “hosts allow”, “hosts deny” or
“valid users” line in your smb.conf, or your guest account is not
valid. Check what your guest account is using “testparm” and
temporarily remove any “hosts allow”, “hosts deny”, “valid users” or
“invalid users” lines.
If you get a “connection refused” response then the smbd server may
not be running. If you installed it in inetd.conf then you probably edited
that file incorrectly. If you installed it as a daemon then check that
it is running, and check that the netbios-ssn port is in a LISTEN
state using “netstat -a”.
If you get a “session request failed” then the server refused the
connection. If it says “Your server software is being unfriendly” then
its probably because you have invalid command line parameters to smbd,
or a similar fatal problem with the initial startup of smbd. Also
check your config file (smb.conf) for syntax errors with “testparm”
and that the various directories where samba keeps its log and lock
files exist.
There are a number of reasons for which smbd may refuse or decline
a session request. The most common of these involve one or more of
the following smb.conf file entries:
hosts deny = ALL
hosts allow = xxx.xxx.xxx.xxx/yy
bind interfaces only = Yes
In the above, no allowance has been made for any session requests that
will automatically translate to the loopback adaptor address 127.0.0.1.
To solve this problem change these lines to:
hosts deny = ALL
hosts allow = xxx.xxx.xxx.xxx/yy 127.
Do NOT use the “bind interfaces only” parameter where you may wish to
use the samba password change facility, or where smbclient may need to
access local service for name resolution or for local resource
connections. (Note: the “bind interfaces only” parameter deficiency
where it will not allow connections to the loopback address will be
fixed soon).
Another common cause of these two errors is having something already running
on port 139, such as Samba (ie: smbd is running from inetd already) or
something like Digital's Pathworks. Check your inetd.conf file before trying
to start smbd as a daemon, it can avoid a lot of frustration!
And yet another possible cause for failure of TEST 3 is when the subnet mask
and / or broadcast address settings are incorrect. Please check that the
network interface IP Address / Broadcast Address / Subnet Mask settings are
correct and that Samba has correctly noted these in the log.nmb file.
TEST 4:
-------
Run the command “nmblookup -B BIGSERVER __SAMBA__”. You should get the
IP address of your Samba server back.
If you don't then nmbd is incorrectly installed. Check your inetd.conf
if you run it from there, or that the daemon is running and listening
to udp port 137.
One common problem is that many inetd implementations can't take many
parameters on the command line. If this is the case then create a
one-line script that contains the right parameters and run that from
inetd.
TEST 5:
-------
run the command “nmblookup -B ACLIENT '*'”
You should get the PCs IP address back. If you don't then the client
software on the PC isn't installed correctly, or isn't started, or you
got the name of the PC wrong.
If ACLIENT doesn't resolve via DNS then use the IP address of the
client in the above test.
TEST 6:
-------
Run the command “nmblookup -d 2 '*'”
This time we are trying the same as the previous test but are trying
it via a broadcast to the default broadcast address. A number of
Netbios/TCPIP hosts on the network should respond, although Samba may
not catch all of the responses in the short time it listens. You
should see “got a positive name query response” messages from several
hosts.
If this doesn't give a similar result to the previous test then
nmblookup isn't correctly getting your broadcast address through its
automatic mechanism. In this case you should experiment use the
“interfaces” option in smb.conf to manually configure your IP
address, broadcast and netmask.
If your PC and server aren't on the same subnet then you will need to
use the -B option to set the broadcast address to the that of the PCs
subnet.
This test will probably fail if your subnet mask and broadcast address are
not correct. (Refer to TEST 3 notes above).
TEST 7:
-------
Run the command “smbclient //BIGSERVER/TMP”. You should then be
prompted for a password. You should use the password of the account
you are logged into the unix box with. If you want to test with
another account then add the -U option to the end of
the command line. eg: smbclient //bigserver/tmp -Ujohndoe
Note: It is possible to specify the password along with the username
as follows:
smbclient //bigserver/tmp -Ujohndoe%secret
Once you enter the password you should get the “smb>” prompt. If you
don't then look at the error message. If it says “invalid network
name” then the service “tmp” is not correctly setup in your smb.conf.
If it says “bad password” then the likely causes are:
- you have shadow passords (or some other password system) but didn't
compile in support for them in smbd
- your “valid users” configuration is incorrect
- you have a mixed case password and you haven't enabled the “password
level” option at a high enough level
- the “path =” line in smb.conf is incorrect. Check it with testparm
- you enabled password encryption but didn't create the SMB encrypted
password file
Once connected you should be able to use the commands “dir” “get”
“put” etc. Type “help
especially check that the amount of free disk space shown is correct
when you type “dir”.
TEST 8:
-------
On the PC type the command “net view BIGSERVER”. You will need to do
this from within a “dos prompt” window. You should get back a list of
available shares on the server.
If you get a “network name not found” or similar error then netbios
name resolution is not working. This is usually caused by a problem in
nmbd. To overcome it you could do one of the following (you only need
to choose one of them):
- fixup the nmbd installation
- add the IP address of BIGSERVER to the “wins server” box in the
advanced tcp/ip setup on the PC.
- enable windows name resolution via DNS in the advanced section of
the tcp/ip setup
- add BIGSERVER to your lmhosts file on the PC.
If you get a “invalid network name” or “bad password error” then the
same fixes apply as they did for the “smbclient -L” test above. In
particular, make sure your “hosts allow” line is correct (see the man
pages)
Also, do not overlook that fact that when the workstation requests the
connection to the samba server it will attempt to connect using the
name with which you logged onto your Windows machine. You need to make
sure that an account exists on your Samba server with that exact same
name and password.
If you get “specified computer is not receiving requests” or similar
it probably means that the host is not contactable via tcp services.
Check to see if the host is running tcp wrappers, and if so add an entry in
the hosts.allow file for your client (or subnet, etc.)
TEST 9:
--------
Run the command “net use x: BIGSERVERTMP”. You should be prompted
for a password then you should get a “command completed successfully”
message. If not then your PC software is incorrectly installed or your
smb.conf is incorrect. make sure your “hosts allow” and other config
lines in smb.conf are correct.
It's also possible that the server can't work out what user name to
connect you as. To see if this is the problem add the line “user =
USERNAME” to the [tmp] section of smb.conf where “USERNAME” is the
username corresponding to the password you typed. If you find this
fixes things you may need the username mapping option.
TEST 10:
--------
Run the command “nmblookup -M TESTGROUP” where TESTGROUP is the name
of the workgroup that your Samba server and Windows PCs belong to. You
should get back the IP address of the master browser for that
workgroup.
If you don't then the election process has failed. Wait a minute to
see if it is just being slow then try again. If it still fails after
that then look at the browsing options you have set in smb.conf. Make
sure you have “preferred master = yes” to ensure that an election is
held at startup.
TEST 11:
--------
From file manager try to browse the server. Your samba server should
appear in the browse list of your local workgroup (or the one you
specified in smb.conf). You should be able to double click on the name
of the server and get a list of shares. If you get a “invalid
password” error when you do then you are probably running WinNT and it
is refusing to browse a server that has no encrypted password
capability and is in user level security mode. In this case either set
“security = server” AND “password server = Windows_NT_Machine” in your
smb.conf file, or enable encrypted passwords AFTER compiling in support
for encrypted passwords (refer to the Makefile).
Still having troubles?
----------------------
Try the mailing list or newsgroup, or use the tcpdump-smb utility to
sniff the problem. The official samba mailing list can be reached at
samba@samba.org. To find out more about samba and how to
subscribe to the mailing list check out the samba web page at
samba.org/samba
Also look at the other docs in the Samba package!
-------------------------------------------------------------------------------
NOTES: If you receive an error messages regarding “libncurses.so.4”, ensure
that /usr/local/samba/bin is linked to /usr/local/samba/sbin.
SEE ALSO:
Configuring Samba Server as a Primary Domain Controller (Ref. #000313-0009)
Troubleshooting a Samba Server (Ref. #000412-0020)
File and Print Server: Samba on OpenLinux 3.1 (Ref. #011101-0012)
TA # 116682, “How do I get SAMBA configured and running on my OpenLinux system?”
TA # 118223, “Is there any documentation for OpenLinux on how to configure an OpenLinux 3.1.1 as a BackOffice Server?”
TA # 114822, “How do I download, compile and install the latest version of SAMBA for OpenServer?”
Configuring Windows Clients:
www.oreilly.com/catalog/samba/chapter/book/ch03_01.html
www.oreilly.com/catalog/samba/chapter/book/ch03_02.html
Troubleshooting Samba:
www.oreilly.com/catalog/samba/chapter/book/ch09_01.html
www.oreilly.com/catalog/samba/chapter/book/ch09_02.html
www.oreilly.com/catalog/samba/chapter/book/ch09_03.html
www.samba.org
www.caldera.com/skunkware/samba/
原文转自:www.ltesting.net
在/etc/samba目录下,有smb.conf文件,自己看看样本, 以下是启动Samba的办法。建议不要使用图形窗口方式(X- windows 方式) 1、在终端窗口里用smbadduser脚本增加用户,格式如下: smbadduser unix id:ntid(unixid是 linux 下用户的名字,ntid是用户从 Win
在/etc/samba目录下,有smb.conf文件,自己看看样本。以下是启动Samba的办法。建议不要使用图形窗口方式(X-windows方式)
1、在终端窗口里用smbadduser脚本增加用户,格式如下:
smbadduserunixid:ntid(unixid是linux下用户的名字,ntid是用户从Windows系统访问时输入的名字,例如:smbadduser bill:bill
2、用smbpasswd为每个用户指定password,格式如下:(必须是Root)
smbpasswd userid:passwd userid2:passwd2 ......
3、在smb.conf文件的[global]段中加入encrypt passwords = yes选项,打开口令加密功能,同时指定password文件的位置,加入smb passwd file = /etc/samba/smbpasswd(一般都放在这里)
4、重新启动samba即可
原文转自:www.ltesting.net
于千万人之中遇见你,缘份
clearcase/“ target=”_blank“ >ccd”>于千万人之中遇见你,缘份啊,。。。。。
前言:为了实现windows 和 Linux以及其他操作系统之间的资源共享,软件商推出nfs 和samba两种解决方式。由于市场上缺乏象pc-nfs那样的客户端工具,使得Linux和windows的资源共享变得复杂。Samba的出现解决了这一问题,它以其简洁、实用、灵活配置的特点受到越来越多人们的广泛关注。Windows利用SMB协议来实现操作系统间文件和打印机共享,而Samba本身具备SMB协议,它实现局域网内和Windows系列计算机的资源共享。本文就Samba在Linux系统下的配置为重点,讨论局域网内windows 与 Linux 的资源共享。一、Samba 介绍1、SMB协议SMB (Server Message Block,服务信息块) 协议,是局域网上的共享文件/打印机的一种协议,它可以为网络内部的其他windows和linux 机器提供文件系统、打印服务。SMB的工作原理是让NetBIOS和SMB运行在TCP/IP之上,且使用NetBIOS的nameserver让linux机器可以在windows 网络邻居里被浏览。2、SambaSamba是用来实现SMB的一种软件,由澳大利亚的Andew Tridgell开发,是一种在Linux 环境里运行的自由软件。它可以完成如下功能:文件服务和打印服务,实现Windows和Linux的资源共享。登录服务器,可以作为局域网的服务器。作为主域控制器。WINS服务器。支持SSL。支持SWAT。二、 Samba服务1、 核心进程Samba 有两个守护进程:smbd 和nmbd,它们是Samba的核心进程。nmbd进程使其他计算机浏览Linux服务器,Smbd进程在SMB服务请求到达时对它们进行处理,并且为使用或共享的资源进行协调。2、 启动服务Samba 有两种启动方式:Daemon形式和Inetd形式。(1)Daemon形式 建立启动脚本:rc.sambasmbd -D -d1nmbd -D -d1-D 表示以Daemon形式执行;-d1 表示除错记录级别执行脚本文件rc.samba(2)Inetd形式设置文件:/etc/servicesnetbios-ssn 139/ tcpnetbios -ns 137/ udp设置文件:/etc/inetd.confnetbios -ssn stream tcp nowait root /usr/sbin/smbd smbdnetbios -ns dgram udp wait root /usr/sbin/nmbd nmbd重启动Inetd daemon# kill -HUP 13、 客户工具 smbclientSmbclient命令用来存取远程Samba服务器上的资源。其命令形式与ftp相似。命令语法是:#smbclient
其配置如下:[homes]comment = Hnnw Directoriesbrowseable = nowritable = yes(3)用户共享目录用来指定某一特定用户组或者用户拥有访问权限的目录配置,下列参数配置仅有hnnw组的用户有权访问目录/home/samba。[public]comment = Public Hnnwpath = /home/sambapublic = yeswritable = yesprintable = nowrite list = @hnnw2、 用户映射全局参数“username map”用来控制用户映射,它允许管理员指定一个映射文件,该文件包含了在客户机和服务器之间进行用户映射的信息。如:username map= /etc/smbuser用户映射经常在windows 和linux 主机间进行。 两个系统拥有不同的用户账号,用户映射的目的是将不同的用户映射成为一个用户,便于共享文件。下面是一个映射文件的例子:# Map Windows admin to rootroot=admin administrator;Map the member of developer to studiostudio = @developer等号左边是单独的Linux账号,等号右边是要映射的账号列表。服务器逐行分析映射文件,如果提供的账号和某行有右侧列表中的账号匹配,就把它替换为等号左边的账号。3、 使用加密口令新版本的windows 95以及windows98、winnt(sp3以上版本),在网络传输中仅传递加密口令作为用户认证的信息。这类客户机和不支持加密口令并且以user安全级运行的Samba服务器通讯时,会出现故障。为了正常的通讯,samba服务器使用加密口令。下面讨论如何在samba中使用加密口令。(1) 口令文件 /etc/smbpasswd为了使用加密口令,samba 需要一份口令文件(/etc/smbpasswd),并且该文件应该和Linux的口令文件(/etc/passwd)保持同步。下面是生成文件命令:# cat /etc/password | mksmbpasswd > /etc/smbpasswdsmbpasswd 是需要的口令文件,其权限是0600,所有者是rootsmbpasswd和passwd文件的记录对应,密码部分不同。密码有两部分组成,每部分是32个“X”,前部分用于和Lanman通讯,后部分和Windows NT通讯。Root用户可以使用smbpasswd命令为每个用户设定samba口令。(2) 修改配置文件 /etc/smb.conf要使Samba使用加密口令,需要在配置文件smb.conf中加入如下参数。Encrypt passwords=yesSmb passwd file= /etc/smbpasswd第一行通知samba使用加密口令,第二行给出口令文件的位置。(3) 重启动samba 服务。修改完配置文件后,需要重新启动samba服务,可用如下命令:# /usr/sbin/samba restart4、windows系统中的明码口令使用Samba系统中使用明码口令作为连接SMB的默认设置。当SMB服务器对协商协议做出响应时,响应信息包含了一位,以说明服务器是否支持询问或者响应加密。随着win95的网络重定向更新程序的发布,Microsoft修改了默认值,这样,windows客户就不会向不支持加密的服务器发送明码口令了。在这种情况下,有两种解决办法:(1)设置Samba服务器使用加密口令(2)让windows客户使用明码口令这里选用第2种解决办法,通过修改注册表来实现。下面对win95/win98、winnt用户分别给与说明。(1)win98/win95系统用户在注册表中加入下列注册字,并重新启动机器:[HKLMSystemCurrentCntrolSetServicesVxDVNETSUP]“EnablePlainTextPAssword”= dword:00000001(2)Winnt系统用户修改注册表,加入下列注册表项,并重新启动机器:[HKLMSystemCurrentCntrolSetServicesRdrParameters]“EnablePlainTextPAssword”= dword:00000001四、Samba应用1、 windows资源共享与使用(1)windows资源共享a. 使用TCP/IP协议作为网络默认通讯协议b. 修改网络配置,设置文件和打印机共享。c. 设置好计算机名和所属工作组d.共享系统资源(2)在windows系统中使用Linux共享资源a. 登录进入windows网络b. 通过网上邻居查看、使用共享资源。c. 命令行下工具使用共享资源使用命令行下的net.txt工具来查看、使用共享资源:net use 命令的语法: c:>net use X:servernamesharename在这里,X:是共享的驱动器盘符,servernamesharename是到共享的UNC的网络路径。例如: c:>net use h:heymyfile表示:将hey机器上的myfile共享资源映射为本地的h盘2、Linux资源共享与使用(1)将Linux 的资源共享通过编辑Samba配置文件,添加需要共享的Linux资源。同时可以设定访问此资源的用户群及其访问权限。下面是一段例子,将本机的 /public/data 目录共享,所有人都有读写权限。[data]comment = Public Datapath = /public/datapublic = yeswritable = yesprintable = no(2)在Linux中使用共享资源可以使用smbclient命令,访问所有的Samba资源。具体使用方法见前述。五、Samba应用程序smbclient :访问所有共享资源smbstatus: 列出当前所有的samba连接状态smbpasswd:修改samba用户口令、增加samba用户。Nmblookup:用于查询主机的NetBIOS名,并将其映射为IP地址Testparam: 用于检查配置文件中的参数设置是否正确Linux 系统中的Samba配置
原文转自:www.ltesting.net
Samba使用/etc/samba/smb.conf作为它的配置文件,如果你改变了这个配置文件,这个改变直到你使用service smb restart命令重启Samba守护进程后才会生效。要指定Windows工作组和对它的简短描述,编辑 smb.conf 文件中的以下几行: workgroup = WORKGROUPNAMEse
Samba使用/etc/samba/smb.conf作为它的配置文件。如果你改变了这个配置文件,这个改变直到你使用service smb restart命令重启Samba守护进程后才会生效。要指定Windows工作组和对它的简短描述,编辑 smb.conf 文件中的以下几行:
workgroup = WORKGROUPNAMEserver string = BRIEF COMMENT ABOUT SERVER把WORKGROUPNAME换成你的机器所属的Windows工作组名。BRIEFCOMMENT ABOUT SERVER 是可选的,它被用作关于Samba系统的Windows注释。 要在你的Linux系统上创建Samba共享目录,在smb.conf文件中添加以下几行(根据你和你的系统需要修改了该文件之后):
[sharename]comment = Insert a comment herepath = /home/share/valid users = tfox carolepublic = nowritable = yesprintable = nocreate mask = 0765
上面的例子允许用户 tfox 和 carole 从 Samba 客户中读写 Samba服务器上的目录 /home/share。
加密口令
在 Red Hat Linux 9中,加密口令被默认启用,因为它更安全。如果加密口令没有被使用,纯文本口令就会被使用,它能够被别人使用网络分组嗅探器来截取。建议你使用加密口令。 Microsoft SMB协议最初使用纯文本口令。然而,带有服务包3或更高的 Windows NT 4.0、Windows 98、Windows 、Windows ME、以及 WindowsXP要求加密的Samba口令。要在RedHatLinux系统和运行以上Windows操作系统的系统间使用Samba,你可以编辑Windows注册器来使用纯文本口令过配置你的Linux系统的Samba来使用加密口令。如果你选择要修改你的注册器,你必须为你的全部Windows机器这么做―这很冒险,有可能导致进一步的冲突。为了更高的安全性,推荐你使用加密口令。
要在你的RedHatLinux系统上配置Samba使用加密口令,遵循以下步骤:
1.为 Samba 创建一个单独的口令文件。要根据你的现存 /etc/passwd 文件来创建,在 shell 提示下键入以下命令:
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
如果系统使用 NIS,键入以下命令:
ypcat passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
mksmbpasswd.sh 脚本和 samba 软件包一起被安装在你的 /usr/bin 目录上,
2.改变Samba口令文件的权限许可,因此只有根用户才有读写权限:
chmod 600 /etc/samba/smbpasswd
3.这个脚本不会把用户口令复制到新文件,Samba用户账号在没有设置口令之前不会被激活。为了更高的安全性,建议你把用户的 Samba 口令设置为不同于用户的 Red Hat Linux 口令的口令。要设置每个 Samba 用户的口令,使用以下命令(把 username 替换为每个用户的用户名):
smbpasswd username
4.加密口令必须在Samba配置文件中被启用。在smb.conf文件中,请确定以下行没有被注释掉:
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
5.在 shel提示下键入 service smb restart来确定smb服务被启动。
6.如果你想让 smb 服务被自动启动,使用 ntsysv、chkconfig、或 服务配置工具来在运行时间启用它。
窍门
阅读 /usr/share/doc/samba-/docs/htmldocs/ENCRYPTION.html 来进一步了解有关加密口令的信息。(替换你安装了的 Samba 版本号码)。
当使用了 passwd 命令后,pam_smbpass PAM模块能够被用来同步用户的 Samba口令和他们的系统口令。如果用户启用了passwd命令,他用来登录到RedHatLinux系统的口令以及他要连接 Samba 共享所必须提供的口令就会被改变。
要启动这个功能,把以下行添加到 /etc/pam.d/system-auth 的启动 pam_cracklib.so 之下:password required /lib/security/pam_smbpass.so nullok use_authtok try_first_pass
启动和停止服务器
在通过Samba共享目录的服务器上必须运行 smb 服务。
使用以下命令来查看 Samba 守护进程的状态:
/sbin/service smb status
使用以下命令来启动守护进程:
/sbin/service smb start
使用以下命令来停止守护进程:
/sbin/service smb stop
要在引导时启动 smb 服务,使用以下命令:
/sbin/chkconfig --level 345 smb on
你还可以使用chkconfig、ntsysv或服务配置工具来配置要在引导时启动的服务。
原文转自:www.ltesting.net
[这个贴子最后由燕狂徒在/12/3001:27pm编辑] 一般HTTPServer刚装好后,必须修改的几个地方是 BindAddress*#刚安装好的时候这个前面有#配置的时候去掉(我新装了一台机器是打开的:) ServerNameaix#这个是你的机器名,如果有dns设成域名即可,必须要设
[这个贴子最后由燕狂徒在 2002/12/30 01:27pm 编辑]
一般HTTPServer刚装好后,必须修改的几个地方是
BindAddress * #刚安装好的时候这个前面有#配置的时候去掉(我新装了一台机器是打开的:)
ServerName aix #这个是你的机器名,如果有dns设成域名即可,必须要设置
Port 80 #这一行好像安装完后是被禁止的,一定打开(这个也是打开的)
一般设置了ServerName就可以通过ip地址访问了
HTTPServer的安装文档在随机光盘里标着Expansion pack的那张光盘,跟netscape一起
或者down个apache也一样
下面是具体的配置文件
##
## httpd.conf -- Apache HTTP server configuration file
##
# This is the main server configuration file. See URL www.apache.org/
# for instructions.
# Do NOT simply read the instructions in here without understanding
# what they do, if you are unsure consult the online docs. You have been
# warned.
# Originally by Rob McCool
# These two directives are used to combine the three config files into one.
# The three config files are a legacy setup and are not needed.
AccessConfig /dev/null
ResourceConfig /dev/null
# ServerRoot: The directory the server's config, error, and log files
# are kept in.
# NOTE! If you intend to place this on a NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation,
# you will save yourself a lot of trouble.
ServerRoot /usr/HTTPServer #注意这个是你HTTPServer安装的目录,如果装apache目录会不同,不用修改
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module whichwasbuilt as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `httpd -l' for the list of already
# built-in (statically linked and thus always available) modules in your httpd
# binary.
#
# Example:
# LoadModule foo_module libexec/mod_foo.so
LoadModule env_module libexec/mod_env.so
LoadModule config_log_module libexec/mod_log_config.so
LoadModule mime_magic_module libexec/mod_mime_magic.so
LoadModule mime_module libexec/mod_mime.so
LoadModule negotiation_module libexec/mod_negotiation.so
#LoadModule status_module libexec/mod_status.so
LoadModule includes_module libexec/mod_include.so
LoadModule autoindex_module libexec/mod_autoindex.so
LoadModule dir_module libexec/mod_dir.so
LoadModule cgi_module libexec/mod_cgi.so
LoadModule asis_module libexec/mod_asis.so
LoadModule imap_module libexec/mod_imap.so
LoadModule action_module libexec/mod_actions.so
#LoadModule speling_module libexec/mod_speling.so
#LoadModule proxy_module libexec/libproxy.so
LoadModule userdir_module libexec/mod_userdir.so
LoadModule alias_module libexec/mod_alias.so
LoadModule rewrite_module libexec/mod_rewrite.so
LoadModule access_module libexec/mod_access.so
LoadModule auth_module libexec/mod_auth.so
#LoadModule anon_auth_module libexec/mod_auth_anon.so
LoadModule dbm_auth_module libexec/mod_auth_dbm.so
#LoadModule cern_meta_module libexec/mod_cern_meta.so
#LoadModule expires_module libexec/mod_expires.so
#LoadModule headers_module libexec/mod_headers.so
#LoadModule usertrack_module libexec/mod_usertrack.so
LoadModule unique_id_module libexec/mod_unique_id.so
LoadModule setenvif_module libexec/mod_setenvif.so
LoadModuleweblogic_module libexec/mod_wl.so
# Reconstruction of the complete module list from all available modules
# (static and shared ones) to achieve correct module execution order.
# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_so.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
#AddModule mod_status.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
#AddModule mod_speling.c
#AddModule mod_proxy.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
#AddModule mod_auth_anon.c
AddModule mod_auth_dbm.c
#AddModule mod_cern_meta.c
#AddModule mod_expires.c
#AddModule mod_headers.c
#AddModule mod_usertrack.c
AddModule mod_unique_id.c
AddModule mod_setenvif.c
AddModule mod_weblogic.c
# ServerType is either inetd, or standalone.
ServerType standalone
# If you are running from inetd, go to “ServerAdmin”.
# Port: The port the standalone listens to. For ports < 1023, you will
# need httpd to be run as root initially.
Port 80 #这一行好像安装完后是被禁止的,一定打开
# Listen: The Listen directive is required only if the server will
# be listening on more than 1 port.
#Listen 80
# HostnameLookups: Log the names of clients or just their IP numbers
# e.g. www.apache.org (on) or 204.62.129.132 (off)
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on.
HostnameLookups off
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
# User/Group: The name (or #number) of the user/group to run httpd as.
# On SCO (ODT 3) use User nouser and Group nogroup
# On HPUX you may not be able to use shared memory as nobody, and the
# suggested workaround is to create a user www and use that user.
# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
# when the value of (unsigned)Group is above 60000;
# don't use Group #-1 on these systems!
User nobody
Group nobody
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.
ServerAdmin you@your.address
# BindAddress: You can support virtual hosts with this option. This option
# is used to tell the server which IP address to listen to. It can either
# contain “*”, an IP address, or a fully qualified Internet domain name.
# See also the VirtualHost directive.
BindAddress * #刚安装好的时候这个前面有#配置的时候去掉
# ErrorLog: The location of the error log file. If this does not start
# with /, ServerRoot is prepended to it.
ErrorLog /usr/HTTPServer/logs/error_log
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
LogFormat “%h %l %u %t ”%r“ %>s %b ”%{Referer}i“ ”%{User-Agent}i“” combined
LogFormat “%h %l %u %t ”%r“ %>s %b” common
LogFormat “%{Referer}i -> %U” referer
LogFormat “%{User-agent}i” agent
# The location of the access logfile (Common Logfile Format).
# If this does not start with /, ServerRoot is prepended to it.
CustomLog /usr/HTTPServer/logs/access_log common
# If you would like to have an agent and referer logfile uncomment the
# following directives.
#CustomLog /usr/HTTPServer/logs/referer_log referer
#CustomLog /usr/HTTPServer/logs/agent_log agent
# If you prefer a single logfile with access, agent and referer information
# (Combined Logfile Format) you can use the following directive.
#CustomLog /usr/HTTPServer/logs/access_log combined
# PidFile: The file the server should log its pid to
PidFile /usr/HTTPServer/logs/httpd.pid
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this. But if yours does (you'll know because
# this file is created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
ScoreBoardFile /usr/HTTPServer/logs/httpd.scoreboard
# The LockFile directive sets the path to the lockfile used when Apache
# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
# its default value. The main reason for changing it is if the logs
# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
# DISK. The PID of the main server process is automatically appended to
# the filename.
#
#LockFile /usr/HTTPServer/logs/httpd.lock
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e. use
# “www” instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
ServerName aix #这个是你的机器名,如果有dns设成域名即可
# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a url that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a “canonical” name. With this setting off, Apache will
# use the hostname:port that the client supplied, when possible. This
# also affects SERVER_NAME and SERVER_PORT in CGIs.
UseCanonicalName on
# CacheNegotiatedDocs: By default, Apache sends Pragma: no-cache with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.
#CacheNegotiatedDocs
# Timeout: The number of seconds before receives and sends time out
Timeout 300
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to “Off” to deactivate.
KeepAlive On
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We reccomend you leave this number high, for maximum performance.
MaxKeepAliveRequests 100
# KeepAliveTimeout: Number of seconds to wait for the next request
KeepAliveTimeout 15
# Server-pool size regulation. Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
# It does this by periodically checking how many servers are waiting
# for a request. If there are fewer than MinSpareServers, it creates
# a new spare. If there are more than MaxSpareServers, some of the
# spares die off. These values are probably OK for most sites ---
MinSpareServers 5
MaxSpareServers 10
# Number of servers to start --- should be a reasonable ballpark figure.
StartServers 5
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
#Unixwith it as it spirals down...
MaxClients 150
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.
# The child will exit so as to avoid problems after prolonged use when
# Apache (and maybe the libraries it uses) leak. On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries.
MaxRequestsPerChild 10000
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the VirtualHost command
#Listen 3000
#Listen 12.34.56.78:80
# VirtualHost: Allows the daemon to respond to requests for more than one
# server address, if your server machine is configured to accept IP packets
# for multiple addresses. This can be accomplished with the ifconfig
# alias flag, or through kernel patches like VIF.
# Any httpd.conf or srm.conf directive may go into a VirtualHost command.
# See also the BindAddress entry.
#
#ServerAdmin webmaster@host.some_domain.com
#DocumentRoot /www/docs/host.some_domain.com
#ServerName host.some_domain.com
#ErrorLog logs/host.some_domain.com-error_log
#TransferLog logs/host.some_domain.com-access_log
#
# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
# First, we configure the “default” to be a very restrictive set of
# permissions.
Options FollowSymLinks
AllowOverride None
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
# This should be changed to whatever you set DocumentRoot to.
# This may also be “None”, “All”, or any combination of “Indexes”,
# “Includes”, “FollowSymLinks”, “ExecCGI”, or “MultiViews”.
# Note that “MultiViews” must be named *explicitly* --- “Options All”
# doesn't give it to you.
#Options Indexes FollowSymLinks
# This controls which options the .htaccess files in directories can
# override. Can also be “All”, or any combination of “Options”, “FileInfo”,
# “AuthConfig”, and “Limit”
AllowOverride None
# Controls who can get stuff from this server.
order allow,deny
allow from all
# /usr/HTTPServer/cgi-bin should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
AllowOverride None
Options None
# ScriptAlias: This controls which directories contain server scripts.
# Format: ScriptAlias fakename realname
ScriptAlias /cgi-bin/ /usr/HTTPServer/cgi-bin/
# Allow server status reports, with the URL of servername/server-status
# Change the “.your_domain.com” to match your domain to enable.
#
#SetHandler server-status
#order deny,allow
#deny from all
#allow from .your_domain.com
#
# There have been reports of people trying to abuse an old bug from pre-1.1
# days. This bug involved a CGI script distributed as a part of Apache.
# By uncommenting these lines you can redirect these attacks to a logging
# script on phf.apache.org. Or, you can record them yourself, using the script
# support/phf_abuse_log.cgi.
#
#deny from all
#ErrorDocument 403 phf.apache.org/phf_abuse_log.cgi
#
# You may place any other directories or locations you wish to have
# access information for after this one.
# With this document, you define the name space that users see of your http
# server. This file also defines server settings which affect how requests are
# serviced, and how results should be formatted.
# See the tutorials at www.apache.org/ for
# more information.
# Originally by Rob McCool; Adapted for Apache
# 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 /usr/HTTPServer/htdocs #文档目录
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is recieved.
UserDir public_html
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
DirectoryIndex index.jsp index.html #默认的首页文档
# FancyIndexing is whether you wantfancy directory indexing or standard
FancyIndexing on
# IndexIgnore is a set of filenames which directory indexing should ignore
# Format: IndexIgnore name1 name2...
IndexIgnore .??* *~ *# HEADER* README* RCS
# AccessFileName: The name of the file to look for in each directory
# for access control information.
AccessFileName .htaccess
# DefaultType is the defaultMIME type for documents which the server
# cannot find the type of from filename extensions.
DefaultType text/plain
# AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) uncompress
# information on the fly. Note: Not all browsers support this.
AddEncoding x-compress Z
AddEncoding x-gzip gz
# AddLanguage allows you to specify the language of a document. You can
# then use content negotiation to give a browser a file in a language
# it can understand. Note that the suffix does not have to be the same
# as the language keyword --- those with documents in Polish (whose
# net-standard language code is pl) may wish to use “AddLanguage pl .po”
# to avoid the ambiguity with the common suffix for perl scripts.
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage it .it
AddLanguage ko .ko
AddLanguage es .es
AddLanguage ja .ja
AddLanguage zh-CN .cn
AddLanguage zh-TW .tw
AddLanguage pt-BR .pt
# LanguagePriority allows you to give precedence to some languages
# in case of a tie during content negotiation.
# Just list the languages in decreasing order of preference.
LanguagePriority en
AddDefaultCharset off #这个很重要,手工添加,如果不加你的浏览器浏览的时候可能默认不会显示中文:)
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Format: Redirect fakename url
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So “/icons” isn't aliased in this
# example.
Alias /icons/ /usr/HTTPServer/icons/
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
# Format: AddType type/subtype ext1
# For example, thePHP3 module (not part of the Apache distribution)
# will typically use:
#AddType application/x-httpd-php3 .phtml
#AddType application/x-httpd-php3-source .phps
# AddHandler allows you to map certain file extensions to “handlers”,
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
# Format: AddHandler action-name ext1
# To use CGI scripts:
AddHandler cgi-script .cgi
# To use server-parsed HTML files
AddType text/html .shtml
AddHandler server-parsed .shtml
# Uncomment the following line to enable Apache's send-asis HTTP file
# feature
#AddHandler send-as-is asis
# If you wish to use server-parsed imagemap files, use
#AddHandler imap-file map
# To enable type maps, you might want to use
#AddHandler type-map var
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
# MetaDir: specifies the name of the directory in which Apache can find
# meta information files. These files contain additional HTTP headers
# to include when sending the document
#MetaDir .web
# MetaSuffix: specifies the file name suffix for the file containing the
# meta information.
#MetaSuffix .meta
# Customizable error response (Apache style)
# these come in three flavors
#
# 1) plain text
#ErrorDocument 500 “The server made a boo boo.
# n.b. the ("marks it as text, it does not get output
#
# 2) local redirects
#ErrorDocument 404 /missing.html
# to redirect to local url /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
# n.b. can redirect to a script or a document using server-side-includes.
#
# 3) external redirects
#ErrorDocument 402 some.other_server.com/subscription_info.html
#
# mod_mime_magic allows the server to use various hints from the file itself
# to determine its type.
#MimeMagicFile /usr/HTTPServer/conf/magic
# AddIcon tells the server which icon to show for different files or filename
# extensions
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
DefaultIcon /icons/unknown.gif
# AddDescription allows you to place a short description after a file in
# server-generated indexes.
# Format: AddDescription ”description“ filename
# ReadmeName is the name of the README file the server will look for by
# default. Format: ReadmeName name
#
# The server will first look for name.html, include it if found, and it will
# then look for name and include it as plaintext if found.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName README
HeaderName HEADER
# The following directives disable keepalives and HTTP header flushes.
# The first directive disables it for Netscape 2.x and browsers which
# spoof it. There are known problems with these.
# The second directive is for Microsoft Internet Explorer 4.0b2
# which has a broken HTTP/1.1 implementation and does not properly
# support keepalive when it is used on 301 or 302 (redirect) responses.
BrowserMatch ”Mozilla/2“ nokeepalive
BrowserMatch ”MSIE 4.0b2;“ nokeepalive downgrade-1.0 force-response-1.0
# The following directive disables HTTP/1.1 responses to browsers which
# are in violation of the HTTP/1.0 spec by not being able to grok a
# basic 1.1 response.
BrowserMatch ”RealPlayer 4.0“ force-response-1.0
BrowserMatch ”Java/1.0“ force-response-1.0
BrowserMatch ”JDK/1.0“ force-response-1.0
# Page to display indicating the Administration Server is not installed
ErrorDocument 404 /9ainterim.htm
# CoreDumpDirectory directory: Sets the location where the server will
# attempt to put a core dump. The default location is the ServerRoot.
#
#CoreDumpDirectory /tmp
workaholic 回复于:2002-12-18 12:03:16好同志!
ibm6000 回复于:2002-12-18 12:14:21好
大猫 回复于:2002-12-18 12:24:41very good! save it!
wasp 回复于:2002-12-18 12:26:52好文章,学习中……
alstone 回复于:2002-12-18 12:53:15建议加到精华区哦.
freebob 回复于:2002-12-18 14:52:59这是什么错?
exec: 0509-036 Cannot load program httpd because of the following errors:
0509-130 Symbol resolution failed for /usr/local/apache2/lib/libapr.so because:
0509-136 Symbol isinf (number 121) is not exported from
dependent module /usr/lib/libc.a(shr.o).
0509-192 Examine .loader section symbols with the
'dump -Tv' command.
total 10096
-rw-r--r-- 1 root system 6954 Sep 24 20:28 apr.exp
-rw-r--r-- 1 root system 3431 Sep 24 20:28 aprutil.exp
-rw-r--r-- 1 root system 348 Sep 24 20:28 APRVARS
-rw-r--r-- 1 root system 2713969 Sep 24 20:28 libapr.a
-rw-r--r-- 1 root system 725 Sep 24 20:28 libapr.la
lrwxrwxrwx 1 root system 15 Dec 18 14:46 libapr.so@ -> libapr.so.0.0.0*
lrwxrwxrwx 1 root system 15 Dec 18 13:44 libapr.so.0@ -> libapr.so.0.0.0*
-rwxr-xr-x 1 root system 1334958 Sep 24 20:28 libapr.so.0.0.0*
-rwxr-xr-x 1 root system 705317 Sep 17 23:34 libaprutil.so*
-rwxr-xr-x 1 root system 381701 Sep 24 20:28 libexpat.a*
-rwxr-xr-x 1 root system 688 Sep 24 20:28 libexpat.la*
jbuilder7 回复于:2002-12-19 08:37:48对我也很是有帮助啊
limingtian 回复于:2002-12-19 10:20:02好东东,在那里看到学习文档的?
wolf2602 回复于:2002-12-21 10:28:58好东西,收藏!
jiazhao688 回复于:2002-12-23 13:00:56good boy!!!!!!!!!!!!
echo188 回复于:2002-12-27 17:13:06好同志,致敬!
vincentzj 回复于:2002-12-30 15:47:33freebob
你需要安装aix的补丁,我也遇到过这种问题,安装aix补丁最新版本就好
燕狂徒 回复于:2002-12-18 11:44:27
workaholic 回复于:2002-12-18 12:03:16好同志!
ibm6000 回复于:2002-12-18 12:14:21好
大猫 回复于:2002-12-18 12:24:41very good! save it!
wasp 回复于:2002-12-18 12:26:52好文章,学习中……
alstone 回复于:2002-12-18 12:53:15建议加到精华区哦.
freebob 回复于:2002-12-18 14:52:59这是什么错?
exec(): 0509-036 Cannot load program httpd because of the following errors:
0509-130 Symbol resolution failed for /usr/local/apache2/lib/libapr.so because:
0509-136 Symbol isinf (number 121) is not exported from
dependent module /usr/lib/libc.a(shr.o).
0509-192 Examine .loader section symbols with the
'dump -Tv' command.
total 10096
-rw-r--r-- 1 root system 6954 Sep 24 20:28 apr.exp
-rw-r--r-- 1 root system 3431 Sep 24 20:28 aprutil.exp
-rw-r--r-- 1 root system 348 Sep 24 20:28 APRVARS
-rw-r--r-- 1 root system 2713969 Sep 24 20:28 libapr.a
-rw-r--r-- 1 root system 725 Sep 24 20:28 libapr.la
lrwxrwxrwx 1 root system 15 Dec 18 14:46 libapr.so@ -> libapr.so.0.0.0*
lrwxrwxrwx 1 root system 15 Dec 18 13:44 libapr.so.0@ -> libapr.so.0.0.0*
-rwxr-xr-x 1 root system 1334958 Sep 24 20:28 libapr.so.0.0.0*
-rwxr-xr-x 1 root system 705317 Sep 17 23:34 libaprutil.so*
-rwxr-xr-x 1 root system 381701 Sep 24 20:28 libexpat.a*
-rwxr-xr-x 1 root system 688 Sep 24 20:28 libexpat.la*
jbuilder7 回复于:2002-12-19 08:37:48对我也很是有帮助啊
limingtian 回复于:2002-12-19 10:20:02好东东,在那里看到学习文档的?
wolf2602 回复于:2002-12-21 10:28:58好东西,收藏!
jiazhao688 回复于:2002-12-23 13:00:56good boy!!!!!!!!!!!!
echo188 回复于:2002-12-27 17:13:06好同志,致敬!
vincentzj 回复于:2002-12-30 15:47:33freebob
你需要安装aix的补丁,我也遇到过这种问题,安装aix补丁最新版本就好
hwqzju 回复于:-07-13 13:01:41好文章,不过我只能用ip访问,不能用域名访问,不知道为什么
原文转自:www.ltesting.net
前言: 发现WEB服务器上有一个文件一直在不断增长而且速度还很快,一看是日志文件,已经达到一个G了,但又想留下最新的一些日志,不想一下都删除了,但日志文件太大,根本就打不开。其实这时最好用日志轮询,之前这个WEB服务器没有做这个配置,本应该配置WEB服务器时就应该做的。现在配置下也不晚。
1.首先得要软件:cronolog.org/download/
Version 1.6.2 released 2002-01-24 (gzip'ed tar file)
Version 1.6.1 released 1999-12-20 (gzip'ed tar file)
Win 32 version (ZIP file)
Version 1.6 released 1999-12-16 (gzip'ed tar file)
Version 1.5b9 released on 4 June 1998 (gzip'ed tar file)
Version 1.4 released 20 December 1996 (gzip'ed tar file)
如果有Windows的要下Win_32_version(ZIP file) Linux习惯用哪种包就用哪种.
2. 在Linux 下安装cronolog
tar zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure (注意:默认是安装在/usr/local下 cronolog的命令在/usr/local/sbin下,这个要清楚)
make ; make install
3.在Windows下安装cronolog
在Windows下很简单,直接把cronolog.exe解压Copy到apache目录下的bin目录中.
4.配置都是一样的格式,不过要注意Linux和Windows下斜杠的方向.
Linux下
例:cronolog命令在/usr/local/sbin 下 日志文件在 /usr/local/apache2/logs/下
在FormatLog附近加入两句:
CustomLog ”|/usr/local/sbin/cronolog logs/access_%Y%m%d.log“ combined
ErrorLog ”|/usr/local/sbin/cronolog logs/error_%Y%m%d.log“
Windows下
例:cronolog命令在apache的bin中 日志文件在D:/logs
CustomLog ”|bin/cronolog D:/logs/access_%Y%m%d.log“ combined
ErrorLog ”|bin/cronolog D:/logs/error_%Y%m%d.log“
(注意:斜杠方向都在Linux下是一样的,不跟Windows的习惯一样)
如果有虚拟主机,虚拟主机也要配置,例如:
<VirtualHost *:80>
ServerName www.domain.com
CustomLog ”|bin/cronolog.exe D:/logs/access_%Y%m%d.log“ combined
ErrorLog ”|bin/cronolog.exe D:/logs/error_%Y%m%d.log"
</VirtualHost>
5.重启服务就可以看到生成了一个新的日志文件,