• 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 question on how-to

C

chrisl@

Guest
In the httpd.include file you have the following statement:

Code:
# ATTENTION!
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
# /var/www/vhosts/xxxxx.com/conf/vhost.conf
# /var/www/vhosts/xxxxx.com/conf/vhost_ssl.conf
# /var/www/vhosts/xxxxx.com/subdomains/<subdomain-name>/conf/vhost.conf

The file does not exists by default. When I create the file they suggest it does not get loaded. Where does this file get loaded from? I can't find any include statements anywhere that would laod this file. If I need to modify a file to get this new conf file included doesn't that break the requirement of not modify the original file? Any ideas or help? I need to setup some custom redirects for a site and would like to automate this via a script.

-chrisl
 
After you create the vhost.conf file, run:

/usr/local/psa/admin/sbin/websrvmng -a -v

This will place the include statement with the httpd.conf file and Plesk will not remove it the next time the conf file is updated.
 
Originally posted by jwdick
After you create the vhost.conf file, run:

/usr/local/psa/admin/sbin/websrvmng -a -v

This will place the include statement with the httpd.conf file and Plesk will not remove it the next time the conf file is updated.

Thanks worked great!

-chrisl
 
/usr/local/psa/admin/sbin/websrvmng -a -v

I suggest using:

Code:
<path_to_Plesk_admin_bins>/websrvmng --vhost-name=<the_host_your_reconfiguring> -r

As this will not leap though all hosts creating new configuration files for all hosts but only for the host you have changed.

The -r will restart Apache.
 
Originally posted by Whistler
I suggest using:

Code:
<path_to_Plesk_admin_bins>/websrvmng --vhost-name=<the_host_your_reconfiguring> -r

As this will not leap though all hosts creating new configuration files for all hosts but only for the host you have changed.

The -r will restart Apache.

Even better! Thanks. Still learning lots about Plesk.
 
great thread! Is websrvmng documented anywhere? eg will "websrvmng -help" get me started or...?

I'm trying to figure out what I can and cannot configure manually without interfering with Plesk or having it overwrite my changes.

I'm from the old school of administering via httpd.conf and friends, but I don't have a choice in this case, so I have to learn to work with Plesk rather than fight it. And these Plesk help files, sheesh. "If you want to enable Mystery Feature, put a checkmark in the checkbox and click the OK button - good luck..."

... and managers wonder why things take so long when they insist on adding a layer of complexity in the name of simplification...
 
Originally posted by Whistler
I suggest using:

Code:
<path_to_Plesk_admin_bins>/websrvmng --vhost-name=<the_host_your_reconfiguring> -r

As this will not leap though all hosts creating new configuration files for all hosts but only for the host you have changed.

The -r will restart Apache.

Note that this is all in the Plesk 8 Administrator manual: Appendix A. Advanced Features -> Including Directives into Web Server Configuration File. This section tells you about httpd.include, vhost.conf and the websrvmng command.
 
Originally posted by breun
Note that this is all in the Plesk 8 Administrator manual: Appendix A. Advanced Features -> Including Directives into Web Server Configuration File. This section tells you about httpd.include, vhost.conf and the websrvmng command.

I don't know if we are talking about the same Plesk 8 help files, but if we are, mine are very incomplete:

1) It doesn't tell you anything about the websrvmng switches.

2) It doesn't tell you how to test your new configuration file(s) before restarting apache, which normally you do with apachectl -t.

3) It doesn't tell you what happens when your directives conflict with those generated by Plesk.

4) It doesn't tell you if your vhosts.conf or vhosts_ssl.conf is required to become a complete replacement for a given VirtualHost directive, or just augment it.

5) It doesn't tell you how to unload your vhosts.conf directives.

...
 
Back
Top