centos 6.3 最小安装系统下快速搭建环境步骤分享

centos 6.3 最小安装系统下快速搭建环境步骤分享

1,初始化系统环境  完成系统根新,gcc编译环境,php安装依赖,系统内核优化 代码如下:lokkit --disabled --selinux=disabled yum update -y yum install -y telnet wget rsync subversion patch    yum install -y system-config-network-tui yum install -y bind-utils yum install -y vim-enhanced yum install gcc gcc-c++ make automake autoconf -y yum install curl-devel libmcrypt-devel gd-devel libjpeg-devel libpng-devel libXpm-devel libxml2-devel libxslt-devel mhash-devel openssl-devel -ycat >> /etc/sysctl.conf <<EOF
centos最小化安装系统后的基本调优及安全设置

centos最小化安装系统后的基本调优及安全设置

清理开机自动启动的服务显示出所有服务的所有运行级别的启动状态#chkconfig Clist停止所有在运行级别3上开机启动的服务#for oldboy in `chkconfig Clist |grep 3:on |awk ‘{print $1}'`;do chkconfig Clevel 3 $oldboy off;done在开启常用的服务,crond,network,rsyslog,sshd#for oldboy in crond network rsyslog sshd;do chkconfig Clevel 3 $oldboy on;done显示出所有3运行级别下的所有服务(根据需求决定哪个服务启动)#chkconfig Clist |grep 3:on
apache服务器全局配置详解(全)

apache服务器全局配置详解(全)

Apache服务器全局配置之服务器标识配置篇 服务器标识相关指令:ServerNameServerAdminServerSignatureServerTokensUseCanonicalNameUseCanonicalPhysicalPortServerAdmin和ServerTokens指令控制有关服务器的哪些信息将出现在服务器生成的文档中(如错误消息)。ServerTokens指令设置服务器HTTP响应头字段的值。ServerName、UseCanonicalName、 UseCanonicalPhysicalPort指令用来决定怎样构建自引用URL,譬如,某客户端对一个目录发出请求,但没有包含目录名最后的斜线"/",Apache将重定向客户端到包含"/"的全名,以使客户端可以正确解析文档中的相对引用。ServerName指令语法:ServerName [scheme://] FQDN [:port]这个指令用来设置服务器用于辨识自己的主机名和端口号。主要用于创建重定向URL。例如,你的web服务器的主机名为example.bob.com,但你的web服务器同时在DNS服务器中拥有一个DNS别名www.bob.com。而你希望web服务器更显著一点,你可以在http.conf中使用ServerName指令来实现:ServerName www.bob.com:80当没有指定ServerName时,服务器会尝试对IP地址进行反向查询来推断主机名。如果在ServerName中没有指定端口号,服务器会监听所有端口。为了加强可靠性和可预测性,应该使用ServerName显示的指定一个主机名和端口号。如果使用的是基于域名的虚拟主机,在<VirtualHost>段中的ServerName将是为了匹配这个虚拟主机,在“Host:”请求头中必须写主机名。ServerAdmin指令语法:ServerAdmin email-address|URL这个指令用来设置服务器返回给客户端的错误信息中包含的管理员邮件地址。便于用户在收到错误信息后能及时与管理员取得联系。
windows apache多端口虚拟主机配置方法

windows apache多端口虚拟主机配置方法

1、打开httpd.conf,查找Listen:80,在下面一行加入Listen:8080;2、查找#Include conf/extra/httpd-vhosts.conf,将此行前面的#去掉;3、打开httpd.conf文件目录下面的extra文件夹下面的httpd-vhosts.conf文件;4、查找NameVirtualHost *:80,在下面一行增加NameVirtualHost *:8080;5、复制httpd-vhosts.conf文件最下面的如下代码,并且在下面粘贴一份: 代码如下:<VirtualHost *:80>          ServerAdmin webmaster@dummy-host.abc.com          DocumentRoot "G:PHP"          ServerName dummy-host.abc.com          ServerAlias www.dummy-host.abc.ccom          ErrorLog "logs/dummy-host.abc.com-error.log"          CustomLog "logs/dummy-host.abc.com-access.log" common      </VirtualHost>      <VirtualHost *:80>          ServerAdmin webmaster@dummy-host2.abc.com          DocumentRoot "G:PHP"          ServerName dummy-host2.abc.com          ErrorLog "logs/dummy-host2.abc.com-error.log"          CustomLog "logs/dummy-host2.abc.com-access.log" common      </VirtualHost>
You don’t have permission to access /index.php on.

You don’t have permission to access /index.php on.

今天在测试 PHP集成环境 Apache服务器时,一切正常,在转换虚拟目录时,突然出现错误提示“You don't have permission to access /index.php on.“无论如何都不能正常浏览,再切换回原目录时,显示正常,只要切换虚拟目录,问题依旧。 其实这里是由于 httpd-conf 里面的配置问题,打开httpd-conf:逐行检查。在大约快一半的地方有以下这段代 ···
Linux下SFTP用户权限设置条件及实现命令

Linux下SFTP用户权限设置条件及实现命令

众所周知SFTP账号是基于SSH账号的,所以在默认情况下访问服务器的权限是非常大的,今天的教程就是教大家进行SFTP用户权限设置。 必要条件: 你的openssh-server版本至少得失4.8p1, 因为配置权限需要版本添加的新配置项ChrootDirectory来完成。 如何查看自己服务器上的ssh版本?大家可以尝试以下命令: $ ssh -V 具体实施步骤: 1. 我们需要创建一个用户组,专 ···
apache设置自动将http跳转到https的方法

apache设置自动将http跳转到https的方法

代码如下:<Directory "/opt/fivetrees">## Possible values for the Options directive are "None", "All",# or any combination of:#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews## Note that "MultiViews" must be named *explicitly* --- "Options All"# doesn't give it to you.## The Options directive is both complicated and important.  Please see# http://httpd.apache.org/docs/2.2/mod/core.html#options# for more information.#Options FollowSymLinks## AllowOverride controls what directives may be placed in .htaccess files.# It can be "All", "None", or any combination of the keywords:#   Options FileInfo AuthConfig Limit#AllowOverride All #这里原先是None要改为All## Controls who can get stuff from this server.#Order allow,denyAllow from all</Directory>
apache虚拟主机配置一例

apache虚拟主机配置一例

代码如下:fivetrees extra # cat httpd-vhosts.conf_bak## Virtual Hosts## If you want to maintain multiple domains/hostnames on your# machine you can setup VirtualHost containers for them. Most configurations# use only name-based virtual hosts so the server doesn't need to worry about# IP addresses. This is indicated by the asterisks in the directives below.## Please see the documentation at# <URL:http://httpd.apache.org/docs/2.2/vhosts/># for further details before you try to setup virtual hosts.## You may use the command line option '-S' to verify your virtual host# configuration.## Use name-based virtual hosting.#NameVirtualHost *:80#NameVirtualHost *:443## VirtualHost example:# Almost any Apache directive may go into a VirtualHost container.# The first VirtualHost section is used for all requests that do not# match a ServerName or ServerAlias in any <VirtualHost> block.##<VirtualHost 192.168.1.66>#        RewriteEngine On#        RewriteMap      lowercase       int:tolower#        RewriteMap      vhost   txt:/usr/local/apache/conf/host.txt#        RewriteCond     %{HTTP_HOST}    !^$#        RewriteCond     ${lowercase:%{HTTP_HOST}|NONE}  ^(.+)$#        RewriteRule     ^/(.*...)$ ${vhost:%1...}/$1#</VirtualHost><VirtualHost *:80>        DocumentRoot /opt/all_dir        ServerName *</VirtualHost><VirtualHost *:80>        DocumentRoot /opt/1        ServerName 1.com</VirtualHost><VirtualHost *:80>        DocumentRoot /opt/2        ServerName 2.com</VirtualHost>
如何关闭http Methods中的Trace 提高安全意识

如何关闭http Methods中的Trace 提高安全意识

使用Nikto测试服务器,发现HTTP开启了trace方法。 TRACE和TRACK是用来调试web服务器连接的HTTP方式。 支持该方式的服务器存在跨站脚本漏洞,通常在描述各种浏览器缺陷的时候,把"Cross-Site-Tracing"简称为XST。 攻击者可以利用此漏洞欺骗合法用户并得到他们的私人信息。 解决: 禁用这些方式。 在配置文件http.conf 添加 TraceEnable off ···
让Apache支持cgi、SSI、shtml的配置方法

让Apache支持cgi、SSI、shtml的配置方法

1.首先明确,只能够指定某个确定的目录,支持cgi,即运行该目录执行cgi程序;否则不太安全。寻找: 代码如下:    #    # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased    # CGI directory exists, if you have that configured.    #    <Directory "E:/Website_Field/cgi">        AllowOverride all        Options all        Order allow,deny        Allow from all    </Directory>