apache order Deny,Allow 含义

Posted 3 months, 3 weeks ago at 5:27 pm. 0 comments

apache Order Deny 的配置
2007年12月28日 星期五 上午 09:57
Allow和Deny可以用于apache的conf文件或者.htaccess文件中(配合Directory, Location, Files等),用来控制目录和文件的访问授权。

所以,最常用的是:
Order Deny,Allow
Allow from All

注意“Deny,Allow”中间只有一个逗号,也只能有一个逗号,有空格都会出错;单词的大小写不限。

上面设定的含义是先设定“先检查禁止设定,没有禁止的全部允许”,而第二句没有Deny,也就是没有禁止访问的设定,直接就是允许所有访问了。这个主要是用来确保或者覆盖上级目录的设置,开放所有内容的访问权。

按照上面的解释,下面的设定是无条件禁止访问:
Order Allow,Deny
Deny from All

如果要禁止部分内容的访问,其他的全部开放:
Order Deny,Allow
Deny from ip1 ip2
或者
Order Allow,Deny
Allow from all
Deny from ip1 ip2

apache会按照order决定最后使用哪一条规则,比如上面的第二种方式,虽然第二句allow允许了访问,但由于在order中allow不是最后规则,因此还需要看有没有deny规则,于是到了第三句,符合ip1和ip2的访问就被禁止了。注意,order决定的“最后”规则非常重要,下面是两个错误的例子和改正方式:

Order Deny,Allow
Allow from all
Deny from domain.org
错误:想禁止来自domain.org的访问,但是deny不是最后规则,apache在处理到第二句allow的时候就已经匹配成功,根本就不会去看第三句。
解决方法:Order Allow,Deny,后面两句不动,即可。

Order Allow,Deny
Allow from ip1
Deny from all
错误:想只允许来自ip1的访问,但是,虽然第二句中设定了allow规则,由于order中deny在后,所以会以第三句deny为准,而第三句的范围中又明显包含了ip1(all include ip1),所以所有的访问都被禁止了。
解决方法一:直接去掉第三句。
解决方法二:
Order Deny,Allow
Deny from all
Allow from ip1

Popularity: 14% [?]

No tag for this post.

什么是 Maemo

Posted 4 months ago at 3:23 am. 0 comments

诺基亚的开源linux平台。

Maemo is an open source development platform to create applications for Nokia Internet Tablet products like Nokia N800 and Nokia 770. The platform gives developers a powerful Linux based development environment and optimized end-user interface for handhelds.

Popularity: 19% [?]

Tags: ,

安装使用 ubuntu 8.04 的几个体会

Posted 4 months ago at 7:36 pm. 0 comments

ubuntu 8.04 出来一些天了吧,我不是升级而是全新安装(原来的mintLinux已经被我使用得支离破碎了),个人体验如下:

1.安装8.04 中文,默认是 firefox 3.0 beta 繁体,比较郁闷,大部分 firefox addons 无法安装。google 也是直奔 .tw,不是很爽。
2.我的无线网卡直接就装好了,不用再自己去找了。
3.以前笔记本插上耳机,喇叭也出声音的问题解决了。
4.直接加入了 compiz 等视觉效果,打开很方便。
5.很多商业、版权软件的也至少给出了一些提示、向导。是啊,你可以卖菜刀,但你不能决定人家是否用来砍人。
6.默认貌似就是wqy黑体,还可以,虽然我还是装了 wqy宋体。
7.死机多了。一周之内,dosbox 玩游戏死机3次,浏览器死机2次,是那种完全的死机,难道我的本本主板又快不行了?但此期间,mintlinux 或者 windows 都没有死机。
8.原来hp笔记本特有的插上DC电源启动,就没有声音的问题似乎也解决了。

人总是要向前看,不管你愿不愿意,这个世界不会停下开等你。8.04总得来说还不错…

Popularity: 14% [?]

No tag for this post.

同步windows和ubuntu下firefox的配置文件

Posted 4 months ago at 7:00 pm. 0 comments

办法一:

lifehack 说了个<a href=”http://lifehacker.com/software/hack-attack/sync-your-firefox-extensions-and-profiles-across-computers-272113.php”>Sync your Firefox extensions and profiles across computers</a>

用 firefox 的 FolderShare 插件把配置文件放在一个固定的地方,然后win和ubuntu下的firefox都去读这个配置。

办法二:

还有人 <a href=”http://lxjunkie.blogspot.com/2008/01/making-firefox-portable-even-more.html”>Making Firefox Portable Even More Portable</a> 这样搞:

firefox -ProfileManager

建立一个新的配置文件,然后

ln -s /home/[username]/.mozilla/firefox/profiles/[profname] [path to firefox portable install]/Data/profile

把这个配置文件和windows下的 portable firefox 做个符号连接。

这样,两边(win下或者ubuntu下使用firefox,配置文件也是同步的)

办法三:

我老人家临时的办法,直接

wine firefoxPortable所在目录/FirefoxPortable.exe

还没有长时间使用,可能会有问题,毕竟是wine啊。

Tags:

Popularity: 16% [?]

Tags: ,

有效使用linux的7个好习惯

Posted 4 months, 2 weeks ago at 1:09 am. 0 comments

不用使用root登录,原因:

  1. Well imagine you’re on the trapeze without a safety net,
    frightening isn’t it? Well that’s effectively what you are doing when
    you login as root, you can inadvertently hose your whole system
  2. You are at the risk of running malware. Any program that is started under root mode will automatically be given root privileges
  3. If there is a common security hole that hasn’t been patched yet, you could be totally “pwned”
  4. It’s common Unix convention, never run anything in root
    mode unless absolutely necessary. If a non-admin program asks for root
    access, you should be suspicious

尽量使用 su,sudo,gksu,kdesu

  • Use “sudo” or “su” , and kill the session when your done
  • If you don’t know how to do it in the command line, use “gksu” or “kdesu”. For example, press alt+f2 and type “gksu nautilus“. Close the app as soon as you finish

注意文件命名

  • As a rule of thumb, only use alphanumeric characters, hyphens, periods, and underscores
  • Avoid special symbols like dollar signs, brackets, and
    percentages. These symbols have special meanings to the shell, and
    could cause conflicts
  • Avoid using spaces, handling files with spaces in the
    terminal is kind of awkward. Replace spaces with either hyphens or
    underscores

把 /home 放在不同的分区

杀死崩溃进程

  1. I have the “force quit” applet on my taskbar, if any app
    starts to act up just click on the “force quit” icon and then kill the
    app
  2. If that doesn’t work, draw up a terminal and type “ps -A” , and take note of the Process ID (PID) of the culprit app, then kill it. “kill PID”
  3. Use the “killall” command, for example, “killall firefox-bin”
  4. If your whole GUI is frozen, and drawing up a terminal is
    impossible, then press CTRL-ALT-F1, this will take you to another
    terminal, and virtually a whole new session. From there kill the
    culprit app using step 2 and 3.
  5. If that doesn’t work, you might want to restart your GUI
    using the CTRL-ALT-Backspace combo. Beware, that this will kill all
    your GUI apps currently running
  6. Invoke CTRL-ALT-F1 and do CTRL+ALT+DEL from here. This
    will not instantly reset your system, merely perform a standard reboot,
    it’s safe. (Assuming you want to restart and CTLR-ALT-F1 works)
  7. Finally if nothing works, don’t rush to the hard reset button, try to Raise a Skinny Elephant

体验不同的发行版

via http://hehe2.net/linux-general/the-7-habits-of-highly-effective-linux-users/

Popularity: 17% [?]

No tag for this post.

linux shell 技巧

Posted 4 months, 3 weeks ago at 2:44 am. 0 comments

apropos ls

显示 ls 的相关信息

man -t ls | ps2pdf -> ls.pdf

输出 ls 手册为 postscript 然后转成 pdf

which ls

显示 ls 的完整路径

time ls 执行 ls 然后输出执行的时间

alias l=’ls -l’

定义 ls 别名,l 即可执行 ls -l 命令

cd -

回到刚才的目录

cd

进入 home 目录(等同于 cd ~)

cd 目录 && ls -l

进入“目录”,执行 ls -l 命令,然后返回当前目录

find -type f ! -perm -444

查找所有权限 444 以下的文件(不可读)

ls | pr -T9

9列显示

look fire

快速搜索字典中 fire 开头的单词

grep –color fire /usr/share/dict/words

在字典中高亮显示包含 fire 的单词

gpg -c file
gpg file.gpg

加(解)密文件

dd bs=1M if=/dev/sda | gzip | ssh user@remote ‘dd of=sda.gz’

备份硬盘数据到远程 ssh 主机

ssh -f -Y USER@HOSTNAME firefox

以 USER 身份登录 HOSTNAME 主机打开 GUI 程序(firefox)

wget -r -nd -np -l1 -A ‘*.jpg’ http://www.example.com/dir/

下载 http://www.example.com/dir/ 目录中的所有 jpg 图片(如果服务器允许目录浏览的话,否则返回 403 forbidden 错误)

wget –limit-rate=20k http://111.com

限制 wget 下载速度 20k/s

smbtree

寻找局域网中的 windows 主机

nmblookup -A 192.168.100.1

解析目标机器的 NetBIOS 名、组等

smbclient -L 192.168.100.97

查看 windows 主机的共享目录

mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/share

挂接windows共享目录

Popularity: 24% [?]

Tags: ,

Ubuntu的5个技巧

Posted 5 months ago at 8:45 pm. 0 comments

安装 mp3,解码器和 java,flash插件

sudo apt-get install ubuntu-restricted-extras

安装 w32codecs

http://phorolinux.com/how-to-install-non-free-multimedia-codecs-on-ubuntu-710-gutsy-gibbon.html

安装 CompizConfig Settings Manager

sudo apt-get install compizconfig-settings-manager

安装 Opera 9.24

If you’re want to install Opera 9.24, you can use commercial repository for Ubuntu 7.10.

sudo gedit /etc/apt/sources.list

Add this line:

deb http://archive.canonical.com/ gutsy partner

After save file, run these commands:

sudo apt-get update
sudo apt-get install opera

ubuntu 系统清理

sudo apt-get autoclean
sudo apt-get clean

或者

sudo apt-get autoremove

Tags:

Popularity: 18% [?]

No tag for this post.

用 PlayOnLinux 玩 Windows 游戏

Posted 5 months ago at 8:16 pm. 0 comments

PlayOnLinux,Python编写的开源前端脚本,可以帮助你安装和玩上许多 Windows-only游戏。PlayOnLinux的核心就是Wine,但Wine是命令行程序,而PlayOnLinux则以图形化界面让你更易于 操作各种选项。PlayOnLinux还提供许多游戏脚本仓库,让游戏安装更轻松。

Tags:

Popularity: 20% [?]

No tag for this post.

开源的PHP论坛:SMF

Posted 5 months ago at 8:15 pm. 0 comments

SMF 为加拿大 Simple Machines Forum 的简称。简练,效率,强大,免费。 SMF 就是上面的集合体。
SMF 是下一代论坛和充满了前景的软件,同时又只消耗很少的服务器资源。当然,这都是免费的。基本特性为:全面的风格,超快数据库,安全的附件机制,自动化组件安装。

http://download.simplemachines.org/

Tags:

Popularity: 19% [?]

No tag for this post.

WinSCP - SSH协议文件传输软件

Posted 5 months ago at 8:13 pm. 0 comments

WinSCP 是一个支持SSH(Secure SHell)的SCP(Secure CoPy)文件传输软件.只要文件主机支持SSH协定,你就可以安心的下载、上传文件.它的操作界面是参考NC(Norton Commander)的双视窗排列方式,使用起来不会有太大的困难.在WinSCP中,一般的文件操作都没有问题,如:复制、移动、更名文件或文件夹等.

http://prdownloads.sourceforge.net/winscp/winscp410setup.exe

Tags:

Popularity: 18% [?]

No tag for this post.

ad 468x60