APACHE虚拟主机

299阅读 0评论2011-06-16 root_zhang
分类:LINUX

APACHE虚拟主机

配置文件
/etc/httpd/conf/httpd.conf
      NameVirtualHost 172.25.0.1 指明主机
 
    DocumenRoot /网页存放路径
    ServerName  station1.example.com
 
 
主页存放
/var/www/html/
service httpd restart    service httpd reload

用户认证
vim /etc/httpd/conf/httpd.conf
 
      Allowoverride all
      Authtype  Basic   验证类型
      Authname    ttt   验证名字
      Authuserfile  /etc/httpd/conf/.htpasswd    认证密码文件位置
      require valid-user   xm   有效用户
  

     htpasswd -cm /etc/httpd/conf/.htpasswd + 用户
访问控制
    
      Allowoverride all
       Order allow,deny
        deny form all
        Allow  form   192.168.1.0/24
        Allow  form    .example.com
    

        * allow > deny
网页加密

/etc/httpd/conf.d/ssl.conf      // 配置文件

genkey  station.example.com     //生成证书
   Couny Name (letter code)  国家代码
              (full name)   省名
              (e.g. city)   城市
             (eg. company)  公司名
             (eg. section)  部门/组织单元
            ( domain name)  网页全域名  
   [*] 是否加密私钥

私钥存放 /etc/pki/tls/certs/
公钥存放  /etc/pki/tls/private/

修改配置文件将默认的公钥,私钥更改为生成后的钥匙名!
  server httpd reload
上一篇:DNS域名解析服务
下一篇:VSFTP服务/ ip访问控制