• 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

Combining secure and non-secure root directories

J

jrister

Guest
Hi,

I need to combine my SSL and non-SSL requests to both draw from the httpdocs folder, instead of the default httpdocs/httpsdocs seperate folders.

I realize this is accomplished by creating vhost.conf and/or vhost_ssl.conf in the conf folder of the domain, followed by running websrvmng to rebuild the httpd.include.

I rather blindly copied the contents of the original httpd.include in its entirety with minor revisions to the DocumentRoot and other various directives to show "httpdocs" rather than "httpsdocs". I then saved this modified copy of httpd.include into vhost.conf and vhost_ssl.conf and ran websrvmng.

After trying to do this, I found myself getting the error about unable to restart Apache via websrvmng. Thankfully, restoring the original httpd.include and re-running websrvmng to rebuild that corrected the problem.

So, let me get to the point.

What do I need to put in vhost.conf and vhost_ssl.conf in order to do this properly and avoid errors after the vhost rebuild/reconfiguration?

Thank you.
 
You can upgrade to Plesk 7.5.3, where you can use httpdocs folder to server both http and https. This would be easier to maintain.
 
I have 7.5.2

the 7.5.3 upgrade trashed the server a couple weeks ago, so i had to do a full re-image on my box (from 1and1) and we opted to leave it be.

If you have any ideas on how to successfulyl upgrade wihtout killing anything, or know of a link or somethign to that info, it owuld be greatly appreciated

Thanks Again.
 
Well, after some extensive trial and error, I found that I only needed a vhost_ssl.conf file since I was only changing the SSL configuration directives.

Anyhow, below is the vhost_ssl.conf file, in case anyone else is having this problem too:

Code:
DocumentRoot /home/httpd/vhosts/example.com/httpdocs
<Directory /home/httpd/vhosts/example.com/httpdocs>
<IfModule sapi_apache2.c>
	php_admin_flag engine on
	php_admin_value open_basedir "/home/httpd/vhosts/example.com/httpdocs:/tmp"
</IfModule>
	SSLRequireSSL
	Options +Includes +ExecCGI
</Directory>
<Directory /home/httpd/vhosts/example.com/web_users>
<IfModule sapi_apache2.c>
	AddType text/plain .php .php4 .php3 .phtml
	php_admin_flag engine off
</IfModule>
</Directory>

Thanks again.
 
Glad you found it. Plesk 7.5.3 should not trash the box, it was an unaddressed problem during the upgrade.
 
I'm on PLESK 7.5.2 and need to redirect httpsdocs to httpdocs.

I edit the vhost_ssl.conf as follows:

DocumentRoot /home/httpd/vhosts/example.com/httpdocs
<Directory /home/httpd/vhosts/example.com/httpdocs>
<IfModule sapi_apache2.c>
php_admin_value open_basedir "/home/httpd/vhosts/example.com/httpdocs:/tmp"
</IfModule>
</Directory>

I figure the vhost_ssl.conf only overrides settings already defined in httpd.include, so only required to add params that are different from the default settings in httpd.include.

Anyways ... saved and reconfigured vhost and restarted apache. Now when i go to an https I get a popup asking if i want to download the file or view it. In other words, the file doesn't render in the browser as normal.

Any ideas?
 
Back
Top