ubuntu环境下的Samba配置文件

ubuntu环境下的Samba配置文件
ubuntu环境下的Samba配置文件

#

# Sample configuration file for the Samba suite for Debian GNU/Linux.

#

#

# This is the main Samba configuration file. You should read the

# smb.conf(5) manual page in order to understand the options listed

# here. Samba has a huge number of configurable options most of which

# are not shown in this example

#

# Some options that are often worth tuning have been included as

# commented-out examples in this file.

# - When such options are commented with ";", the proposed setting

# differs from the default Samba behaviour

# - When commented with "#", the proposed setting is the default

# behaviour of Samba but the option is considered important

# enough to be mentioned here

#

# NOTE: Whenever you modify this file you should run the command

# "testparm" to check that you have not made any basic syntactic

# errors.

# A well-established practice is to name the original file

# "smb.conf.master" and create the "real" config file with

# testparm -s smb.conf.master >smb.conf

# This minimizes the size of the really used smb.conf file

# which, according to the Samba Team, impacts performance

# However, use this with caution if your smb.conf file contains nested

# "include" statements. See Debian bug #483187 for a case

# where using a master file is not a good idea.

#

#======================= Global Settings ======================= [global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP

# server string is the equivalent of the NT Description field

server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:

# WINS Support - Tells the NMBD component of Samba to enable its WINS Server # wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client

# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both

; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.

dns proxy = no

# What naming service and in what order should we use to resolve host names

# to IP addresses

; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to

# This can be either the interface name or an IP address/netmask;

# interface names are normally preferred

; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the

# 'interfaces' option above to use this.

# It is recommended that you enable this feature if your Samba machine is

# not protected by a firewall or is a firewall itself. However, this

# option cannot handle dynamic or non-broadcast interfaces correctly.

; bind interfaces only = yes

#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine

# that connects

log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).

max log size = 1000

# If you want Samba to only log through syslog then set the following

# parameter to 'yes'.

# syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log

# through syslog you should set the following parameter to something higher.

syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace panic action = /usr/share/samba/panic-action %d

####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account

# in this server for every user accessing the server. See

# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html

# in the samba-doc package for details.

#security = user

security = share

# You may wish to use password encryption. See the section on

# 'encrypt passwords' in the smb.conf(5) manpage before enabling.

encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what

# password database type you are using.

passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix

# password with the SMB password when the encrypted SMB password in the

# passdb is changed.

unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following

# parameters must be set (thanks to Ian Kahan < for

# sending the correct chat script for the passwd program in Debian Sarge).

passwd program = /usr/bin/passwd %u

passwd chat = *Enter¥snew¥s*¥spassword:* %n¥n *Retype¥snew¥s*¥spassword:* %n¥n *password¥supdated¥ssuccessfully* .

# This boolean controls whether PAM will be used for password changes

# when requested by an SMB client instead of the program listed in

# 'passwd program'. The default is 'no'.

pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped

# to anonymous connections

map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC

# must have this setting enabled. If you are the BDC you must

# change the 'domain master' setting to no

#

; domain logons = yes

#

# The following setting only takes effect if 'domain logons' is set

# It specifies the location of the user's profile directory

# from the client point of view)

# The following required a [profiles] share to be setup on the

# samba server (see below)

; logon path = ¥¥%N¥profiles¥%U

# Another common choice is storing the profile in the user's home directory

# (this is Samba's default)

# logon path = ¥¥%N¥%U¥profile

# The following setting only takes effect if 'domain logons' is set

# It specifies the location of a user's home directory (from the client

# point of view)

; logon drive = H:

# logon home = ¥¥%N¥%U

# The following setting only takes effect if 'domain logons' is set

# It specifies the script to run during logon. The script must be stored

# in the [netlogon] share

# NOTE: Must be store in 'DOS' file format convention

; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR

# RPC pipe. The example command creates a user account with a disabled Unix

# password; please adapt to your needs

; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the

# SAMR RPC pipe.

# The following assumes a "machines" group exists on the system

; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR

# RPC pipe.

; add group script = /usr/sbin/addgroup --force-badname %g

########## Printing ##########

# If you want to automatically load your printer list rather

# than setting them up individually then you'll need this

# load printers = yes

# lpr(ng) printing. You may wish to override the location of the

# printcap file

; printing = bsd

; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the

# cupsys-client package.

; printing = cups

; printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration

# on a per machine basis. The %m gets replaced with the netbios name

# of the machine that is connecting

; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.

# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html # for details

# You may want to add the following on a Linux system:

# SO_RCVBUF=8192 SO_SNDBUF=8192

# socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package

# installed. The samba maintainer and the linpopup maintainer are

# working to ease installation and configuration of linpopup and samba.

; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this

# machine will be configured as a BDC (a secondary logon server), you

# must set this to 'no'; otherwise, the default behavior is recommended.

# domain master = auto

# Some defaults for winbind (make sure you're not using the ranges

# for something else.)

; idmap uid = 10000-20000

; idmap gid = 10000-20000

; template shell = /bin/bash

# The following was the default behaviour in sarge,

# but samba upstream reverted the default because it might induce

# performance issues in large organizations.

# See Debian bug #368251 for some of the consequences of *not*

# having this setting and smb.conf(5) for details.

; winbind enum groups = yes

; winbind enum users = yes

# Setup usershare options to enable non-root users to share folders

# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled. ; usershare max shares = 100

# Allow users who've been granted usershare privileges to create

# public shares, not just authenticated ones

usershare allow guests = yes

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)

# to enable the default home directory shares. This will share each

# user's home directory as ¥¥server¥username

;[homes]

; comment = Home Directories

; browseable = no

# By default, the home directories are exported read-only. Change the

# next parameter to 'no' if you want to be able to write to them.

; read only = yes

# File creation mask is set to 0700 for security reasons. If you want to

# create files with group=rw permissions, set next parameter to 0775.

; create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to

# create dirs. with group=rw permissions, set next parameter to 0775.

; directory mask = 0700

# By default, ¥¥server¥username shares can be connected to by anyone

# with access to the samba server. Un-comment the following parameter

# to make sure that only "username" can connect to ¥¥server¥username

# This might need tweaking when using external authentication schemes

; valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons # (you need to configure Samba to act as a domain controller too.)

;[netlogon]

; comment = Network Logon Service

; path = /home/samba/netlogon

; guest ok = yes

; read only = yes

; share modes = no

# Un-comment the following and create the profiles directory to store

# users profiles (see the "logon path" option above)

# (you need to configure Samba to act as a domain controller too.)

# The path below should be writable by all users so that their

# profile directory may be created the first time they log on

;[profiles]

; comment = Users profiles

; path = /home/samba/profiles

; guest ok = no

; browseable = no

; create mask = 0600

; directory mask = 0700

[printers]

comment = All Printers

browseable = no

path = /var/spool/samba

printable = yes

guest ok = no

read only = yes

create mask = 0700

# Windows clients look for this share name as a source of downloadable # printer drivers

[print$]

comment = Printer Drivers

path = /var/lib/samba/printers

browseable = yes

read only = yes

guest ok = no

# Uncomment to allow remote administration of Windows print drivers. # You may need to replace 'lpadmin' with the name of the group your

# admin users are members of.

# Please note that you also need to set appropriate Unix permissions

# to the drivers directory for these users to have write rights in it

; write list = root, @lpadmin

# A sample share for sharing your CD-ROM with others.

;[cdrom]

; comment = Samba server's CD-ROM

; read only = yes

; locking = no

; path = /cdrom

; guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the # cdrom share is accesed. For this to work /etc/fstab must contain # an entry like this:

#

# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0

#

# The CD-ROM gets unmounted automatically after the connection to the #

# If you don't want to use auto-mounting/unmounting make sure the CD # is mounted on /cdrom

#

; preexec = /bin/mount /cdrom

; postexec = /bin/umount /cdrom

[nettemp]

comment = share temporary files for all users

path = /share/nettemp/

public = yes

writable = yes

valid users = nobody

guest ok = yes

实验十三 Samba服务器配置及访问Samba共享

实验十三、Samba服务器配置及访问Samba共享 一、实验目的: 1.掌握Linux与Windows的资源共享和互访方法; 2.掌握Samba服务器的安装和配置方法; 3.使用samba共享用户认证和文件系统。 二. 实验内容: 1.利用rpm命令安装软件包; 2.安装、配置Samba服务器并启动; 3.从Linux访问Windows资源; 4.从Windows访问Linux的资源。 三、实验练习: 数据包过滤设定为无效状态。在本次试验开始之前,请确保主机上的所有包过滤已被关闭。缺省的安装将会有一个文件叫做“/etc/sysconfig/iptables”,该文件配置了iptable的功能。运行“chkconfig iptables off”。为了去除所有的规则,运行“service iptables stop”。配置虚拟机网络,使得虚拟机和主机能互通。 任务一、Samba的用户连接的配置 1、用命令检查一下samba套件是否已经被安装。#rpm –qa|grep samba。如果出现samba-common-2.2.7a-7.9.0 samba-client-2.2.7a-7.9.0 samba-2.2.7a-7.9.0 那么恭喜你,你已经安装好了samba,如果没有以上那些东西,请安装。安装方法很简单,redhat linux 9.0第一张光盘里就有//cdrom/RedHat/RPMS/

2. 把第一张光盘放进光驱,他会自动挂接的,省得自己动手mount了 #cd /mnt/cdrom/RedHat/RPMS(注意大小写字母,否则会出错的) #rpm -ivh samba-common-2.2.7a-7.9.0 (这个要先安装,安装的时候不一定要把后面的 samba-common-2.2.7a-7.9.0全部写完,比如写到samba-c的时候,多按几次Tab键即可) #rpm -ivh samba-2.2.7a-7.9.0 #rpm -ivh samba-client-2.2.7a-7.9.0(客户端) 安装了以上的东西之后,基本上就可以了,但为了配置的方便以及利用REDHAT LINUX9.0新特性,我建议再安装以下两个东西redhat-config-samba-1.0.4-1,samba-swat-2.2.7a- 7.9.0。光盘里都有,其中redhat-config-samba-1.0.4-1在第一张光盘里,samba-swat-2.2.7a-7.9.0 在第二张光盘里,安装方法和上面的一样。 #rpm -qa|grep samba redhat-config-samba-1.0.4-1 samba-common-2.2.7a-7.9.0 samba-client-2.2.7a-7.9.0 samba-swat-2.2.7a-7.9.0 samba-2.2.7a-7.9.0 OK,安装成功!(建议,以上东西最好自己安装一次,系统上如果装的有,还是先卸载,这样, 才能加深印象,如果卸载以后,安装出问题,可能是你没有完全卸载,解决方法要不继续查找卸载, 要不强制安装) 任务二、图形化配置 Samba 服务器 默认的配置文件(/etc/samba/smb.conf)允许用户作为 Samba 共享来查看他们的 Red Hat Linux 主目录。它还把为 Red Hat Linux 配置的打印机作为 Samba 共享打印机来共享。换一句话说,你可以在你的 Red Hat Linux 系统上连接打印机,然后从网络上的 Windows 机器来打印。

Ubuntu下testlink安装部署

Testlink安装部署 1.安装apache2 sudo apt-get install apache2 安装完成。运行如下命令重启下: sudo /etc/init.d/apache2 restart 在浏览器里输入http://localhost或者是http://127.0.0.1,如果看到了It works!,那就说明Apache已安装成功,Apache的默认安装,会在/var下建立一个名为www的目录,所有要通过浏览器访问的Web文件都要放到这个目录里。 2.安装php: sudo apt-get install libapache2-mod-php5 php5 此外,建议安装扩展php5-gd php5-mysql,安装方式同上. 安装完后,重新启动Apache,让它加载PHP模块: sudo /etc/init.d/apache2 restart 接下来,在Web目录下面新建一个test.php文件来测试PHP是否能正常的运行,命令: sudo gedit /var/www/test.php 然后输入: 接着保存文件,在浏览器里输入http://127.0.0.1/test.php,如果在网页中显示hello world,那就说明PHP已经正常运行了。 3.安装mysql数据库: sudo apt-get install mysql-server mysql-client apt-get程序会自动下载安装最新的mysql版本。在安装的最后,它会要求输入root 的密码,注意,这里的root密码不是Ubuntu的root密码,是要给MySQL设定的root 密码。 4.安装phpmyadmin-Mysql数据库管理 sudo apt-get install phpmyadmin phpmyadmin设置:

Samba 安装及简单配置、windows访问linux的简单例子

Samba 安装及简单配置、windows访问linux的简单例子 2008-01-21 15:30 由于在安装rhel5的时候没哟安装到好Samba,现在只能从新安装了。郁闷啊!(在init.d中没有发现smb和nmb这两个文件) 还好在安装盘里能够找到安装文件。这里就不说了(一堆samba开头的文件。一阵狂点就行了。呵呵……) 1.查看系统默认的Linux samba版本号 登录FEDORA10后,使用 1[root@localhost ~] whereis samba 2samba: /etc/samba /usr/lib/samba /usr/share/man/man7/samba.7.gz 3[root@localhost ~] rpm qa samba 4samba3.2.40.22.fc10.i386 5[root@localhost ~] 已经安装了Linux samba3.2.4版本,不需要再手工安装,这是系统默认装的,可以用service smb start启动samba服务; 查找samba是否安装好 rpm -qa|grep samba,如果有安装会出现 samba-common-2.2.7a-7.9.0 samba-client-2.2.7a-7.9.0 samba-2.2.7a-7.9.0 没有安装的话,可以: Yum -y install samba 安装了所需的Samba服务器软件后就可以启动Samba服务了。在命令行中输入service smb start命令即可重启Samba服务,如图7-4所示。它同时启动了两项服务:SMB服务(也就是Samba服务)和NMB(NetBIOS Message Block,NetBIOS消息块)服务。SMB服务是Samba 的主要服务,它让其他机器能知道此机器共享了什么;NMB服务可以通过主机名代替IP地址来访问局域网里的主机,就是把这台Linux机器所共享的工作组及在此工作组下的NetBIOS name解析出来。如果不打开NMB服务器,则只能通过IP来访问。

在Windows与Linux下Samba共享文件夹以及映射的详细使用说明

共享文件夹以及映射 目录 共享文件夹以及映射 (1) 一、设置Windows XP共享文件夹 (2) 二、设置Linux共享文件夹 (5) 三、访问共享资源以及映射共享资源 (8) 1、Linux系统下访问远程共享资源 (8) 2、Windows系统下访问远程共享资源 (10)

一、设置Windows XP共享文件夹 预设值Windows下的共享资源信息如下: IP地址:192.168.16.249 共享名:test001 共享帐号:user001 账号密码:antiy?100 Windows XP安装时缺省的共享是“简单共享”,是不安全的文件共享。 下面,在Windows下设置带有用户密码的文件共享。 1、首先,取消默认的“简单共享”。 打开“我的电脑”,依次点击“工具→文件夹选项”,在打开的对话框中选择“查看”选项卡,清空“使用简单共享(推荐) ”前的复选框。如图1-1所示。 图1-1 2、然后,创建共享用户。 单击“开始→设置→控制面板”,打开“用户帐户”,创建一个有密码的用户,假设用户名为“user001”,密码为“antiy?100”,需要共享资源的机器必须以该用户共享资源。 如图1-2所示。

3、接下来,设置共享目录。 假设为共享目录为Windows系统下NTFS分区上的目录test001,并设置只有用户user001可以共享该目录下的资源。 用鼠标右键单击要共享的目录“test001”,单击“共享和安全”,选择“共享→共享该文件夹”,点击“权限”,单击“删除”按钮将原先该目录任何用户(everyone)都可以共享的权限删除,再单击“添加”按钮,依次单击“高级→立即查找”,选择用户user001,单击“确定”添加用户user001,并选择用户user001的共享权限(这里是只读)。如图3-1到3-3所示。至此,共享目录已创建完成。 图3-1

Ubuntu系统上的PHP开发环境搭建

Ubuntu系统上的PHP开发环境搭建 编辑日期:15年6月27日 编辑人员:宋永宏 PHP开发环境搭建平台 本文档涉及的PHP开发环境搭建是在Ubuntu 14.04上完成的,因此,下文提到的一系列操作皆适用于该环境。 PHP开发环境搭建过程 在本文档中将使用源码包安装Eclipse,下载Eclipse 4.4.2版本的地址: https://www.360docs.net/doc/9f5660480.html,/downloads/download.php? file=/technology/epp/downloads/release/luna/SR2/eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz 1.安装Eclipse 将sclipse压缩包解压至usr/local/目录: # sudo tar xzf eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz -C /usr/local/ 2.创建桌面快捷方式 # sudo gedit /usr/share/applications/eclipse.desktop [Desktop Entry] Type=Application Name=Eclipse Comment=Eclipse Integrated Development Environment Icon=/usr/local/eclipse/icon.xpm Exec=/usr/local/eclipse/eclipse Terminal=false Categories=Development;IDE;Java; 3.在Eclipse中安装PHP开发工具(PDT) ?点击Eclipse桌面图标; 点击“OK”选择默认工作区。

samba配置详解

samba配置详解:Samba配置文件常用参数详解 疯狂代码 https://www.360docs.net/doc/9f5660480.html,/ ?: http:/https://www.360docs.net/doc/9f5660480.html,/IntegrativeServer/Article65311.html Samba配置文件常用参数详解 Samba主配置文件叫smb.conf默认在/etc/samba/目录下 smb.conf含有多个段每个段由段名开始直到下个段名每个段名放在方括号中间每段参数格式是:名称=指配置文件中行个段名和参数段名和参数名不分大小写 除了[global]段外所有段都可以看作是个共享资源段名是该共享资源名字段里参数是该共享资源属性 Samba安装好后使用testparm命令可以测试smb.conf配置是否正确使用testparm –v命令可以详细列出smb.conf支持配置参数 全局参数: Global Settings = [global] config file = /usr/local/samba/lib/smb.conf.%m 介绍说明:config file可以让你使用另个配置文件来覆盖缺省配置文件如果文件 不存在则该项无效这个参数很有用可以使得samba配置更灵活可以让台samba服务器模拟多台区别配置服务器比如你想让PC1(主机名)这台电脑在访问Samba Server时使用它自己配置文件那么先在/etc/samba/host/下为PC1配置个名为 smb.conf.pc1文件然后在smb.conf中加入:config file = /etc/samba/host/smb.conf.%m这样当PC1请求连接Samba Server时smb.conf.%m就被替换成smb.conf.pc1这样对于PC1来说它所使用Samba服务就是由smb.conf.pc1定义而其他机器访问Samba Server则还是应用smb.conf workgroup = WORKGROUP 介绍说明:设定 Samba Server 所要加入工作组或者域 server = Samba Server Version %v 介绍说明:设定 Samba Server 注释可以是任何串也可以不填宏%v表示显示Samba版本号 netbios name = smbserver 介绍说明:设置Samba ServerNetBIOS名称如果不填则默认会使用该服务器DNS名称第部分netbios name和workgroup名字不要设置成样了

利用samba共享网络打印机

利用samba共享网络打印机 2009年05月27日星期三上午 02:20 公司的打印机是HP Laster Jet 1300n,带有HP jetdirect 200m lio print server 网络接口,打印机的IP地址是192.168.0.9,为每一个人安装配置一变打印驱动实在是麻烦,干脆利用samba把打印机配置成共享的。 一、环境 Red Hat Enterprise Linux AS release 4 (Nahant Update 4) IP Address: 192.168.0.5 默认安装的cups、samba、hpijs包分别如下: hal-cups-utils-0.5.2-8 cups-libs-1.1.22-0.rc1.9.11 cups-1.1.22-0.rc1.9.11 libgnomecups-0.1.12-5 system-config-samba-1.2.21-1 samba-common-3.0.10-1.4E.9 samba-3.0.10-1.4E.9 samba-client-3.0.10-1.4E.9 hpijs-1.6-2 二、配置打印机 首先启动cups,方法如下 #/etc/init.d/cups start or #service cups start 然后在本机的浏览器里输入http://127.0.0.1:631,应该就会出现打印机配置界面。 1.点击Administration,正确输入root及密码,出现Admin页面; 2.点击Add Printer,出现Add New Printer 页面,根据情况填写如下打印机信息,点击continue; Name:HP Location:192.168.0.9 Description:Share 3.出现"Device for HP"(这里HP是你上一步填写的打印机名字)页面,选择Device类型为“Windows Printer via SAMBA”,点击continue; 4.出现"Device URI for HP"(名字同上)页面,Device URI输入如下信息,点击continue; socket://192.168.0.9 5.出现"Model/Driver for HP"页面,在Make里选择HP(你根据自己的打印机厂家选择),点击continue; 6.还是“Model/Driver for HP”页面,在 Model里选择“HP LasterJet Series CUPS v1.1(en)"(请根据你的型号选择),点击continue; 这时候,打印机已经添加成功了。可以点击Printers菜单看一下,打印机应该已经出现了。点击Print Teset Page试试,可以打印,那么就ok了,:)三、配置SAMBA服务器 前提条件,SAMBA已经正常运行(如果你不会配置,网上教程很多,找找看),

Linux下安装Apache+PHP+MySql搭建PHP运行环境

Linux下安装Apache+PHP+MySql 搭建PHP运行环境 目录 Linux下安装Apache+PHP+MySql (1) 搭建PHP运行环境 (1) 一、引言 (2) 二、关闭SELINUX (2) 三、安装Apache (3) 1.检查、删除 (3) 2.安装 (3) 四、安装MySql (4) 3.检查、删除 (4) 4.安装 (4) 5.相关命令 (6) 1)启动、关闭、重启命令 (6) 2)登录、查看命令 (6) 3)修改密码 (6) 4)撤销权限 (6) 5)显示、修改mysql 的字符集 (7) 6)查看用户信息 (7) 7)数据库备份与导入 (8) 6.目录介绍 (9) 7.问题汇总 (9) 8)MySql只有information_schema信息数据库 (9) 五、安装PHP (11)

六、配置Apache (12) 七、配置域名 (13) 八、配置PHP (14) 九、测试 (16) 一、引言 LAMP(Linux-Apache-MySQL-PHP)网站架构是目前国际流行的 Web 框架,该框架包括:Linux 操作系统,Apache 网络服务器,MySQL 数据库,Perl、PHP 或者 Python 编程语言,所有组成产品均是开源软件,是国际上成熟的架构框架,很多流行的商业应用都是采取这个架构,和 Java/J2EE 架构相比,LAMP 具有Web 资源丰富、轻量、快速开发等特点,微软的.NET 架构相比,LAMP 具有通用、跨平台、高性能、低价格的优势,因此 LAMP 无论是性能、质量还是价格都是企业搭建网站的首选平台。 本文安装环境:CentOS release 6.3 (Final)_2.6.32-279.el6.i686 所需安装软件: Apache PHP mysql-server-5.1.73-3.el6_5.i686 二、关闭SELINUX # vi /etc/selinux/config #SELINUX=enforcing #注释掉 #SELINUXTYPE=targeted #注释掉 SELINUX=disabled #增加 :wq!#保存退出 shutdown -r now#重启系统

Samba详细配置

Red Hat Enterprise Linux 5下安装配置Samba服务 2010-09-28 23:34:25| 分类:Linux Samba | 标签:linux samba f服务器配置安装|字号大中小订阅环境: Red Hat Enterprise Linux 5 samba-3.0.25b-0.el5.4 samba-common-3.0.25b-0.el5.4 samba-client-3.0.25b-0.el5.4 system-config-samba-1.2.39-1.el5 一、安装 1、检查是否已经安装Samba服务器(默认只是安装了Samba的客户端) #rpm -qa | grep samba 若显示: samba-common-3.0.25b-0.el5.4 samba-client-3.0.25b-0.el5.4 则表示还没有安装Samba服务器端,只是安装了Samba客户端 2、开始安装 1)放入Red Hat Enterprise Linux 5安装光盘,并挂载好 #mount /dev/cdrom /mnt/cdrom 2)可使用:命令查看其安装文件 # ls /mnt/cdrom/Server/ | grep samba samba-3.0.25b-0.el5.4.i386.rpm samba-client-3.0.25b-0.el5.4.i386.rpm samba-common-3.0.25b-0.el5.4.i386.rpm samba-swat-3.0.25b-0.el5.4.i386.rpm sblim-cmpi-samba-0.2.3-29.EL5.i386.rpm sblim-cmpi-samba-devel-1-29.EL5.i386.rpm sblim-cmpi-samba-test-1-29.EL5.i386.rpm system-config-samba-1.2.39-1.el5.noarch.rpm 再进行安装 # rpm -ivh /mnt/cdrom/Server/samba-3.0.25b-0.el5.4.i386.rpm(samba服务器) # rpm -ivh /mnt/cdrom/Server/system-config-samba-1.2.39-1.el5.noarch.rpm(图形化配置程序) # rpm -ivh /mnt/cdrom/Server/samba-swat-3.0.25b-0.el5.4.i386.rpm(基于HTTP的配置工具,可不安装) 二、配置 1、配置文件:/etc/samba/smb.conf(其中“#”号开头是注释语句,“;”开头是示范语句) 可使用如下语句修改它: # vi /etc/samba/smb.conf 配置完后可使用如下语句检查配置文件 #testparm smb.conf文件的整体结构: [global]

samba权限设置

samba权限设置 2009-06-09 11:46 本来使用samba没有太大的要求,就是方便windows下能共享linux下的代码,好利用sourceinsight来编辑源代码,在linux编译。可前不久发现自己的共享目录里多了好多东西,查看log文件才知道好多人在我的共享目录里进进出出。“公共厕所嚒,想进就进,想出就出”,于是,不得不研究一下samba 的权限管理,让共享即方便自己,也安全自己。 之前我是把每个目录允许guest访问,并将guest设置成我的linux登陆用户,并开启可写,因为我要在windows下对linux下的文件进行编辑,这样一来,共享目录权限完全开启,十分危险。 以下是一个linux下samba服务器的搭建实例,对理解samba的配置有很好的帮助。做点补充: 1.介绍的方法主要是命令行设置和对samba脚本进行配置,一些图形化的软件也可以实现类似功能。 2.测试smb.conf的命令为testparm 3.设置读写权限的一个简便方法是在每个目录配置中添加write list 和read list,如: [home] path =/home comment = .... write list = user1 read list = user1 user2 当然前提是要有user1,user2 4.linux中用smbclient登陆和windows中输入路径\\ip\path来登录有些不一样,我在这里绕了好久。windows中好像一次登录后就记录了用户名和密码,好像就不能改了,除非关机重启(这个现象我也不明白为什么,希望大牛们能指点一二), 比如:有两个共享目录dir1,dir2.而dir1设置成只允许user1登录,dir2只允许user2登录;我现在用user1来登录dir1,再登陆dir2就不成功了,重启用user2登录dir2可以,再登陆dir1就不行了,不知能否是一个bug还是可以设置? 5.smbclient,smbtree,smbstatus等一些小工具也是挺好用的,哈哈。 6.还有很多具体的设置可以man,默认的conf里都有注释的,也很值得一

ubuntu下安装LAMP图文教程

Ubuntu环境下搭建LAMP 一.安装 PHP开发和服务器运行环境首选LAMP组合,即Linux+Apache+Mysql+Php/Perl /Python,能最优化服务器性能。Ubuntu10.04本身就是基于Linux内核,在本地电脑Ubuntu中安装和配置LAMP环境,使用Ubuntu LAMP Server 软件包可以很方便的实现Linux下Apache,Mysql和Php的统一安装和配置。 首先应该多花费一点时间熟悉一下linux常用的命令,这对后面的操作很有帮助,不会命令也没关系,照猫画虎一步一步来。相对来说比配置W AMP要轻松的多。其次你的电脑要能够上网。 注:如果想看清图片的内容请把WORD放大【Ctrl+鼠标滚轮键即可调整大小】 1、安装LAMP 1、打开新立得软件包管理器,系统/管理/新立得软件包管理器 2、在新立得软件包管理器中选择编辑/ 使用任务分组标记软件包 3、在打开的窗口中勾选LAMP SERVER 然后确定。 4、在主窗口中点击绿色的对号应用按钮

5、好了。接下来就是等待...等待新立得自动下载安装完。 6、下载完开始安装时会提示输入mysql的root用户的密码。输入密码后系统会自动完成安装。 ---------------------------------------------------------------------简洁的分割线------------------------------------------------------------------ 2、安装phpmyadmin 方案1:终端中运行命令:sudo apt-get install phpmyadmin

Samba加入域设置

Samba加入域设置 版权声明:本文由网友IT小亚马原创。QQ:1401232840 。 最近我想学习Samba加入域的服务,我在网上找了很多教程。但是很多教程实际上是有错误的,不是加入域不行就是登录提示密码错误。研究了差不多两天,终于搞成功了。现在我就把我自己的方法分享给那些想学samba域的人。其中的不足请高人指出。 1.首先打开krb5.conf文件。 #vim /etc/krb5.conf 把文件改成如下所示。域名改成自己的域名,注意大小写。 [logging] default = FILE:/var/log/krb5libs.log kdc = FILE:/var/log/krb5kdc.log admin_server = FILE:/var/log/kadmind.log [libdefaults] default_realm = https://www.360docs.net/doc/9f5660480.html, dns_lookup_realm = false dns_lookup_kdc = false ticket_lifetime = 24h forwardable = yes [realms] https://www.360docs.net/doc/9f5660480.html, = { kdc = 192.168.5.5:88 #域控的ip。 admin_server = 192.168.5.5:749 default_domain = https://www.360docs.net/doc/9f5660480.html, } [domain_realm] https://www.360docs.net/doc/9f5660480.html, = https://www.360docs.net/doc/9f5660480.html, https://www.360docs.net/doc/9f5660480.html, = https://www.360docs.net/doc/9f5660480.html, [appdefaults] pam = { debug = false ticket_lifetime = 36000 renew_lifetime = 36000 forwardable = true krb4_convert = false

phpstudy搭建Linux的php环境

phpstudy版(笔记) 参考文章: Linux一键安装web环境全攻略phpstudy版(笔记) https://www.360docs.net/doc/9f5660480.html,/414.html https://www.360docs.net/doc/9f5660480.html,/qq_21794887/article/details/61916438 注:这里我是把网站主程序放在以https://www.360docs.net/doc/9f5660480.html, 为名称的文件夹下,绑定访问的域名也是相同 所以文件路径为phpstudy/www/https://www.360docs.net/doc/9f5660480.html,/index.php 开始配置 在线安装phpstudy一键包: 1.在Xshell里面输入wget -c https://www.360docs.net/doc/9f5660480.html,/phpstudy.bin回车 2.输入chmod +x phpstudy.bin回车,这一步用于设置权限,要在root权限下操作 3.输入./phpstudy.bin回车,执行安装。 接下来都是中文提示操作,选择安装什么版本和选择是lnmp还是lamp,按照提示进行输入回车。大约需要28分钟的时间。 4.出现这样的信息。。说明你安装完毕: 5.域名绑定: 输入:phpstudy add 会提示让你输入网站访问域名 再输入你的网站访问域名

6.安装ftp: wget -c https://www.360docs.net/doc/9f5660480.html,/phpstudy-ftpd.sh回车 chmod +x phpstudy-ftpd.sh回车 ./phpstudy-ftpd.sh回车 下图说明FTP安装完毕 7.开通FTP: 输入phpstudy ftp add 根据提示输入: FTP用户名 密码 能打开的目录/phpstudy/www 输入目录(注意是绝对目录)就是你网站程序所要存放的目录 配置好后就可以通过ftp上传下载文件(可能需要分配权限) 8.开启phpstudy phpstudy start 9.访问网站 https://www.360docs.net/doc/9f5660480.html, 这里我是把要上传的程序文件名称改为网址名称(https://www.360docs.net/doc/9f5660480.html,)上传文件至 /phpstudy/www/ 域名 域名就是绑定的域名名称,也就是网站程序所在文件夹的名称

在Ubuntu下安装配置WordPress

在Ubuntu下安装配置WordPress Linux 2009-04-19 14:55:06 阅读402 评论0 字号:大中小订阅 什么是WordPress WordPress是一种使用PHP语言和MySQL数据库开发的开源、免费的Blog(博客,网志)引擎,用户可以在支持PHP和MySQL数据库的服务器上建立自己的Blog。WordPress是一个功能非常强大的博客系统,插件众多,易于扩充功能.安装和使用都非常方便。目前WordPress已经成为主流的Blog搭建平台... 本文将使用Ubuntu 8.10为例,一步一步实现安装配置WordPress 1.安装WordPress所需要的运行环境(主要是Apache和MySQL,如果已经安装,下面部分步骤可以略过) 1.1安装Apache和PHP模块 $ sudo apt-get install apache2 $ sudo apt-get install libapache2-mod-php5 php5 1.2安装MySQL $ sudo apt-get install mysql-server-5.0 mysql-common mysql-admin 1.3安装PHP的MySQL模块 $ sudo apt-get install php5-mysql 1.4配置MySQL $ mysql -u root mysql -p 初次登录没有root密码,直接回车就行 以下2句创建WordPress需要的数据库和数据库用户 mysql> CREATE DATABASE db_wordpress; mysql> GRANT ALL PRIVILEGES ON db_wordpress.* TO user_wordpress@localhost IDENTIFIED BY "wordpress" WITH GRANT OPTION; 2.启动Apache和MySQL $ sudo /etc/init.d/apache2 start $ sudo /etc/init.d/mysql start 3.安装WordPress

配置samba服务器-梁玉锋

配置samba服务器 用以下命令查看samba的安装情况。 [root@localhost linux-2.6.18_pro500]# rpm -qa |grep samba samba-common-3.4.7-58.fc12.i686 samba-3.4.7-58.fc12.i686 samba-winbind-clients-3.4.2-47.fc12.i686 samba-client-3.4.7-58.fc12.i686 samba服务器安装完成后,几个重要的文件分布如下: /etc/pam.d/samba:samba的PAM认证配置。 /etc/rc.d/init.d/smb:samba的启动脚本。 /etc/samba/smbusers:samba服务器用户与操作系统用户映射文件。 /usr/bin/mksmbpasswd.sh:创建samba用户的脚本。 /usr/bin/smbcontrol:控制samba服务器运行的工具。 /usr/bin/smbstatus:列出samba服务器的连接状态。 /usr/sbin/nmbd:samba服务器的nmbd进程的命令文件。 /usr/sbin/smbd:samba服务器的smbd进程的命令文件。 用以下命令启动samba服务器。 [root@localhost linux-2.6.18_pro500]# /etc/rc.d/init.d/smb start 启动SMB 服务:[确定] [root@localhost linux-2.6.18_pro500]# /etc/rc.d/init.d/nmb start 启动NMB 服务:[确定] [root@localhost linux-2.6.18_pro500]# ps -eaf |grep smbd root 17528 1 0 20:51 ? 00:00:00 smbd -D root 17530 17528 0 20:51 ? 00:00:00 smbd -D root 17540 1925 0 20:51 pts/0 00:00:00 grep smbd [root@localhost linux-2.6.18_pro500]# ps -eaf |grep nmbd root 17537 1 0 20:51 ? 00:00:00 nmbd -D root 17542 1925 0 20:52 pts/0 00:00:00 grep nmbd 默认时,samba服务器启动了两个smbd进程和一个bmbd进程,均以root用户的身份运行。其中,smbd进程主要负责处理对文件和打印机的服务请求;而nmbd进程主要负责处理Netbios名称服务并提供网络浏览功能。 可以用一下命令查看以下这两个进程监听的网络端口。 [root@localhost linux-2.6.18_pro500]# netstat -anp|grep smbd tcp 0 0 :::139 :::* LISTEN 17657/smbd tcp 0 0 :::445 :::* LISTEN 17657/smbd tcp 0 0 ::ffff:192.168.1.101:445 ::ffff:192.168.1.106:4429 ESTABLISHED 17693/smbd unix 2 [ ] DGRAM 42228 17657/smbd

Ubuntu16.04LTS下安装apache2+php7.0+mysql+phpmyadmin

先说一下,我用的是现在最新版的UBuntu16.04LTS操作系统 刚开始接触UBuntu,在网上看到很多安装教程但都是旧版,照着搭了一次出现各种问题都不成功, 这次根据我前次失败,自己搭个WEB服务器,做这个教程一是为了给自己做个记录,二是分享给和我一 样刚开始接触UBuntu的朋友。 1.安装Apache2,打开终端输入命令:sudo apt-get install apache2回车,输入Y回车 如图所视:

就这么简但apache2就装完了,输入:sudo /etc/init.d/apache2 restart,回车重启apache,这是为了启动apache

打开浏览器,输入127.0.0.1或着localhost,如图所视出现apache2此页面说明您已经安装成功,服务器也已经正常启动。 2.安装php 先说一点现在的php都是7.0,不要想php5了。 瞧这张图上已经告诉我们了,它找不到php5

所以在这里终端输入:sudo apt-get install libapache2-mod-php7.0 php7.0回车,输入Y回车

输入php -v查看一下php的版本,如图所视 输入sudo /etc/init.d/apache2 restart回车,重启一下apache

输入sudo gedit /var/www/html/test.php,回车,在apache的站根目录下新建一个.php的测试页 在测试页里输入“”如图所视 在浏览器中输入php测试页所在地址:127.0.0.1/test.php,如果您看这个页面说明php已经安装成功。

Samba之文件共享配置实例word资料8页

Samba之文件共享配置实例 本例实现了不同的用户访问同一个共享目录具有不同的权限,便于管理和维护。基本上能满足一些企业用户的需求。 一.需求 1. 某公司有5个大部门,分别为:人事行政部、财务部、技术部、市场部、生产部。 2. 各部门的文件夹只允许本部门员工有权访问;各部门之间交流性质的文件放到公用文件夹中。 3. 每个部门都有一个管理本部门文件夹的管理员账号和一个只能新建和查看文件的普通用户权限的账号。 4. 公用文件夹中分为存放工具的文件夹和存放各部门共享文件的文件夹。 5. 对于各部门自己的文件夹,各部门管理员具有完全控制权限,而各部门普通用户可以在该部门文件夹下新建文件及文件夹,并且对于自己新建的文件及文件夹有完全控制权限,对于管理员新建及上传的文件和文件夹只能访问,不能更改和删除。不是本部门用户不能访问本部门文件夹。 6. 对于公用文件夹中的各部门共享文件夹,各部门管理员具有完全控制权限,而各部门普通用户可以在该部门文件夹下新建文件及文件夹,并且对于自己新建的文件及文件夹有完全控制权限,对于管理员新建及上传的文件和文件夹只能访问,不能更改和删除。本部门用户(包括管理员和普通用户)在访问其他部门共享文件夹时,只能查看不能修改删除新建。对于存放工具的文件夹,只有管理员有权限,其他用户只能访问。 二.规划 根据公司需求情况,现做出如下规划: 1. 在系统分区时单独分一个Company的区,在该区下有以下几个文件夹:HR、 CaiWu、J iShu、ShiChang、ShengChan和Share。在Share下又有以下几个文件夹:HR、CaiWu、Ji

Shu、ShiChang、ShengChan和Tools。 2. 各部门对应的文件夹由各部门自己管理,Tools文件夹由管理员维护。 3. HR管理员账号:hradmin;普通用户账号:hruser。 CaiWu管理员账号:caiwuadmin;普通用户账号:caiwuuser。 JiShu管理员账号:jishuadmin;普通用户账号:jishuuser。 ShiChang管理员账号:shichangadmin;普通用户账号:shichanguser。 ShengChan管理员账号:shengchanadmin;普通用户账号:shengchanuser。 Tools管理员账号:admin。 文件夹之间的关系请见下图: 三.SAMBA RPM安装和启动 在系统中使用rpm –qa |grep samba和rpm –qa |grep smb来查看系统有没有安装该软件,如果没有安装则挂载系统盘,找到samba软件包,使用rpm –ivh samba*和rpm –i vh smb*即可安装。 使用RPM包安装后,samba的配置文件smb.conf默认在/etc/samba/下。 使用service smb start启动samba。 使用chkconfig --level 35 smb on,可以使samba随系统一起启动。 在/etc/selinux/config中将“SELINUX”项关闭,SELINUX=disabled。 四.新建用户 使用useradd命令新建系统账户,然后再使用smbpasswd –a建立SMB账户。 [root@Samba /]#useradd –s /sbin/nologin jishuadmin [root@Samba /]#useradd –g jishuadmin –s /sbin/nologin jishuuser [root@Samba /]#useradd –s /sbin/nologin shichangadmin [root@Samba /]#useradd –g shichangadmin –s /sbin/nologin shichanguser

Ubuntu的apache php mysql安装

Ubuntu 10.04 apache+php+mysql安装 订阅 apache2.4.1 php-5.4.0 mysql 一、安装apache 解压 httpd-2.4.1.tar.gz tar -zxvf httpd-2.4.1.tar.gz 然后 sudo mv httpd-2.4.1 /usr/lib/apache ./configure --prefix=/usr/lib/apache --enable-module=so 出现 bash: ./configure: 权限不够就用 chmod 777 configure,然后再执行上面那命令 Apache Portable Runtime library 没安装下载apr apr-util 参考https://www.360docs.net/doc/9f5660480.html,/kylelee/blog/item/56170afbf380bb244e4aeaee.html 安装apr库 cd apr-1.x.x ./configure –prefix=/usr/lib/apache/apr make sudo make install 安装apr-util库 tar xzvf apr-util-1.x.x.tar.gz cd apr-util-1.x.x ./configure --prefix=/usr/lib/apache/apr-util --with-apr=/usr/lib/apache/apr make sudo make install

安装apache服务 root@:/usr/lib/apche/httpd-2.4.1# ./configure --prefix=/usr/lib/apache/httpd --enable-so --enable-modes-shared=all --with-apr=/usr/lib/apache/apr --with-apr-util=/usr/lib/apache/apr-util 小心注意,别写错参数。 然後,又出现 configure: error: pcre-config for libpcre not found. PCRE is required and available from https://www.360docs.net/doc/9f5660480.html,/ Then we need to download PCRE from this link page 安装pcre正则 下载pcre tar -jxvf pcre-8.30.tar.bz2 如果遇到无法open,则要sudo 在根用户root 下执行: root@:/usr/lib/apche/httpd-2.4.1# ./configure --prefix=/usr/lib/apache/pcre --with- apr=/usr/lib/apache/apr --with-apr-util=/usr/lib/apache/apr-util --with- pcre=/usr/lib/apche/pcre 然后用 make make install 都是在root权限下用的。 继续在root下执行以下命令 root@:/usr/lib/apche/httpd-2.4.1#./configure --prefix=/usr/lib/apache/httpd --enable-so --enable-modes-shared=all --with-apr=/usr/lib/apache/apr --with-apr-util=/usr/lib/apache/apr-util --with-pcre=/usr/lib/apache/pcre 【What's worse, another error happened config.status: error: cannot find input file: `include/ap_config_auto.h.in'

相关文档
最新文档