• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Problem changing root of subdomain in plesk 11.5 with apache+nginx

javismiles

Basic Pleskian
dear friends,
im a bit desperate about this issue, i hope you can help me

I have a centos 6 , plesk 11.5 latest version all updates in,
i have a domain.com set on /var/www/vhosts/domain.com/httpdocs

now i have created a subdomain secure.domain.com, with cname pointings to main one (secure->domain.com) , i need it to point to same folder than main domain so i pointed it to the main folder of domain.com by
creating a custom vhost.conf for apache and that works great, as i see htaccess is getting processed so i assume apache is now pointing correctly

but nginx is pointing still to wrong folder, logical as i can see that the last_nginx.conf file is pointing to wrong place

so i found the thread http://forum.parallels.com/showthread.php?260814-Nginx-configuration-for-vhosts
and i followed the indications there but its not working for me,

- i have edited a file nginxDomainVirtualHost.php
on /usr/local/psa/admin/conf/templates/custom/domain
after copying from the default folder
and i added this as you indicated
<?php if (file_exists($VAR->domain->physicalHosting->vhostDir . '/conf/nginx.conf')): ?>
include <?php echo $VAR->domain->physicalHosting->vhostDir;?>/conf/nginx.conf;
<?php endif ?>

just i wasnt sure where to add it, i added it at the very end before the last }

and then i added an nginx.conf inside
/var/www/vhosts/system/secure.domain.com/conf

and inside i just put
root "/var/www/vhosts/domain.com/httpdocs"

and then i did of course the /usr/local/psa/admin/bin/httpdmng --reconfigure-all
but nothing happened

when i go to secure.domain.com i keep getting 404 nginx errors,
however the apache is pointing to right place because the .htaccess of main folder is getting processed, so apache all good,
but all php and non php pages are failing with 404 nginx errors still

i now tried something different, in plesk 11.5
i went to web server settings of the subdomain
and in extra nginx directives i added
location ~ /$ {
root /var/www/vhosts/domain.com/httpdocs;
}

and then restarted nginx
and now something changed

now when going to secure.domain.com instead of getting a 404 not found,
i get a 403 forbidden

other than that if i try
secure.domain.com/index.php i still get 404 error and same for other files

but now i get a 403 instead of 404 when going to the bare secure.domain.com

other than that i am very puzzled because if i try to go to some php files, the php files get downloaded to the client which is disastrous as people could get the php files from the server,
why are they getting downloaded to the client?


thank you for any help, really appreciate it
best
 
nginx root change in extra nginx directives of plesk 11.5 fails partially

i redirected secure.domain.com changed its root in extra nginx directives in plesk 11.5 to point to the folder of its main domain
and

* When i go to secure.domain.com i get a 403 forbidden:
2014/03/21 23:37:19 [error] 1238#0: *306 directory index of "/var/www/vhosts/domain.com/httpdocs/" is forbidden, client: 50.136.240.224, server: secure.domain.com, request: "GET / HTTP/1.1", host: "secure.domain.com"

* but When i go to any page inside secure.domain.com, for example secure.domain.com/index.php then i get a 404 not found
2014/03/21 23:36:16 [error] 1238#0: *306 open() "/var/www/vhosts/domain.com/secure.domain.com/index.php" failed (2: No such file or directory), client: 50.136.240.224, server: secure.domain.com, request: "GET /index.php HTTP/1.1", upstream: "http://198.50.154.201:7080/index.php", host: "secure.domain.com"
[root@domain nginx]#

what is happening is that when going to secure.domain.com then its picking the root change of the extra nginx directives in plesk

but when going to secure.domain.com/anypage.php
then its reverting back to the old subdomain root and not applying the new one i added in the plesk nginx extra directives

so i have 2 problems,
one is the 403 forbidden error
and the other is why is applying new root only on bare domain and not in pages inside
 
Back
Top