ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

本地搭建镜像源的坑

2021-02-01 11:33:04  阅读:136  来源: 互联网

标签:dummy log httpd Options 本地 镜像 com example 搭建


本地搭建镜像源的坑


公司研发一直使用局域网的redhat6.9,无法连接外网,yum有多爽,我想用过的都离不开(没错 说的就是
yum whatprovides和yum provides)
所以想着添入服务器的机会,把本地源搭建起来,虽然现在局域网都是里6.9.但是以后还是最低需要7的,所以先搭建7的,安装的话,看这边的帖子https://www.sohu.com/a/210767662_639793
这里有个坑
reposync -r 这是需要对方的源支持才能使用,目前来说 我试了阿里云和腾讯 都不能使用,但是163可以。
这里有个坑
epel有16G的,所以记得留好空间,为了贪图方便用了root账户,结果因为50G容量不够了,关于lvm硬盘扩容可以看这个https://blog.csdn.net/zmzdmx/article/details/112299741
所以最起码给100G的硬盘空间给源的镜像
同步完成后,就要把发布了,
最近一直用nginx,突发奇想用apache了
好了因为
坑来了


#
# Relax access to content within /var/www.
#
<Directory "/var/www">
    AllowOverride all
    # Allow open access:
    Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/root/apache/www">
    #
    # 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.4/mod/core.html#options
    # for more information.
    #
    Options Indexes 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

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>


重启httpd,
一访问
你没有权限OMG,我SE防火墙也关了啊
好吧 那我本地127总行了吧
好吧 root自己都没权限
倒是没看日志先百度了
原来2.4 之后还要改vhost里的的根目录
find / -type f -name httpd-vhosts.conf

<VirtualHost *:@@Port@@>
 ServerAdmin webmaster@dummy-host.example.com
 DocumentRoot "/root/apache/www"
 ServerName dummy-host.example.com
 ServerAlias www.dummy-host.example.com
 ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
 CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:@@Port@@>
 ServerAdmin webmaster@dummy-host2.example.com
 DocumentRoot "/root/apache/www"
 ServerName dummy-host2.example.com
 ErrorLog "/var/log/httpd/dummy-host2.example.com-error_log"
 CustomLog "/var/log/httpd/dummy-host2.example.com-access_log" common
</VirtualHost>

改了 结果重启还不是不行,这个时候我才去看日志
居然
Permission denied: [某路径]/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
原来是权限问题,这就奇怪了 默认mkdir应该就是755才对啊,不管了先无脑777,好了权限报错没了,在改会755
ok这个问题也没有,
重启,还是不能访问根目录
但是输入路径可以访问了
这是最后一个坑
vim /etc/httpd/conf.d/welcome.conf

<LocationMatch "^/+$">
 Options Indexes
 ErrorDocument 403 /.noindex.html
</LocationMatch>

<Directory /usr/share/httpd/noindex>
 AllowOverride None
 Require all granted
</Directory>
``
去掉index前的- 这个- 是不允许目录流量
在Indexes前,加 + 代表允许目录浏览;加 – 代表禁止目录浏览。




标签:dummy,log,httpd,Options,本地,镜像,com,example,搭建
来源: https://blog.csdn.net/tokyohuang123/article/details/113498921

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有