• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Change the DocumentRoot to a domain

C

CesarV

Guest
How do I get a domain eg domain.com opens the same folder from another domain?

Do I create the file vhost.conf? What lines should contain this file?

When I run the command / usr / local / psa / admin / sbin / websrvmng - reconfigure-vhost - vhost-name = <domain_name>, is re-created the file httpd.include.

Is there another way to do?

Thanks.
 
Morning IgorG. Thanks for all your help.

I'll explain better. My client has multiple domains. When someone tries to access www.docolfaucets.com,
this site will load content from another domain docol.com.br, which is the default domain of the client,
where all content is centered.

In my old server, the domain docol.com.br was set to open the DocumentRoot /var/www/vhosts/docol.com.br
and the domain docolfaucets.com was set to open the DocumentRoot /var/www/vhosts/docol.com.br/ingles.

If I use the forwarding option to redirect to another destination, content to the domain docolfaucets.com
not work correctly because this area has some applications and forwarding mode does not work.

Example configuration of my old server:

#<docol.com.br>
<VirtualHost 200.215.98.2>
DocumentRoot /var/www/dominios/docol
ServerName www.docol.com.br
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
ErrorLog logs/docol-info-error.log
CustomLog logs/docol-info-access.log combined
</VirtualHost>
#</docol.com.br>

#<docol.com.br>
<VirtualHost 200.215.98.2>
DocumentRoot /var/www/dominios/docol/ingles
ServerName www.docol.com.br
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
ErrorLog logs/docol-info-error.log
CustomLog logs/docol-info-access.log combined
</VirtualHost>
#</docol.com.br>

Thus it is simple to set up multiple domains and point them to the same destination or to specific folders
of the same DocumentRoot.

Is there another way to do?
 
i think it is cause we still not can handle e-mail addresses of an domain alias separately !
 
Thanks IgorG for all the answers to my questions.

I did the following configuration in Apache's httpd.conf to try to solve my problem:

I included the line Include vhosts.d/clientes.conf before Include conf.d/*.conf and I created the file
clientes.conf with the information:

# <docolfaucets.com>
<VirtualHost 187.61.7.99:80>
ServerName www.docolfaucets.com
ServerAlias docolfaucets.com
UseCanonicalName Off
SuexecUserGroup ftpdocol psacln
DocumentRoot /home/httpd/vhosts/docol.com.br/httpdocs
DirectoryIndex index.html index.htm index.php
CustomLog /home/httpd/vhosts/docolfaucets.com/statistics/logs/access_log plesklog
ErrorLog /home/httpd/vhosts/docolfaucets.com/statistics/logs/error_log
</VirtualHost>
# </docolfaucets.com>

# <docolgriferias.com>
<VirtualHost 187.61.7.99:80>
ServerName www.docolgriferias.com
ServerAlias docolgriferias.com
UseCanonicalName Off
SuexecUserGroup ftpdocol psacln
DocumentRoot /home/httpd/vhosts/docol.com.br/ httpdocs
DirectoryIndex index.html index.htm index.php
CustomLog /home/httpd/vhosts/docolgriferias.com/statistics/logs/access_log plesklog
ErrorLog /home/httpd/vhosts/docolgriferias.com/statistics/logs/error_log
</VirtualHost>
# </docolgriferias.com>


I restarted apache and it worked perfectly. Now he was creating other fields and restarted the apache and
the domains that were running as mentioned stopped working. When I try to access this domains the browser
asks if I want to download index.php.

Other thing. I created FTP accounts as the link above, but when I try to download a file via browser says
you do not have permission to access this document.



How can I solve the problem of apache? What is the best way?
 
Even DocumentRoot for 2 domains

I need that 2 domains open the same DocumentRoot. The problem of using aliases Domains is that the redirected domain is the name of the target domain, that is, when I access the domain www.domain1.com will load and lead to www.domain.com.

There must be some way to do this. Please, I need to resolve this problem.

Thank you.
 
Help me, please!

Good afternoon Igor. There must be some way to configure the same DocumentRoot for more than one domain. I always used this way, it is a facility that Apache has. Domains must be individually, without translating the domain name to another.

I really need a solution. It is very important to me. What can I do?

Please. Thank you.
 
Back
Top