Linux

Linux下禁用、启用SeLinux

一些Linux默认都是启用SeLinux的,在安装操作系统的时候我们可以选择开启或者关闭SeLinux,但是在安装完系统之后又如何开启与关闭呢? 在/etc/sysconf下有一个SeLinux文件,使用vi打开,更改其中的SELINUX项的值就可以了。 SELINUX=disable 禁用SeLinux SELINUX=enforcing 使用SeLinux 关闭SELinux 1. 无须重起而暂时关闭SELinux 以root用户运行以下命令 [code]# setenforce 0[/code] 这条命令的作用是把SELinux暂时设定成Permissive模式(关于Permissive Mode在以下会有介绍) 如果要恢复运行SELinux则可以运行 [code]# setenforce 1[/code] 这条命令会把SELinux设定成Enforcing模式 2. 把SELinux永久设定为Permissive模式 这里需要讲一下Permissive和Enforcing模式的区别。 SELinux有...

.htaccess not working on apache web server

Q: I already enabled mod_rewrite in httpd.conf file on apache server, but .htaccess configuration is not working at all. How can i fix this problem? A: Make sure AccessFileName set to .htaccess Search httpd.conf for AccessFileName directive. It defines name of the distributed configuration file: [code] # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. # AccessFileName .htaccess [/...

How to get List of Groups in Linux

[code]less /etc/group[/code] or [code]more /etc/group[/code]

How to set up A Records and MX Records

URL FORWARDING RECORDS HOST NAME TYPE DATA yourdomain.com Forward (F) http://www.someplace.com www.yourdomain.com Forward (F) http://www.someplace.com URL Forwarding records are used to redirect domains to another URL. A common purpose is to point a domain to a website or page hosted elsewhere which usually has a longer URL such as http://www.myispsite.com/~myname.html. Keep in mind that the DATA part of the forwarding record must be a complete URL like...

Search for text in vi or vim

vi and vim have powerful searching capabilities because they bring to bear the richness of regular expressions. To search for the next occurence of the text ‘maybe’ from the current cursor position, type: [code] /maybe [/code] Search backward from the current position by using ? instead of / in the command. Once you have searched for something, you can find the next occurrence by pressing n or the previous occurrence with N. Searching in vi/vim is enhanced with regular expre...

How to excluding directories when zip files on Linux

All you needs is use the -x switch and list the files and directories to be excluded, separated by spaces. For example: [code] zip -r filename.zip directory -x directory/folderA\* directoryr/folderB\* [/code]