category update faster

http://www.axertion.com/tutorials/2013/03/changing-category-sort-order-takes-a-long-time-in-magento/

If you’re running a large Magento store, you may encounter an the dreaded “Please Wait” popup that hangs for a long period of time when attempting to move a category.

I looked into it, and discovered that Magneto was calling a reindexing process, which usually takes a bit of time to complete. You obviously don’t want to wait an eternity to move a single category, so you can simply do the following as a temporary way of disabling the reindexing when you move a category.

Disclaimer: This has been tested only on Magento 1.6.2

1. Open app/code/core/Mage/Catalog/Model/Category.php
2. Look for the following, around line 248:

Mage::getSingleton(‘index/indexer’)->processEntityAction(
$this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE
);
Mage::app()->cleanCache(array(self::CACHE_TAG));

3. Simply comment out this code like this:

/*Mage::getSingleton(‘index/indexer’)->processEntityAction(
$this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE
);
Mage::app()->cleanCache(array(self::CACHE_TAG));
*/

4. Save the file, and start moving your categories around instantly.

You can alternatively do this permanently by overriding the Category.php file by copying the file to app/code/local/Mage/Catalog/Model/Category.php and commenting out the code above.

Once you are done the sort order, you can apply the changes to the frontend by reindexing the catalog_flat_data Index, and clearing your Blocks HTML output caches.

Magento is a great platform, but sometimes I wonder why the developers make some of their decisions (like adding a resource intensive reindexing to a simple action like moving a category).

add home button on menu

1)/public_html/app/design/frontend/default/theme497/template/page/html/header.phtml
中要包含
<!–?php echo $this—>getChildHtml(‘topMenu’) ?&gt;

2)

/public_html/app/design/frontend/default/theme497/template/page/html/topmenu.phtml
总增加
<ul>
<li><a href=”http://mutualopticsinc.com”><span>Home</span></a></li>
</ul>

<ul>
<ul>之后,</ul>
</ul>
<!–?php echo $_menu ?–>之前
调整好class内容

2. CentOS5.5系统下 rename .c .h *.c

rename .JPG .jpg *.JPG

把大写的JPG都修改成小写的jpg

 

=====

今天又有同学问linux下怎样批量更改文件后缀名,这个问题被别人问到三次了,所以这里给出几个解决方法

 

一.rename解决

1.  Ubuntu系统下

rename ‘s//.c//.h/’  ./*

 

把当前目录下的后缀名为.c的文件更改为.h的文件

 

2.  CentOS5.5系统下

rename .c  .h   *.c

 

把当前目录下的后缀名为.c的文件更改为.h的文件

 

二.shell 脚本解决

#!/bin/bash

#http://blog.csdn.net/longxibendi
find ./ -name *.c  | while read i
do
echo “$i”;
mv $i.c  $i.h
done
三.find  xargs 解决
find ./ -name “*.c” | awk -F “.” ‘{print $2}’ | xargs -i -t mv ./{}.c  ./{}.h

 

注意,第三种方案是递归的更改,会更改当前目录下及其子目录下所有匹配文件

 

四.参考:

http://blog.csdn.net/longxibendi/archive/2010/09/16/5889055.aspx

 

magento 1.8.10 checkout stop at payment (solution )

here is solution

find the file

go to /app/design/frontend/base/default/template/checkout/onepage/ file payment.phtml
open it, line 36

<fieldset>
<?php echo $this->getChildHtml('methods') ?>
</fieldset>

add id to fieldset

<fieldset id="checkout-payment-method-load">
<?php echo $this->getChildHtml('methods') ?>
</fieldset>
then, copy this file to local theme / checkout/onepage/payment.html
it works for donny!

 

file :

gmail  search

checkout stop at payment

 

 

Magento Post Office fix the April update issues ( usps not show up )

 

update : may 27 2014:
need to download the patch.sh and run it.
here is the page :
http://www.magentocommerce.com/blog/magento-community-edition-alert-important-patch-for-usps-api/

here is the download link:
http://info.magento.com/rs/magentocommerce/images/PATCH_SUPEE-1868_CE_1.7.0.2_v1.sh?icid=BLOG_uspsceapi_onesevenpatcha

upload the patch file to root , under public_html/
and use ssh root , run the command : sh PATCH_SUPEE-1868_CE_1.7.0.2_v1.sh

you will see the update :
Checking if patch can be applied/reverted successfully…
Patch was applied/reverted successfully.
clear the cache , magento cache.

it should works, other wise , run below and upload the files.
=======

 

Here are the steps:

  • Click here to download the USPS patch module.
  • Unzip the folder.
  • Upload the contents to your Magento site.
  • Go to System -> Cache Management and click “Flush Magento Cache”
  • Go to System -> Shipping Methods -> USPS and make sure the shipping methods you want are highlighted.
  • Save Configuration.

That should be all you have to do!  This has only been tested in 1.7.  If you have any issues, comments or questions don’t hesitate to ask!

download link  :

http://www.online-e-cig.com/Ia_Usps.zip

http://www.informationarchitech.com/blog/help-my-usps-shipping-methods-are-no-longer-displaying-in-magento/

七种公司永远无法做大

【导读】本文讲述了七种公司永远无法做大,希望各位创业者引以为戒。1、格局小的企业;2、心态小的企业;3、短视的企业;4、缺外脑的企业;5、缺内脑的企业;6、用金扁担挑粪的企业;7、需要预约的企业。

  1、格局小的企业

  1999年2月,牛根生对孙先红说:我给你100万的宣传费,对谁也不要说。先红问:为什么不能说?牛说:现在总共筹到300万,拿出100万做广告,我怕大家知道后接受不了。我就要一个效果:一夜之间,让呼市人都知道。于是1999年4月1日早上,一觉醒来,人们突然发现道路两旁冒出了一溜溜的红色路牌广告,上面高书金色大字:蒙牛乳业,创内蒙古乳业第二品牌!

  但在现实中,许多老板肩上扛着品牌大旗心里打着小算盘,乐于小打小闹,希望以小的投入来获得大的回报,从没想过以大的投入来换取更大的回报。这实际上就是一种格局。格局小的老板,想的永远是自己,希望从一颗鸡蛋中吃出黄金;而格局大的老板,则能着眼于未来,在大环境中定义自己的事业。

  2、心态小的企业

  俗话说:善弈者谋势,不善弈者谋子。许多企业之所以做不大,就在于只谋子不谋势。

  谋势就是定战略,有了战略,路再长,总有一天会走到;没有战略,走得越猛,死得越早。置战略需求于不顾,希望用1分钱换来100元的效果的主,很难走出穷的境界,因为占便宜本身就代表没有境界。死抠一城一池,是活三年的企业,因为它不抬头看天。东一榔头西一棒子的,是活三月的企业,因为它不低头看地。不看天,山雨欲来浑然不觉,要被洪水淹死;不看地,夜半悬崖大步流星,要被群山淹没。

  3、短视的企业

  立竿见影、刀下见菜,是大多数老板的想法,当然这也没有错,因为解决目前的生存问题是第一位的。但是,生存问题属于战术问题,而发展问题属于战略问题,解决生存问题必须刀下见菜,但要搞定发展问题则需要细水长流最后水到渠成。现实中,很多老板都有短视心态,以为整一个亮点马上就能换回巨大的效益,于是一个活动搞下去或一期广告投下去看到没什么效果就马上停止。其实这种想法并不正确,因为品牌对于企业而言是一个长期工程和系统工程,既要有独特的个性,又需要系统的提炼及提升;对于客户而言,品牌又是一种认知识别和体验识别,他们需要你能记住你的特别理由,因此也就需要你在诉求点上要坚持深入。

  4、缺外脑的企业

  曾有人说过这样一句话:在中国,资源第一位,机遇第二位,能力第三位,学历第四位,不少老板比别人做得成功,就在于他所拥有的社会资源为他创造了部分条件。而很多老板之所以做不大,原因就在于他缺少足够的社会资源,单打独斗当然也就孤掌难鸣。说到社会资源,很多人都会想到领导支持这个词语,其实这并不全面,向领导、职能部门传递企业的正面信息,获得政策范围内的支持,这只属于整合营销传播的一个方面。除了官方资源以外,能帮你快速解决一定融资困难的亲友资源,能为你迅速带来人才的人力推介资源,能为你出谋划策充当参谋的智力资源、信息资源等等,这些资源都会对你的发展壮大起着重要的作用。这些都是企业的外脑。

  5、缺内脑的企业

  一个好汉三个帮,如果没有一批能征善战的下属为你冲锋陷阵,老板再厉害,也难以成事。许多企业就面临这样的问题:优秀的人招不来,有出息的人留不住,剩下的看谁谁不顺眼,为什么会这样呢?员工愿不愿加盟公司、能加盟多久,与薪酬福利、团队氛围、学习提升、办事机制,成就感,归属感、生活现状等各种因素紧密相连。目前,大多数的企业,薪酬福利都差不多,关键问题是:老板只看重行政管理与业绩,只关注你今天卖了多少、有没有迟到早退,至于思想管理、技能管理、状态管理与团队氛围管理,老板根本就没有这个意识,最后员工技能得不到提升,思想得不到引导,越干越没劲,只好走人了事。管理的表面化,最终导致员工素质同质化,做不大也就在情理之中了。

  6、用金扁担挑粪的企业

  从前有个小伙子,祖辈都是菜农。小伙子每天挑粪去菜地浇菜,从小习惯了这年复一年的活。一天,他去菜地的路上在一棵大树下歇脚,坐在挑粪扁担上,远眺村里大财主的那幢豪华楼房,心里突然有个梦想﹕有一天我要是像他那么有钱,我一定要打一副用金子做成的扁担挑粪。用金扁担挑粪虽然有了财富有了金子,但是挑粪的思维还是没有改变,因为他已经习惯了那种操作手法。所以,很多企业看到别人有了驰名商标就马上去申请一个驰名商标,看到别人开了一个自助火锅生意不错,于是就立马也开一个。有了这些金蛋蛋以后,马上把它做成一根金扁担挑着以前的大便继续前进。

  7、需要预约的企业

  中国的小老板令人感动和尊敬,在我看来,哪怕是开小饭馆的小老板,也功德无量,令人尊敬,因为他们为社会提供了更多的就业岗位,贡献了更多的税收,开发了更多的技术。他们多数才华横溢、精明能干、出身草根、白手起家,其赤手空拳打天下的勇气让人佩服。他们在资金与技术贫瘠的土壤中扎根,在不利政策环境中破土,在外资、合资品牌丛林中成长,生命的顽强与坚韧让人感慨与惊叹。他们热情而富有理想,为了实现百年老店的梦想,很多人起得比鸡还要早,睡得比狗还要晚。企业最大的瓶颈是资金!然而,在你没有实力之前要想获得金融支持,干过企业的人都深有体会,最缺德的机构莫过于银行,他们向来都是雨天收伞!在尊敬与感动之余,又难免有点儿心酸与不安。因为很多小老板都患上了这样的毛病:事业不大架子大、老板不大脾气大,自以为是,傲气十足,结果很多的机会就在这种需要预约的情况下丧失了。

  接来下我问你:

  1、每天你忙东忙西忙上忙下忙左忙右忙里忙外,忙到最后你虽然赚了点钱,但你永远没有时间与自由。

  你何时才能享受企业越强大,你越轻松?

  你何时才能享受你离企业越远,企业越壮大?

  2、何时才能享受你做的越少却赚钱越多?

  何时才能让团队进一步,而你身为老板退一步?

  我可以跟你肯定一件事—如果你不解决,不跨过,你的企业永远只是一家三流的小企业!你身为老板绝对只是一个大业务员,大管家,超级员工。

  你还想这样下去多久?这样下去会有怎样的后果?

  成功的企业需要构筑三大系统:产品思维、团队思维、客户思维!

  1、产品思维解决的是如何赚钱(商业模式)的问题(卖什么、怎么卖、在哪里卖);

  2、团队思维解决的是如何分钱(分配机制)的问题(人,薪酬,考核,晋升,愿景,规则);

  3、客户思维解决的是如何收钱(营销模式)的问题(不能靠能人,也不能靠神人,要靠业务流程) ;

  真正的老板需要的是全局的系统思维能力,不但要学会如何赚钱、更要学会如何分钱,更重要的是要学会如何把钱收回来!

  任何一个人只要会学了这三点,就可以在商场上立足,并持续的为自己源源不断赚取财富!

magento internal 500 error problem and solve solution

http://www.techjam.gr/2012/magento/solve-magento-500-internal-server-errors/

================

How to Solve Magento 500 Internal Server Errors

Many users encounter some weird Magento 500 Internal Server Errors (Error type 500). I will try to list the most common solutions. These errors are not always caused by the same reason. You should try to take a look at your server’s error logs to get some help about this error.

You can get additional info about the errors by Turning on Developer Mode. Look in the Magento bootstrap file (index.php), you’ll see lines similar to the following

#Mage::setIsDeveloperMode(true);
#ini_set(‘display_errors’, 1);

Uncomment these. In a production system, you’d never want to have your errors display to the browser, but while developing having an errors and warnings thrown immediately in your face is invaluable. This way, you will see the actually problem which lead to the Internal Error Server. In almost cases, the reason is that there is an exception throw after output is sent to browser.

Solution #1

This error might be caused because you have not set the correct permissions for the magento folders. To solve this go to File Manager and then change the file permission of index.php file from 664 to 644.  Also change the permissions of downloader/index.php file to 644 as well otherwise when you will try to access System > Magento Connect >Magento Connect Manager (after magento installation) by logging to magento admin,  you will get 500 Internal Server Error.

You can also try this tool, it’s a magento cleanup utility. It will set the correct permissions for your complete magento installation:

  1. Download it
  2. Unzip magento-cleanup.php to the root directory of your magento installation
  3. Browse to http://yourdomain.com/magento/magento-cleanup.php

Solution #2

Your server does not support some of the magento specifications. You can easily test this using the magento check utility. Follow the steps below to check your server’s software, if there is an incompatibility this utility will show it.

  1. Download it
  2. Unzip magento-check.php to the root directory of your magento installation
  3. Browse to http://yourdomain.com/magento/magento-check.php

Solution #3

If you are getting weird 500 internal server errors on specific pages of your site, it might be a matter of resources. I was getting internal server erros on some product pages and on the http://yourdomain.com/checkout/onepage. I found out that the .htacess file of my magento installation was somehow reset and the php_value memory_limit value was set to 32M as soon as I raised it, the internal server errors vanished! You should use at least 256M for over 600-700 SKUs. Magento is very resource hungry and it is easy to get these kind of errors if you try to save some bucks from the hosting.

Solution #4

Htaccess file which is located at Magento root folder. It will be this case if you meet Internal Server Error on every page. Try to remove it for testing purpose
If your website was running file for a long time, then it must be a change at Server side, just submit a ticket to Hosting Company.

Solution #5 (Comment from Huberto)

If the curl extension is missing you can get 500 Internal server error. You can install it using the command below:
apt-get install curl libcurl3 libcurl3-dev php5-curl

SSL Installation on Directadmin

1) Go to Directadmin SSL certificate

create the SSL RSA Key

key

 

copy the RSA code to SSL certificate company field and submit.

you will get a email for approval the certificate,

check the email and click the link and approve it.

then you will get an email contain certificate for both SSL and CA root certificate.

1) open the SSL in directadmin, copy the SSL certificate and pasted it under the RSA key, save it

2) below it, there is “click here” to add the CA root certificate.copy from email and paste it to the CA Root certificate field  and check the top , save it.

use the SSL validation tools to check it.

====

In Magento side, please change the http to https in Secure https under configuration > Web

and enable it in front end to “YES”

Trouble shoot, if there is Blank page on the checkout page, here is how to fix it,

use SSH command,

1) remove the private _html

2) add the link by ssh command

ln -s public_html ./private_html

it will fix the problem

cheer!

Donny

 

=======

You’ll need to log onto SSH and navigate to your domains folder where your domain exists. Open the domain folder and rename the private_html folder (if it exists) to private_htmlbu or something like that.

Next execute this command:  ln -s public_html ./private_html

 

Linux CentOS 5.6 Installation Guide

Wow, it takes a whole day to prepare the CDs and install CentOS 5.6, here is a memory of how to do it,
– Making CDs
1) download the centOS from
http://isoredirect.centos.org/centos/5.6/isos/i386/
or
http://isoredirect.centos.org/centos/

download either 1/8 to 8/8 or whole one file

2) Make it to iso CD
– this is the most confused parts, finally figure it out,
use Simply Burns ( for Mac System) or you can try (Nero for Windows) to Burn it to ISO.
Select the files from download page, Open with Simply Burns, Burn it to ISO.

3) Use the First CD to start the server, use CD boot in server boot setup
4) 1-8 CD installation

Something need to write down
– Active httpd service
# service httpd start

– check httpd status
# service httpd status

– stop httpd service
# servide httpd stop

– NetCard setting
#ifconfig eth0 192.168.0.167 netmask 255.255.255.0 up
#ifconfig eth0:0 down
#ifconfig eth0:0 up
#/etc/sysconfig/network-scripts/ifcfg-eth0
#etc/resolv.conf
#etc/sysconfig/network

– Something config in ifcfg-eth0
DEVICE=eth0:0
BOOTPROTO=none
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.167
GATEWAY=192.168.0.1
ONPARENT=no
ONBOOT=yes

done

– YUM Installation
1) Install GNOME
#yum groupinstall “X Window System” “GNOME Desktop Environment”

2) Install Firefox
#yum list firefox
#yum install firefox_x86( as listed file name)

3) install chinese language package
#yum install “@Chinese Support”

Done

Or the good link for installation guide from site
http://www.howtoforge.com/installation-guide-centos5.1-desktop

linux配置文件共享服务器

前  言

  在我们使用 Windows 作为客户机的时候,通常有文件、打印共享的需求。作为Windows 网络功能之一,通常可以在 Windows 客户机之间通过 Windows Network 固有的功能实现这些要求。然而,通过 Samba 我们也可以让一台 CentOS 主机来兼容 Windows 网络,实现同样的功能,进而充分发挥 CentOS 主机的可用性。

  本篇文档主要介绍怎样通过 Samba 服务器的构建实现 Windows 网络中的文件共享。

安装 Samba

  首先,通过 yum 来在线安装 Samba 。

[root@sample ~]# yum -y install samba  ← 安装 Samba

Setting up Install Process
Setting up repositories
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 73 kB 00:00
update : ################################################## 212/212
Added 212 new packages, deleted 0 old in 4.94 seconds
primary.xml.gz 100% |=========================| 569 kB 00:00
base : ################################################## 1500/1500
Added 1500 new packages, deleted 0 old in 28.97 seconds
primary.xml.gz 100% |=========================| 157 B 00:00
Added 0 new packages, deleted 0 old in 0.03 seconds
primary.xml.gz 100% |=========================| 32 kB 00:00
extras : ################################################## 124/124
Added 124 new packages, deleted 0 old in 1.93 seconds
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for samba to pack into transaction set.
samba-3.0.10-1.4E.9.i386. 100% |=========================| 101 kB 00:00
—> Package samba.i386 0:3.0.10-1.4E.9 set to be updated
–> Running transaction check
–> Processing Dependency: samba-common = 0:3.0.10 for package: samba
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for samba-common to pack into transaction set.
samba-common-3.0.10-1.4E. 100% |=========================| 37 kB 00:00
—> Package samba-common.i386 0:3.0.10-1.4E.9 set to be updated
–> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
samba i386 3.0.10-1.4E.9 base 13 M
Installing for dependencies:
samba-common i386 3.0.10-1.4E.9 base 5.0 M

Transaction Summary
=============================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 18 M
Downloading Packages:
(1/2): samba-common-3.0.1 100% |=========================| 5.0 MB 00:04
(2/2): samba-3.0.10-1.4E. 100% |=========================| 13 MB 00:11
warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID 443e1821
Public key for samba-common-3.0.10-1.4E.9.i386.rpm is not installed
Retrieving GPG key from http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
Importing GPG key 0x443E1821 “CentOS-4 key
Key imported successfully
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: samba-common ######################### [1/2]
Installing: samba ######################### [2/2]
Installed: samba.i386 0:3.0.10-1.4E.9
Dependency Installed: samba-common.i386 0:3.0.10-1.4E.9
Complete!

配置 Samba

  然后,通过编辑 /etc/samba/smb.conf ,根据需求配置 Samba。在这里,本文的原则是只将文件共享应用于内网,并让将要被共享的目录拥有充分的读写权限属性。
[root@sample ~]# vi /etc/samba/smb.conf  ← 编辑 Samba 的配置文件

#======================= Global Settings =====================================
[global]   ← 找到这一行(全局设置标签),在此行下面添加如下行:

dos charset = GB2312  ← 将 Windows 客户端的文字编码设置为简体中文 GB2312
unix charset = GB2312  ← 指定 Samba 所在的 CentOS 服务端新建文件或目录时的编码为 GB2312
display charset = GB2312  ← 指定使用 SWAT(一种通过浏览器控制Samba的工具)时页面的默认文字编码
directory mask = 0777  ← 指定新建目录的属性(以下4行)
force directory mode = 0777
directory security mask = 0777
force directory security mode = 0777
create mask = 0777  ← 指定新建文件的属性(以下4行)
force create mode = 0777
security mask = 0777
force security mode = 0777

workgroup = MYGROUP  ← 找到此行,将工作组名称改为 Windows 网络所定义的工作组名
 ↓
workgroup = WORKGROUP  ← 变为此状态,这里以 Windows XP 默认的“WORKGROUP”为例

; hosts allow = 192.168.1. 192.168.2. 127.  ← 找到此行,去掉行首的“;”,并制定访问限制
 ↓
hosts allow = 192.168.0. 127.  ← 变为此状态,指定内网IP地址及本地,只允许这两种情况的访问

然后在配置文件的末尾填如下几行,定义公众共享目录:

[public]
comment = Public Stuff
path = /home/samba  ← 指定共享目录位置
public = yes
writable = yes  ← 赋予共享目录写入权限的属性

  接下来,创建将要通过 Samba 共享给 Windows 网络的专用目录。
[root@sample ~]# mkdir /home/samba  ← 建立共享文件专用目录

[root@sample ~]# chown -R nobody. /home/samba  ← 设置专用目录归属为 nobody

[root@sample ~]# chmod 777 /home/samba  ← 将专用目录属性设置为 777

  在进行到服务端的连接之前,需要预先对用于登录 Samba 的用户进行设置。这里我们以 CentOS 中 Samba 标准的 Samba 用户数据库管理工具“smbpasswd”为例,创建用于登录 Samba 的用户数据。这里需要注意的一点:用 smbpasswd 创建用户的前提是,系统用户中存在该用户 — 在基于系统用户之上,才可以创建该用户在 Samba 用户数据库中的信息。

[root@sample ~]# smbpasswd -a centospub  ← 将系统用户 centospub(例)加入到 Samba 用户数据库

New SMB password:  ← 输入该用户用于登录 Samba 的密码
Retype new SMB password:  ← 再次确认输入该密码
Added user centospub.

启动 Samba 服务

  在启动 Samba 服务之前,首先将防火墙设置中 Samba 所用到的端口进行开放。
[root@sample ~]# vi /etc/sysconfig/iptables  ← 编辑 iptables 配置文件

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 25 -j ACCEPT  ← 找到此行,在下面添加如下行:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 445 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp –dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp –dport 138 -j ACCEPT

[root@sample ~]# /etc/rc.d/init.d/iptables restart  ← 重新启动 iptables ,使新的规则生效
Flushing firewall rules:          [ OK ]
Setting chains to policy ACCEPT: filter   [ OK ]
Unloading iptables modules:       [ OK ]
Applying iptables firewall rules:      [ OK ]

  最后,启动 Samba 服务。
[root@sample ~]# chkconfig smb on  ← 设置 Samba 自启动

[root@sample ~]# chkconfig –list smb  ← 确认 Samba 启动标签,确认 2-5 为 on 的状态
smb 0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@sample ~]# /etc/rc.d/init.d/smb start  ← 启动 Samba 服务
Starting SMB services:       [ OK ]
Starting NMB services:       [ OK ]

从 Windows 客户端连接到 Samba 服务器

  在服务端启动 Samba 服务后,我们就可以从 Windows 客户端通过 Windows 网络连接到 Samba。这里以 Windows XP 为例,说明如下连接过程:

1、从桌面打开“网上邻居”,并点击“查看工作组计算机”选项;

2、确认出现 Samba 服务端的连接,并双击该连接;(本站文档的主机名以 Sample 为例)

3、输入在服务端预先设置好的 Samba 用户的用户名及密码;(用户名同系统用户名,密码需要输入在通过 smbpasswd 为该系统用户设置的 Samba 专用的密码。)

4、然后确认能够连接到 Samba 服务器,并出现根目录及 Samba 专用共享目录。

  最后,在相应目录进行新建、修改以及删除文件的操作,测试相应权限的可操作性