• 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

httpd.include not updated

E

EricWenzel

Guest
Plesk 8.2

I have added a vhosts.conf with the following content
<Directory /var/www/vhosts/**mydomain.com**/httpdocs>
php_admin_value open_basedir none
</Directory>

and run
/usr/local/psa/admin/bin/websrvmng -a -v

but it does not update my httpd.include file... :(

any ideas?
 
Hello,

have you already tried a complete restart of Plesk via /etc/init.d/psa stopall && /etc/init.d/psa start.

In some cases this is more reliable.
 
Plesk doesn't update the httpd.include file, the contents of vhost.conf just override any settings already specified in httpd.include. Note that the file should be called vhost.conf and not vhosts.conf. (You can use vhost_ssl.conf for https.)
 
Resolved... almost!

All brainbending problems have a simple solution...

My incorrect filename vhosts.conf was changed to vhost.conf and the proper open_basedir path was created.

However, I still have a problem with this... When I copy the path listed in the PHP error and add it to the open_basedir list of paths (separated by :) it still does not resolve.

I get it working with *none*, but not with an explicit path defined... Does the path require "quotes" or...? is the path relative to the vhost? or...?

Thanks in advance for any enlightenment you may provide...
 
What does your vhost.conf look like? What was the error you got? Did you run websrvmng again and does httpd.include now include an Include statement that includes your vhost.conf?
 
vhost_ssl.conf is NOT working for subdomains.

I repeat:
vhost_ssl.conf NOT working, regardless what so called senior members telling us here.
 
For subdomains on SSL there is no distinction between vhost.conf and vhost_ssl.conf, Plesk uses vhost.conf for both. You can put modifications for SSL on subdomains in vhost.conf as well. Yes, this is a bit strange and surprising.
 
Let me quote ..

So let me quote then the manual: Plesk 8 Administratior's Guide (Plesk for Unix). On page 202 in Appendix A, Advanced Features":

This file is overwritten each time the virtual host configuration is changed, thus any manual
alterations made to the file are discarded. To use custom directives or redefine those inserted by
Plesk, you need to create the files vhost.conf and/or vhost_ssl.conf with necessary
directives in the directory /path_to_vhosts/<domain-name>/conf/ for a domain,
and /path_to_vhosts/<domain-name>/subdomains/<subdomain-
name>/conf/ for a subdomain
.
If any of these files exist by the time the main configuration file is generated, Plesk inserts the
appropriate Include directive
into the HTTP and/or HTTPS virtual host context respectively. For
security reasons, only root can create the vhost.conf and vhost_ssl.conf files.

Since Plesk does not behave as described in the manual, we do have a bug and I can't see any reason why not providing a simple patch to fix it.

But how to do something like this then: I want to have a <Location /> available only when using https:// but not when using http://. How can I do this? Is there something which let's me query whether the SSL engine is on?
 
Yes, it's probably a bug. Fixing it would break a lot of installations though, so this change would have to be clearly communicated.

I don't know about a general directive that lets you check for SSL. Maybe you can somehow work around this by using mod_rewrite using RewriteCond %{HTTPS} on.

Another solution might be to create the subdomain as a top-level domain in Plesk, because then you can use separate vhost.conf and vhost_ssl.conf files. It does count one extra for your domain limit if you don't have a Plesk license for an unlimited number of domains.
 
any hooks?

Working with mod_rewrite is like petting a scorpion. Only use it in live-and-dead situations...

Perhaps I missed something in Plesk's documentation, isn't there kind of hook which would allow me to run a customized script after/before a reconfiguration step??

In the worst case I could wrap "websrvmng" in a shell script which would execute my own script afterwards. But those changes are then lost when updating Plesk and I also do not have much hope that things are fixed in upcoming Plesk versions.

A suggestion how backward compatibility could be ensured is to additionally look into vhost_ssl.conf's content. Plesk would only include it, if there is a like matching regex

^\s*#\s*com\.paralles\.plesk\.please\.include\.this\.file\.please\s*=\s*yes\s.*$

If that line is not there or not "yes", then the file is not included resp. removed from 'httpd.include'.
 
Problem adding Event Handler

I tried to add a simple event handler, actually just the demo handler in the manual, and it does not work. For unkown reasons, I'm getting the error message "Error: Some fields are empty or contain an improper value" in the "Command" field.

This is what I have therein:
/usr/local/psa/bin/test-handler.sh

And it looks like this:

$ cat /usr/local/psa/bin/test-handler.sh
#!/bin/bash
echo "--------------" >> /tmp/event_handler.log
/bin/date >> /tmp/event_handler.log # information on the event date and time
/usr/bin/id >> /tmp/event_handler.log # information on the user, on behalf of which the script was executed (to ensure control)
echo "client created" >> /tmp/event_handler.log # information on the created client account
echo "name: ${NEW_CONTACT_NAME}" >> /tmp/event_handler.log # client's name
echo "login: ${NEW_LOGIN_NAME}" >> /tmp/event_handler.log # client's login
echo "--------------" >> /tmp/event_handler.log


I tried other users than root, other priorities than lowest (0) and other event handlers than "subdomain updated" without success.

I also looked up syslog and other place to find somewhere a more detailed error or problem message, also without success.

Haven't I mentioned recently that it's rather a frustrating experience this Plesk thing??
 
About Entering An Event Handler

I believe this is not a bug but rather an annoying feature of Plesk 8.6.0.

When creating a (custom) event handler in Server | EventManager | Add New Event Handler care must be taken to have the command line not, I repeat: NOT, ending in any whitespace characters (blank, tab, newline etc). Otherwise expect to be faced with an error message like Error: Some fields are empty or contain an improper value..

Here is an example. For the purpose of illustration, I set here the command in quotes (""). When entering the command you would not type the qoutes but rather everything enclosed by them.

This works fine (but rather useless)
"echo > /dev/null"

This does not work:
"echo > /dev/null "

The only difference is the trailing whitespace. That is enough to make the Plesk grumpy.
 
Adding Event Handler is a no-go area!

Finally I would like to add, that adding a event handler does not work. The very basic reason for this is, that someone at parallels decided,

to execute all user supplied event handlers before finally creating http.include.

This, dear Parallels Team, does not make any sense. Let me repeat this.

THIS IS TOTAL NONSENSE.

I'm giving up on Plesk. I regret that I started to give it a try.
 
Back
Top