Score:0

403 after pointing A-Record of subdomain to IP of other server

id flag

I have two servers X and Y.


Server X:

I have a VHOST for the subdomain test.api.konfigurator.company.de pointing to a directory which simply has a index.html containing the word "it works!".

First I tested it locally, by editing my hosts file in windows. That worked, the text "it works!" is showing if I call test.api.konfigurator.company.de from the browser.

So this made sure that the VHOST works. I deleted the record from my "hosts" file again.


Server Y:

I created a subdomain test.api.konfigurator.company.de from cpanel.

The process of creating the subdomain also created the A-Records.

I added this additional A-Record to company.de:

test.api.konfigurator.company.de.   300    A    3.70.50.1XX

If I ping test.api.konfigurator.company.de then I get 3.70.50.1XX so that worked.


So everything should be ready.

Expected behaviour:

If I open https://test.api.konfigurator.company.de from the browser, then the content "it works!" should show.

Actual behaviour:

Forbidden You don't have permission to access this resource.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


VHOST:

<VirtualHost *:80>
        ServerName test.api.konfigurator.company.de

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/company/test.api.konfigurator.company.de/public

        <Directory /var/www/company/test.api.konfigurator.company.de/public>
                Options Indexes FollowSymLinks
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/api_company_konfigurator_error.log
        CustomLog ${APACHE_LOG_DIR}/api_company_konfigurator_access.log combined
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
in flag
Please provide the configuration files of your webserver.
Black avatar
id flag
Which files exactly?
in flag
That vhost is for HTTP, yet you try to access it with HTTPS. Where is your HTTPS VirtualHost block?
Black avatar
id flag
You are right! If I call it with http then it works! :)
Score:2
in flag

You only have a VirtualHost block for HTTP on port 80, yet you call your server via HTTPS. Since Apache can't find a matching VirtualHost the default VirtualHost is used.

Add a VirtualHost for HTTPS on port 443.

Black avatar
id flag
Unfortunatelly I got the same error again today even on both http and https, so there must be something else going on. I even set all folders and files to chmod 777 for testing, but it makes no difference. Any ideas?
Black avatar
id flag
Ok I figured out that the IP of server X changed and the A-Record is pointing to an old IP now.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.