Tag: Summary

  • samba服务器Unable to connect to CUPS server localhost:631 – 拒绝连接

    拷大文件会段开

    tail -20 /var/log/messages

    解决办法如下:

    在smb.conf中对应位置加入,默认的load printers = yes,注意不要加错位置

    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes

    说明:
    When would you set the global parameter disable spoolss?

    Setting this parameter to Yes disables Samba’s support for the SPOOLSS set of MS-RPCs and yields behavior identical to Samba 2.0.x. Windows NT/2000 clients can downgrade to using LanMan style printing commands. Windows 9x/Me are unaffected by the parameter. However, this disables the ability to upload printer drivers to a Samba server via the Windows NT/200x Add Printer Wizard or by using the NT printer properties dialog window. It also disables the capability of Windows NT/200x clients to download print drivers from the Samba host on demand. Be extremely careful about setting this parameter.

    The alternate parameter use client driver applies only to Windows NT/200x clients. It has no effect on Windows 95/98/Me clients. When serving a printer to Windows NT/200x clients without first installing a valid printer driver on the Samba host, the client is required to install a local printer driver. From this point on, the client treats the printer as a local printer and not a network printer connection. This is much the same behavior that occurs when disable spoolss = yes.

    Under normal circumstances, the NT/200x client attempts to open the network printer using MS-RPC. Because the client considers the printer to be local, it attempts to issue the OpenPrinterEx() call requesting access rights associated with the logged on user. If the user possesses local administrator rights but not root privilege on the Samba host (often the case), the OpenPrinterEx() call fails. The result is that the client now displays an “Access Denied; Unable to connect” message in the printer queue window (even though jobs may be printed successfully). This parameter MUST not be enabled on a print share that has a valid print driver installed on the Samba server

  • 使用apache和subversion整合

    需求:可用浏览器打开svn查看,但使用tortoise提交需要认证

    管理员安装

    yum install mod_dav_svn subversion

    在/etc/httpd/conf.d/subversion.conf添加

    <Location /svn>
     DAV svn
     SVNParentPath /var/www/svn
     SVNListParentPath on
     AuthType Basic
     AuthName "Subversion repositories"
     AuthUserFile /etc/svn-auth-users
     <LimitExcept GET PROPFIND OPTIONS REPORT>
     Require valid-user
     </LimitExcept>
    </Location>

    上面的意思是都可以在浏览器里看到,但是svn提交需要认证

    添加svn认证用户

    ## Create testuser ##
    htpasswd -cm /etc/svn-auth-users testuser
    New password: 
    Re-type new password: 
    Adding password for user testuser

    添加一个svn库

    mkdir /var/www/svn
    cd /var/www/svn
    
    svnadmin create testrepo
    chown -R apache.apache testrepo
    
    chcon -R -t httpd_sys_content_t /var/www/svn/testrepo
    
    ## Following enables commits over http ##
    chcon -R -t httpd_sys_rw_content_t /var/www/svn/testrepo

    重启apache

    /etc/init.d/httpd restart

    这样打开浏览器就直接看到库的内容,而如果提交还需要认证。

    PS:如果全程认证,则把subversion.conf的Require valid-user从LimitExcept拿出来,并把LimitExcept去掉。

    从上述过程可以发现,svnserve一直没有开,用到的协议是http,如果用svn来控制权限,则是另外一回事了。

     

  • windows7下用l2tp vpn,连接错误789

    在windows7下用l2tp连接时,在选好配置

    l2tp/ipsec windows7

    连接错误789,如图:

    l2tp 789

    按下面的方法保存.reg文件,双击导入,重启电脑后可以连接

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters]
    "Medias"=hex(7):72,00,61,00,73,00,74,00,61,00,70,00,69,00,00,00,00,00
    "ServiceDll"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,\
     00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,\
     72,00,61,00,73,00,6d,00,61,00,6e,00,73,00,2e,00,64,00,6c,00,6c,00,00,00
    "IpOutLowWatermark"=dword:00000001
    "IpOutHighWatermark"=dword:00000005
    "ProhibitIpSec"=dword:00000001
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters\Quarantine]
    "Enabled"=dword:00000001
    "AutoRefreshEnabled"=dword:00000000
    "AutoRefreshTimeout"=dword:01808580
    "WorkItemTimeout"=dword:00000bb8

    上面的东西如ihipop所说,windows中l2tp与ipsec是一起的,上面的注册表将ipsec的保护给去掉了,显然不能满足要求。

    仔细检查,是/etc/ipsec.conf中left=127.0.0.1,这是不行的,需要换成公网ip。

    对应的,在/etc/ipsec.secrets中也将对应的127.0.0.1换成公网ip。

    配置方法参考:http://www.cnblogs.com/klobohyz/archive/2012/02/04/2338057.html

  • 可以使用Gigolo开机自动挂载samba

    在ubuntu下自动挂载可以用cifs,后来我发现用gigolo可以先连接到samba,永久记住密码,添加一个书签后选择开机自动连接。

    gigolo挂载

    gigolo书签

    gigolo开机挂载

    这样,在开机后自动挂载,很方便。还可以看到windows分区。

    感觉像windows里的资源管理器。

    这样办公用的libre office等可以直接保存到这些网络存储中。

  • chm 已取消到该网页的导航

    最常见的问题可以用下面的方法解决:
    在chm右键 解除锁定

  • 加大mysql的max_allowed_packet值

    今天在安装confluence的team calendars插件的时候,死活安装不上去,看日志文件提示

    Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4521890 > 1048576). You can change this value on the server by setting the max_allowed_packet’ variable.

    所以加大mysql的max_allowed_packet值

    可以编辑my.cnf来修改,在[mysqld]段或者mysql的server配置段进行修改。
    max_allowed_packet = 20M

    max_allowed_packet 参数的作用是,用来控制其通信缓冲区的最大长度
    如果找不到my.cnf可以通过

    mysql --help | grep my.cnf

    mysql根据配置文件会限制server接受的数据包大小。

    有时候大的插入和更新会被max_allowed_packet 参数限制掉,导致失败。

    查看当前配置

    show VARIABLES like '%max_allowed_packet%';

    显示的结果为:

    +——————–+———+
    | Variable_name | Value |
    +——————–+———+
    | max_allowed_packet | 1048576 |
    +——————–+———

    以上说明当前的配置是:1M

    后来改成20M,就成功安装了那个team calendars插件。