Thanks a lot for your reply.
wp-config was correctly edited.
The issue was that I had to point vhost of the secondary domains to main domain folder.
But in this case it works only with A records, as with CNAME it keeps redirecting to main domain homepage.
The important thing is that now it works.