• 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

vhost.conf file in PLESK not working as intended

S

Saif Bechan

Guest
I have configured a vhost file for my domain but it does not seem to work. These are the steps I took, please correct me if I am wrong.

First I made a file called vhost.conf in:

/var/www/vhosts/*domain*/conf/vhost.conf

The content of the vhost file looks like this:

<Directory /var/www/vhosts/*domain*/httpdocs>
php_admin_flag engine on
php_admin_flag display_errors on
</Directory>

Now in my /etc/php.ini i set display_errors=Off

After everything i rebuild with: /usr/local/psa/admin/sbin/websrvmng -a

But I don't see the any errors in my page. When i turn on the display_errors in /etc/php.ini only then can I see the errors.

I know for a fact that the vhost file is read, because when i type nonsense values i get an error when restarting apache saying there are errors in the vhost file.

Anyone know what the problem can be.

Should there be special settings in either the php.ini file or the httpd.conf file.

The httpd.conf i edit is in /etc/httpd/conf/httpd.conf. Is this the file that PLESK uses or is there another, because the values i see there do not really reflect the http folders of my domain. The httpd file looks like this now.


DocumentRoot "/var/www/html"

<Directory />
Order Deny,Allow
Deny from all
Options None
AllowOverride None
</Directory>

<Directory "/var/www/html">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Only this directory /var/www/html is not used by me, I use the directory /var/www/vhosts. The only folder found in /var/www/html is a folder called awstats. Does plesk use any other httpd.conf file i should know of.

I hope this all makes sense to anyone, and i hope i can find a solution
 
I found out what the problem is. I am running on FastCGI. When running fastCGI the php_admin_flags are ignored for some reason. There are some post to solve this problem, but neither of them offer an out-of-the-box solution to this.

Anyone have any suggestions on this.
 
Back
Top