手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2013年02月18日的文章

How to Mounting FTP/SFTP volumes with the Finder

mac的finder不支持sftp连接服务器的.ftp是支持的.所以....问题一堆啊.

这不,网上有很多教程,有基于GUI的,有基于命令行的.

基于GUI的有两个教程,一个纯文字,一个有图版

我贴个纯文字的,然后有图版的请自己看,因为...转载图片很累啊

文字版来自  http://www.thxbye.de/mac/mac-mounting-ftpsftp-volumes-with-the-finder.html

have a server that only has FTP/SFTP/TLS support for accessing the files on it, which, in general, should be mostly sufficient. Now I’m using Mac OS X and Transmit/Yummy FTP for most of my tasks.

Since I’m a person who loves to have everything integrated into the standard GUI as good as possible I’ve been trying to find a solution for mounting directories/shares of that server straight into the finder, like you do with the iDisk or any other NFS/SMB/AFP share.

Unfortunately, the Finder itself only has read only FTP support (now I also know that FTP wasn’t made as a protocol for doing these kinds of things in the first place), which doesn’t get me too far actually, since every time I would want to upload/change a file I would need to start Transmit (or any other FTP client) and use the clunky non-embedded interface to manage the files, which is, for me at least, nowhere near satisfactory.

Sadly, after endless amounts of investigation and searching on google, I didn’t find a solution that works apart from “Use Transmit, it’s as close as you will get!”. I have tried everything that came onto my mind so far, even some very weird, exotic and just plain scary SSH tunnel workarounds, luck seems to avoid me though.

I found Google’s MacFUSE do to the job prettily, using a SSH filesystem (almost) works like a charm.

Download it and install, preferably compile it from the source, which is described in the Google Code HOWTO: code.google.com/p/macfuse/wiki/HOWTO

With the help of this you can basically mount SSH accounts as virtual volumes - and with the right parameters it even works in the Finder:

sshfs USERNAME@HOST:/DIR /MOUNTPOINT -oping_diskarb,volname=NAMEOFMOUNT ;

“USERNAME” being your SSH username;
“HOST” the SSH host;
“DIR” being the directory you want to mount;
“MOUNTPOINT” - you will need a mountpoint on your local filesystem, this should preferably be an empty directory. I just created empty directories in my home folder for that purpose (e.g. ~/mounts/orange);
“NAMEOFMOUNT” is the name of the volume as it will appear in the finger.

After entering this you should be prompted for the password of the SSH account, now, magically, you should have the volume appear in the Finder. Wee!

Now, the one and only real thing to make sure however is: Be aware that the Finder doesn’t like unstable connections - it will hopelessly beachball once the connection is interrupted unexpectedly for whatever reason.

有图版的来自 http://docs.ocf.berkeley.edu/wiki/SFTP_mount_in_Mac_OS_X

当然,这里还有一篇是命令行下怎么处理的,不过还得下载一个软件....

请看:http://www.danbishop.org/2011/09/10/how-to-mount-sftp-ssh-shares-in-os-x-lion/

他也介绍了macfusion,所以我贴了那段用命令行的:

 

If you’d like to use an sftp share directly though finder then this guide is for you.

First, you need to install OSXFuse from https://github.com/osxfuse/osxfuse/downloads

If you’re using OS X 10.8 (or above…) use the default install options and skip down to the Mountain Lion section now.

At the “Installation Type” stage, be sure to select MacFUSE Compatibility Layer. It’s unticked by default.

Once installed, you need to get Macfusion from http://macfusionapp.org/

Perform the usual drag and drop into your Applications folder then run Macfusion.

Add a new Macfusion share by clicking on the plus icon and selecting SSHFS, enter your details, click ok, then mount. After a few moments your share will be available. You can press cmd+r to show your share in the Finder.

You can now directly edit files on the sftp share using any app on your mac without the need to manually download and re-upload them.

If this process does not work for you, try restarting your mac, then re-adding the Macfusion share.

OS X Mountain Lion

Unfortunately Macfusion doesn’t work well with Mountain Lion (OS X 10.8). You can, however, still mount directories using the command line (Terminal).

First we need to download, then install sshfs: https://github.com/downloads/osxfuse/sshfs/SSHFS-2.4.1.pkg

Run through the installer with the default options.

Now create an empty directory to mount your sftp share in, for example:

dan@dans-imac:$ mkdir /Users/dan/sshfs

Then run the following:

dan@dans-imac:$ sshfs username@serveraddress:/path/to/remote/folder /Users/dan/sshfs

Navigate to /users/dan/sshfs in Finder and you’ll have access to your sftp share.

----EOF---

自此,方便了很多..smb有时候不太稳定,我感觉...好纠结

如何避免网站维护时被搜索引擎“误解” (二)

昨天写了一个用header处理跳转,防止被搜索引擎误解的方法,其实就是301和302的关系.今天要转载一篇相对处理方法较多,且更实用的方法

原文来自:http://www.eamonning.com/blog.php?id=309

回到主题,有些网站常常因为需要进行常规维护或者因为某些原因(黑客)而不得不临时关闭,如果用户或者搜索引擎在这个时候访问临时关闭的网站,这将会影响网站的声誉或者排名流量。因此做好网站临时关闭的一些工作。  

  下面我将教大家怎么处理好网站临时关闭时跟用户还有搜索引擎的一些三角关系!  

  让用户与蜘蛛知道网站正在维护

  当一家餐厅的老板,因为某些原因不得不临时关闭餐厅,老板会在餐厅门口贴公告,告知顾客餐厅临时关闭以及恢复营业的时间,这样顾客就不会误以为 餐厅倒闭,而不再次光临。同样的道理也可以套用在网站上,如果一个网站因为某些原因必须临时关闭,那么站长有责任通知蜘蛛还有用户,并告知恢复的时间,这 样蜘蛛还有用户才会再次访问网站,而不是误以为网站已经永久关闭。

  网络的世界比较复杂,因此告知用户与蜘蛛是一名艺术,下面我们列举两个站长朋友经常犯的错误。  

  错误一,网站关闭没有告知

  有些网站没有做好告知工作,随随便便就把网站关闭,导致用户以及蜘蛛访问时,显示404页面。

大小: 9.46 K
尺寸: 500 x 173
浏览: 1244 次
点击打开新窗口浏览全图

  最糟的情况是,用户以及蜘蛛会误以为网站已经倒闭,而不会再次光临,就跟餐厅一样,关门,没有贴公告,同样的其顾客会以为餐厅已经倒闭了,下次不会再来了。

  错误二,单一页面告知  

  有些站长则会制作一个单一页面,告知用户网站正在维护,并将全站其他的页面都指向这一页面。

  这也是非常不智的行为,因为这样做只告知了用户,而没有通知蜘蛛,这样蜘蛛只会以为其他页面被删除了,只剩下这个页面。

  我们先复习下几个最常碰到的HTTP状态码  

  1. 200 - 服务器成功返回网页
  2. 301- 请求的网页已永久移动到新位置。当URLs发生变化时,使用301代码。搜索引擎索引中保存新的URL。  
  3. 302 -请求的网页临时移动到新位置。搜索引擎索引中保存原来的URL。  
  4. 404 - 请求的网页不存在  
  5. 503 - 服务器目前无法使用(由于超载或停机维护)。通常,这只是暂时状态。  

  如何告知用户以及蜘蛛网站正在维护?  

  如果我们网站临时关闭,必须告知用户以及蜘蛛,让用户跟蜘蛛知道网站只是临时关闭,而不是永久关闭,这样用户跟蜘蛛就会隔断时间再次访问网站,具体做法是创建一个返回503状态的文件。  

  1. 创建一个503.php的文件,并把它放到服务器的根目录 

PHP代码
  1. <?php    
  2.   
  3.   header("HTTP/1.1 503 Service Temporarily Unavailable");    
  4.   header("Status: 503 Service Temporarily Unavailable");    
  5.   header('Retry-After: Sat, 8 Oct 2012 18:27:00 GMT");   
  6. ?>   
  7.  
  8.   <!DOCTYPE HTML>   
  9.   <html>   
  10.   <head>   
  11.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
  12.   <title>网站名称</title>    
  13.   </head>     
  14.   <body>    
  15.   <h1>网站名称</h1>    
  16.   <p>网站维护中</p>    
  17.   <p>将于2012/10/8恢复</p>     
  18.   </body>     
  19.   </html>    

  第一二句告知搜索蜘蛛网站处理暂时关闭状态,第三句告知搜索蜘蛛,网站将于2012年10月8日18:27从新开放,注意:这里用的是格林威治标准时间。  

  但是光放一个503信息到服务器里还是不够的,蜘蛛会访问网站不同的页面,因此我们必须引导所有的蜘蛛到503.php这个页面,让蜘蛛知道,整个网站处于临时关闭中,而不是个别页面。  

  如果站长使用的是Apache/Linux服务器,我们只需在.htaccess设置一下,引导所有的蜘蛛到505.php页面,这里我们要使用302跳转,注意:在这里千万不要使用301跳转,因为301是永久的,在这种情况下会毁灭掉整个网站。  

  2.引导蜘蛛到503.php  

  将下面这段代码保存到.htaccess文件,并上传到网站根目录

XML/HTML代码
  1. Options +FollowSymLinks    
  2.   RewriteEngine On    
  3.   RewriteBase /    
  4.   RewriteCond %{REMOTE_ADDR} !^00.00.00..00    
  5.   RewriteCond %{REQUEST_URI}!^/503.php [NC]    
  6.   RewriteRule ,* /503.php [R,L]    

  最后一行的[R, 告知蜘蛛,这个是302跳转,属于暂时的。

  这样我们就完成了网站临时关闭的部署,可以放心关站了!

---EOF---

上述的方法其实会更实用一些,关于nginx,就不仔细写了nginx其实还更方便呢...

 

 

Tags: header, robot, searchengine