• 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

Changing DocumentRoot

NicholasEvans

New Pleskian
Hi,

I've got several sites that all run from the same document root but require separate mail accounts.

I've read that the best way to do this is to set up another site (or webspace) for the domain and then change the DocumentRoot in the vhost.conf file.

I've been trying to do this but don't seem to be able to get PHP to run on the new host once I've created vhost.conf.

I tried:
Code:
<Directory /var/www/vhosts/example.com/httpdocs>
Options -Includes -ExecCGI
</Directory>
DocumentRoot /var/www/vhosts/example.com/httpdocs

But the site just downloads the php file.

Any suggestions would be appreciated.

Kind regards,

Nick
 
Have also tried the following but I just get the default apache test page

Code:
DocumentRoot /var/www/vhosts/example.com/httpdocs

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/example.com/etc/php.ini

<Directory /var/www/vhosts/example.com/httpdocs>

	<IfModule mod_perl.c>
	    <Files ~ (\.pl$)>
		SetHandler perl-script
		PerlHandler ModPerl::Registry
		Options ExecCGI
		allow from all
		PerlSendHeader On
	    </Files>
	</IfModule>
	<IfModule mod_python.c>
	    <Files ~ (\.py$)>
		SetHandler python-program
		PythonHandler mod_python.cgihandler
	    </Files>
	</IfModule>
	<IfModule mod_fcgid.c>
	    <Files ~ (\.fcgi)>
		SetHandler fcgid-script
		Options +FollowSymLinks +ExecCGI
	    </Files>
	</IfModule>
	<IfModule mod_fcgid.c>
	    <Files ~ (\.php)>
		SetHandler fcgid-script
		FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .php
		Options +ExecCGI
		allow from all
	    </Files>
	</IfModule>

	Options -Includes +ExecCGI

</Directory>
 
Back
Top