![사용자 정의 HTTP 저장소가 로컬 Centos 서버에 표시되는 것을 거부합니다.](https://linux55.com/image/140141/%EC%82%AC%EC%9A%A9%EC%9E%90%20%EC%A0%95%EC%9D%98%20HTTP%20%EC%A0%80%EC%9E%A5%EC%86%8C%EA%B0%80%20%EB%A1%9C%EC%BB%AC%20Centos%20%EC%84%9C%EB%B2%84%EC%97%90%20%ED%91%9C%EC%8B%9C%EB%90%98%EB%8A%94%20%EA%B2%83%EC%9D%84%20%EA%B1%B0%EB%B6%80%ED%95%A9%EB%8B%88%EB%8B%A4..png)
Centos 설치 DVD iso에서 복사한 로컬 패키지 저장소를 설정했습니다.
로컬 DNS 주소(myrpmweb) 및 컴퓨터 LAN IP가 Apache 123을 성공적으로 로드합니다. Firefox 브라우저에서 테스트 페이지를 로드했지만 [내 로컬 LAN IP]/rpm을 로드하려고 하면 "찾을 수 없음, 요청한 URL /rpm"이라고 표시됩니다. 이 서버"를 찾을 수 없습니다.
설명된 단계를 사용했습니다.여기(링크), 내 로컬 HTTP 저장소를 설정하려고 합니다.
계속해서 사용자 정의 저장소에 대한 구성 정보를 표시하겠습니다.
/etc/yum.repos.d/kix.repo 파일의 내용
name=kix repo
baseurl=file:///home/kix/rpm
enabled=1
gpgcheck=0
createrepo를 실행한 후 디렉터리에 "repodata"라는 폴더가 있고 그 위에 잠금 아이콘이 있습니다.
/home/kix/rpm/
튜토리얼의 지시에 따라 폴더의 올바른 소유권을 설정했습니다.
chmod -R o-w+r /home/kix/rpm/repo
centos DVD iso의 패키지를 /home/kix//rpm/centos/ 디렉터리로 전송한 후 패키지를 로드할 수 있으며 PWD(현재 작업 디렉터리)도 해당 디렉터리로 설정됩니다.
[root@myserver centos]# yum install jaxen-1.1.3-11.el7.noarch.rpm
Loaded plugins: fastestmirror, langpacks
Examining jaxen-1.1.3-11.el7.noarch.rpm: jaxen-1.1.3-11.el7.noarch
jaxen-1.1.3-11.el7.noarch.rpm: does not update installed package.
Error: Nothing to do
패키지가 전송되는 위치에 대한 심볼릭 링크를 만들었습니다.
ln -s /var/www/html/repo /home/kix/rpm
/var/ww/html/repo의 repo 디렉터리를 클릭하면 centos 폴더가 표시되고, centos 폴더를 클릭하면 /home/kix/rpm/repo/centos에 표시된 패키지가 표시됩니다.
ls –la도 다음을 확인했습니다. 총 276개
drwxr-xr-x. 3 root root 20 Sep 9 19:59 .
drwxr-xr-x. 5 root root 50 Sep 8 12:30 ..
drwxr-xr-x. 4 kix kix 221184 Sep 8 12:03 centos
다음 중 어느 것도 Firefox에서 저장소를 로드하지 않으며 myrpmweb도 내 IP 주소로 대체했습니다.
http://myrpmweb/rpm
http://myrpmweb/repo
http://myrpmweb/centos
setenforce가 0으로 설정되었습니다.
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
apachectl configtest 명령은 다음을 표시합니다.
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/vhost.conf:1
Syntax OK
/etc/httpd/conf.d/vhost.conf, 표시
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName server.home
ServerAlias www.example.com
DocumentRoot /var/www/html/example.com/public_html/
ErrorLog /var/www/html/example.com/logs/error.log
CustomLog /var/www/html/example.com/logs/access.log combined
</VirtualHost>
이 문제를 해결하기 위한 다음 단계는 무엇입니까?
답변1
아래 링크에 게시된 솔루션은 문제를 해결합니다.
https://stackoverflow.com/questions/41917171/apache2-404-error-for-index-html/41917743#41917743
디렉토리 블록은 /etc/httpd/conf.d/vhost.conf 파일에 정의되어야 합니다.
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName server.home
ServerAlias www.example.com
DocumentRoot /var/www/html
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log combined
<Directory "/var/www/html"> # quoted
AllowOverride All
Require all granted # required in Apache 2.4
</Directory>
</VirtualHost>