GVKun编程网logo

centos – 如何为LAN中的客户端计算机创建Yum Cache Server(centos创建yum源)

2

以上就是给各位分享centos–如何为LAN中的客户端计算机创建YumCacheServer,其中也会对centos创建yum源进行解释,同时本文还将给你拓展asp.net–如何从Web应用程序中的客

以上就是给各位分享centos – 如何为LAN中的客户端计算机创建Yum Cache Server,其中也会对centos创建yum源进行解释,同时本文还将给你拓展asp.net – 如何从Web应用程序中的客户端计算机获取AD凭据?、CentOS - 搭建yum源、CentOS 6.4 上通过 yum 安装 Nagios-3.5.0 [服务端 /server 端]、CentOS 6.8上编译安装ApacheHttpServer等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

centos – 如何为LAN中的客户端计算机创建Yum Cache Server(centos创建yum源)

centos – 如何为LAN中的客户端计算机创建Yum Cache Server(centos创建yum源)

像在Ubuntu中一样,我们可以选择创建“Ubuntu更新缓存服务器”,它直接从Internet下载和更新软件包,并为其他客户端ubuntu机器提供安装/更新软件包.对于基于RHEL的分发(Centos,fedora),我们可以创建“更新缓存服务器”,它可以从Internet填充包并在本地提供给局域网中的客户端机器.也像ubuntu一样,缓存服务器可用于所有版本的centos,fedora等.
有几种方法可以实现这一目标.

最简单的选择是创建一个缓存代理服务器,例如squid,客户端可以配置为用于连接via.一旦客户端下载了一个包,其余的客户端将从squid缓存中收集包,而不是直接从存储库下载.

YUM网站lists several options,其中通过同步来自远程镜像的包文件来创建缓存,其中大多数都需要大量配置和磁盘空间来维护.

asp.net – 如何从Web应用程序中的客户端计算机获取AD凭据?

asp.net – 如何从Web应用程序中的客户端计算机获取AD凭据?

是否可以从Web应用程序中为客户端计算机上的用户获取Activedirectory凭据?

为了澄清,我正在设计一个将在客户的Intranet上托管的Web应用程序.

需要在访问应用程序时不提示应用程序的用户提供凭据,而是应该自动抓取登录到客户端计算机的用户的凭据,而无需用户交互.

解决方法

绝对.这对于Intranet应用程序尤其有用.

既然你没有指定你的环境,我会假设它是.NET,但这当然不是唯一可行的方法.

可以使用LDAP轻松查询Active Directory.如果您使用的是.NET,则可以执行类似于this code example或以下示例的操作.您也可以在SQL environments内完成.

如果您只需要Windows来处理身份验证,则可以设置例如0700的.NET Web应用程序.确保在IIS中为您的应用程序设置turn off Anonymous Logins.完成后,您将能够访问用户的Windows登录名并使用它进行进一步的安全检查(例如,他们在AD中的group/role membership).

您还可以使用Enterprise Library的Security Application Block来简化整个混乱.

这是一个简短的C#示例:(转换为VB.NET here)

using System.DirectoryServices;

/// <summary>
/// Gets the email address,if defined,of a user from Active Directory.
/// </summary>
/// <param name="userid">The userid of the user in question.  Make
/// sure the domain has been stripped first!</param>
/// <returns>A string containing the user's email address,or null
/// if one was not defined or found.</returns>
public static string GetEmail(string userid)
{
    DirectorySearcher searcher;
    SearchResult result;
    string email;

    // Check first if there is a slash in the userid
    // If there is,domain has not been stripped
    if (!userid.Contains("\\"))
    {
        searcher = new DirectorySearcher();
        searcher.Filter = String.Format("(SAMAccountName={0})",userid);
        searcher.PropertiesToLoad.Add("mail");
        result = searcher.FindOne();
        if (result != null)
        {
            email = result.Properties["mail"][0].ToString();
        }
    }

    return email;
}

您不必指定域控制器.对DirectorySearcher执行empty / default构造函数会导致它尝试自动查找 – 实际上,这是the preferred method.

CentOS - 搭建yum源

CentOS - 搭建yum源

#!/bin/bash
echo ''select mirrors:''
mirrors_163=''1. 163.''
mirrors_sohu=''2. sohu.''
mirrors_other=''3. Exit.''
url_163=''http://mirrors.163.com/.help/CentOS6-Base-163.repo''
url_sohu=''http://mirrors.sohu.com/help/CentOS-Base-sohu.repo''
echo  $mirrors_163
echo  $mirrors_sohu
echo  $mirrors_other
read select
if [ 1 == $select ]
then
        url=$url_163
        fileName=''CentOS6-Base-163.repo''
elif [ 2 == $select ]
then
        url=$url_sohu
        fileName=''CentOS-Base-sohu.repo''
else
        exit
fi
mkdir -p /etc/yum.repos.d/yum.bak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/yum.bak/
wget $url
if [ 0 -eq $? ]
then
        echo ''ok.''
else
        echo ''falid.''
        exit
fi
mv ${fileName} /etc/yum.repos.d/CentOS-Base.repo
yum clean all
yum update & yum makecache

CentOS 6.4 上通过 yum 安装 Nagios-3.5.0 [服务端 /server 端]

CentOS 6.4 上通过 yum 安装 Nagios-3.5.0 [服务端 /server 端]

原文见:http://sharadchhetri.com/2013/05/19/installing-nagios-3-5-0-in-centos-6-4-using-yum/


#安装:

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

yum install nagios nagios-devel nagios-plugins* gd gd-devel httpd php gcc glibc glibc-common openssl

#设置密码, 默认用户名和密码都是nagiosadmin
htpasswd -c /etc/nagios/passwd nagiosadmin #回车然后输入密码

#检查以下配置是否一样:vi /etc/nagios/cgi.cfg
=============================
    # AUTHENTICATION USAGE
    use_authentication=1

    # SYSTEM/PROCESS INFORMATION ACCESS
    authorized_for_system_information=nagiosadmin

    # CONFIGURATION INFORMATION ACCESS
    authorized_for_configuration_information=nagiosadmin

    # SYSTEM/PROCESS COMMAND ACCESS
    authorized_for_system_commands=nagiosadmin

    # GLOBAL HOST/SERVICE VIEW ACCESS
    authorized_for_all_services=nagiosadmin
    authorized_for_all_hosts=nagiosadmin

    # GLOBAL HOST/SERVICE COMMAND ACCESS
    authorized_for_all_service_commands=nagiosadmin
    authorized_for_all_host_commands=nagiosadmin
#========================================

#设置开机自启动:
chkconfig --level 3 nagios on
chkconfig --level 3 httpd on

#启动:
/etc/init.d/httpd start
/etc/init.d/nagios start

#注意SELINUX和IPTABLE 以及你的80端口是否被占用

安装完成,http://ip/nagios 就能看到效果

下面配置要管理的节点:


#新建这个文件,里面添加要监控的机器 
#vi /etc/nagios/conf.d/hosts.cfg
#===================
define host{
use linux-server
host_name mysql-node01
alias mysql-node01
address 192.168.1.110  #这个IP是我mysql机器所的IP
}
#=================

===

#添加被监控机器需要被监控那些项目  
#vi /etc/nagios/conf.d/services.cfg

#===========================
define service{
use generic-service
host_name mysql-node01
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}

define service{
use generic-service
host_name mysql-node01
service_description Current Load
check_command check_nrpe!check_load
}

define service{
use generic-service
host_name mysql-node01
service_description Total Processes
check_command check_nrpe!check_users
}
#===========================

#这里对mysql那台机器进行了3项监控: ping load totalProcesses
#其中ping没用到nrpe

==============

#在末尾为nrpe添加命令 
#vi /etc/nagios/objects/commands.cfg

#===========================
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
#===========================
===============
#各种重启
/etc/init.d/nagios restart
/etc/init.d/nrpe restart
/etc/init.d/httpd restart
注意 iptables,服务端和客户端均需要 5666 端口能被互相访问

参考此文配置客户端:CentOS 6.4 上通过 yum 安装 Nagios-3.5.0 [客户端 /client 端]

配置完后,刷新 nagios 页面,就能看到 mysql-node01 了


附上一篇别人的:http://www.crsay.com/network/nagios-configure-is-simple.html
比较完整,有 pnp 的配置

CentOS 6.8上编译安装ApacheHttpServer

CentOS 6.8上编译安装ApacheHttpServer

CentOS 6.8上编译安装ApacheHttpServer

在上一篇文章CentOS 6.8_x64 Linux下基础环境搭建介绍了通过yum来安装Apache Http Server

本文将介绍通过源码方式编译安装Apache Http Server,编译安装的好处就是可以自定义一些配置,可以更好的学习和配置Apache Http Server

源码下载

All-In-One(apr-1.5.2.tar.gz apr-util-1.5.4.tar.gz httpd-2.4.23.tar.gz pcre-8.39.tar.gz)

安装步骤

下载源码及依赖包

首先需要安装依赖包pcre-8.39.tar.gz,然后将apr-1.5.2.tar.gzapr-util-1.5.4.tar.gz分别解压至源码httpd-2.4.23目录下的srclib/aprsrclib/apr-util目录,确保依赖包都已经正确安装之后开始安装ApacheHttpServer

# tar -zxvf pcre-8.39.tar.gz
# cd pcre-8.39
# ./configure --prefix=/opt/pcre
# make && make install

# tar -zxvf httpd-2.4.23.tar.gz
# tar -zxvf apr-1.5.2.tar.gz
# mv apr-1.5.2 httpd-2.4.23/srclib/apr

# tar -zxvf apr-util-1.5.4.tar.gz
# mv apr-util-1.5.4 httpd-2.4.23/srclib/apr-util

# cd httpd-2.4.23
# ./configure --prefix=/opt/apache90 --with-port=90 --with-pcre=/opt/pcre
# make
# make install

# vi /opt/apache90/conf/httpd.conf
# /opt/apache90/bin/apachectl -k start
# /opt/apache90/bin/apachectl -k stop
# /opt/apache90/bin/apachectl -k graceful-stop

这里我将默认端口改成90,因为测试环境80端口已经被占用了,不过并不妨碍我做实验;

关于configure的更多配置项请移步参考configure官方文档。

访问服务器

浏览器访问http://yourip:90/如果显示It works!则表明从源码编译安装的Apache Http Server服务器已经成功安装。

我们今天的关于centos – 如何为LAN中的客户端计算机创建Yum Cache Servercentos创建yum源的分享就到这里,谢谢您的阅读,如果想了解更多关于asp.net – 如何从Web应用程序中的客户端计算机获取AD凭据?、CentOS - 搭建yum源、CentOS 6.4 上通过 yum 安装 Nagios-3.5.0 [服务端 /server 端]、CentOS 6.8上编译安装ApacheHttpServer的相关信息,可以在本站进行搜索。

本文标签: