1、安装httpd
yum install -y httpd
2、修改httpd配置文件(直接清空原配置文件,粘贴下面配置)
#httpd.conf
ServerRoot "/etc/httpd"
Listen 6789 #端口可自行更改
LoadModule autoindex_module modules/mod_autoindex.so
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
ServerName 172.10.10.137 #IP可自行更改
<Directory />
</Directory>
DocumentRoot "/opt/cdh" #根据文件存放位置修改
<Directory "/opt/cdh"> #根据文件存放位置修改
</Directory>
<Directory "/var/www/html">
</Directory>
<IfModule dir_module>
</IfModule>
<Files ".ht*">
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
</IfModule>
<IfModule alias_module>
</IfModule>
<Directory "/var/www/cgi-bin">
</Directory>
<IfModule mime_module>
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
</IfModule>
EnableSendfile on
IncludeOptional conf.d/*.conf
3、在/opt/cdh下面放一个文件echo 'hello zsq' > a
至此,httpd web服务器配置完毕
4、添加本地yum源
[root@hadoop01 cdh]# cat /etc/yum.repos.d/localimp.repo
[localimp]
name=localimp
baseurl=http://172.10.10.137:6789/5.16.2/ #5.16.2是/opt/cdh下面的一个文件夹
gpgcheck=0
enabled=1
备注:其他主机只需要将localimp.repo scp过去即可。