Apache Httpd에 여러 웹사이트를 설정하면 하나의 웹사이트에만 액세스할 수 있습니다.

Apache Httpd에 여러 웹사이트를 설정하면 하나의 웹사이트에만 액세스할 수 있습니다.

서버에 bugzilla와 Orangescrum을 설치할 계획입니다. 나는 다음과 같은 구성을 만들었습니다.httpd.conf

<VirtualHost *:80>
        DocumentRoot /var/www/html/
        <Directory /var/www/html/bugzilla>
                AddHandler cgi-script .cgi
                Options +Indexes +ExecCGI
                DirectoryIndex index.cgi
                # AllowOverride Limit FileInfo Indexes
                AllowOverride All
        </Directory>
        <Directory /var/www/html/project>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

이 구성에서는 모든 것이 잘 작동합니다. http://server-addresApache 색인으로 돌아가서 http://server-address/bugzillabugzilla를 열고 http://server-address/projectOrangescrum을 엽니다.

이제 인터넷을 검색한 결과 여러 웹사이트를 설정하는 것이 별도의 웹 호스트를 설정하는 것과 다르게 작동한다는 것을 알았습니다.여기예를 들어. 나는 웹사이트의 지침을 따랐고 어떤 이유로 http://server-address버그질라를 http://server-address/project찾을 수 없다고 나에게 돌려보냈습니다. 내용 sites-enabled/bugzilla.conf

<VirtualHost *:80>
    DocumentRoot /var/www/
    ErrorLog /var/www/bugzilla/error.log
    CustomLog /var/www/bugzilla/requests.log combined
    <Directory /var/www/bugzilla>
            AddHandler cgi-script .cgi
            Options +Indexes +ExecCGI
            DirectoryIndex index.cgi
            # AllowOverride Limit FileInfo Indexes
            AllowOverride All
    </Directory>
</VirtualHost>

내용은 sites-enabled/project.conf다음과 같습니다:

<VirtualHost *:80>
        DocumentRoot /var/www/
        ErrorLog /var/www/project/error.log
        CustomLog /var/www/project/requests.log combined
        <Directory /var/www/project>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

두 사이트를 모두 올바르게 설정했습니까? 내 구성에 어떤 문제가 있나요?

https또 다른 문제는 두 사이트의 설정입니다. 나는 지시를 따랐다.여기httpd.conf여기에 제공하고 https://server/bugzillaFTP 서버로 열었을 때 https://server/project여전히 찾을 수 없습니다 . https여러 웹사이트를 설정하는 것에 대해 어떻게 생각하시나요? 감사해요!

업데이트: 정말 여러 개의 웹 호스트가 필요합니까? 저는 제가 제공한 첫 번째 구성을 사용했고 SSL에 대해 다음을 추가한 후 모든 것이 잘 작동했습니다.

SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
ServerName https://ip-address

3개 주소 모두 https://ip-address예상대로 잘 작동합니다 https://ip-address/project.https://ip-address/bugzilla

관련 정보