• 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
  • Please beaware of a breaking change in the REST API on the current Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

How do you configure suPHP to work with SSL

D

DirtyMonkey

Guest
I have successfully configured suPHP to work with vhosts.conf file provided by Plesk Power Tools by Graphix Software.

vhost.conf contains:

# PHP version detected 5
<IfModule mod_suphp.c>
<Directory "/var/www/vhosts/mydomain.com/httpdocs/">
php_admin_flag engine on
suPHP_Engine On
suPHP_ConfigPath "/var/www/vhosts/mydomain.com/httpdocs/"
AddHandler php5-script .php
AddHandler x-httpd-php .php5
suPHP_AddHandler php5-script .php
<Files php.ini>
order allow,deny
deny from all
</Files>
php_value open_basedir "/tmp/"
php_value upload_tmp_dir "/var/www/vhosts/mydomain.com/httpdocs/tmp/"
</Directory>
</IfModule>

However as I understand it I have to also create vhost_ssl.conf file.
How should vhost_ssl.conf contain and is there anything else I have to do?

Web hosting setup: Use a single directory for housing SSL and non-SSL content

DM.
 
You can probably just put the same stuff into a vhost_ssl.conf file, make sure to run this when your done

/usr/local/psa/admin/bin/websrvmng -u --vhost-name=mydomain.com
/sbin/service httpd restart
 
You can probably just put the same stuff into a vhost_ssl.conf file, make sure to run this when your done
/usr/local/psa/admin/bin/websrvmng -u --vhost-name=mydomain.com
/sbin/service httpd restart

Ok but what do those commands do?

DM.
 
To find out what things do you can always run them with the --help flag

/usr/local/psa/admin/bin/websrvmng --help
Usage: websrvmng [OPTIONS]...

-a, --reconfigure-all
create configuration files for all domains
-m, --change-admin-email --email=<admin_email>
change admin email
-n, --install-vhost --vhost-name=<domain_name>
creates virtual hosting in webserver (physical, frame forward, standard forward)
-u, --reconfigure-vhost --vhost-name=<domain_name>
webserver reconfiguration for one given host
-d, --remove-vhost --vhost-name=<domain_name>
removes virtual hosting from server
-i, --set-certificate --ip-address=<ip_address>
change certificate associated with IP address. Affects all SSL virtual hosts on given IP (SSL certificate should be changed on those hosts)
--set-default-domain --ip-address=<ip_address> --vhost-name=<domain_name>
sets default domain for IP address. Thus, all HTTP requests which have come on given IP and for which there is no appropriate domain, should come on given default domain
--reset-default-domain --ip-address=<ip_address>
delete default domain for IP address
--add-ip-address --ip-address=<ip_address>
adds IP address to webserver
--remove-ip-address --ip-address=<ip_address>
removes IP address from webserver
--add-protection --vhost-name=<domain> --directory=<dir>
adds protection to directory
--remove-protections --vhost-name=<domain>
removes protection from directory
--update-protection --vhost-name=<domain> --directory=<dir>
change protected directory properties
--add-web-user --vhost-name=<domain> --web-user=<user>
add webuser to webserver configuration
--update-web-user --vhost-name=<domain> --web-user=<user>
updates webuser configuration in webserver
--remove-web-users --vhost-name=<domain>
delete webuser from webserver configuration
--features
returns PHP code which reflects state of several features support in websrvmng.
--install-fp --vhost-name=<domain> --user-name=<user> --port=<443|80> --admin-name=<admin>
The noncrypted admin password is transferred in the environment variable PSA_PASSWORD
--remove-fp --vhost-name=<domain> --user-name=<user> --port=<443|80>

--enable-fp --vhost-name=<domain> --user-name=<user> --port=<443|80>

--disable-fp --vhost-name=<domain> --user-name=<user> --port=<443|80>

--rename-admin-fp --vhost-name=<domain> --user-name=<user> --port=<443|80> --new-name=<new_admin> [--old-name=<old_admin>]
The noncrypted admin password is transferred in the environment variable PSA_PASSWORD
--change-password-fp --vhost-name=<domain> --user-name=<user> --port=<443|80> --admin-name=<admin>
The noncrypted admin password is transferred in the environment variable PSA_PASSWORD
-w, --without-restart
without restart apache & tomcat. Can used with another options
-p, --start
start webserver
-o, --stop
stop webserver
-s, --status
webserver status
-r, --restart
restart webserver
-t, --restart-tomcat
with -p & -r restart tomcat
-v, --no-daemon
non-daemon mode without delay on restart apache
-h, --help
display this help and exit
 
Thanks Hosting Guy, I had created the vhost_ssl.conf the other day but it didn't work but then today SSL is working correctly! :) I'm Not sure why... I hadn't run the command you suggested but I had updated Debian 4.0 and there was an Open SSL update... may just be a complete conincedence but I'm just happy its working!

DM.
 
I think once per day psa runs the command itself (does a -v -a to do all vhosts) and if you restarted httpd at any point that could have done it too.
 
Ok but what do those commands do?

DM.

Just trying this on a subdomain development.mydomain.com but its not working I get a 500 error?

I enter the following command:

/usr/local/psa/admin/bin/websrvmng -u --vhost-name=development.mydomain.com

I'm running Debian/Apache 2.2 so I guess the correct command to restart the webserver is:

/etc/init.d/apache2 restart

Any suggestions?

DM.
 
As before, left it overnight and now it is now working! :)

But this also must mean a command other than the previous one mentioned in this thread runs over night... but what is it?

Hoping someone know, DM.
 
plesk rebuilds the conf files each time it restarts or a new domain is added/changed/removed
 
plesk rebuilds the conf files each time it restarts or a new domain is added/changed/removed

Understood HG, but trying to force this with the commands you kindly suggested did not work for me...
I would like to be able to do it at will and not wait for it to happen overnight. ;)

DM.
 
on debian/ubunu plesk files are located at /opt/psa, not at /usr/local/psa

/opt/psa/admin/bin/websrvmng -u --vhost-name=development.mydomain.com

this command rebuilds httpd.include in /var/www/vhosts/mydomain.com/conf/

if it finds files vhost.conf and/or vhost_ssl.conf, it includes them into configuration by Include directives in httpd.include.
 
We have suphp configured as instructed on lvalics website and is working fine.

Is suphp configuration screwed up if user change PHP modus im Plesk 9 eg from Apache module to FastCGI or CGI?

Mike
 
on debian/ubunu plesk files are located at /opt/psa, not at /usr/local/psa

/opt/psa/admin/bin/websrvmng -u --vhost-name=development.mydomain.com

this command rebuilds httpd.include in /var/www/vhosts/mydomain.com/conf/

if it finds files vhost.conf and/or vhost_ssl.conf, it includes them into configuration by Include directives in httpd.include.

Thanks gorilych, easy when you know how! ;)

Just to recap for those using Debian/Ubuntu the full commands are:
/opt/psa/admin/bin/websrvmng -u --vhost-name=mydomain.com

/etc/init.d/apache2 restart

DM
 
Back
Top