Control Web Panel

WebPanel => Apache => High Performance => Topic started by: palts on February 27, 2019, 02:36:55 AM

Title: 403 forbidden in subdomain or secondary domain
Post by: palts on February 27, 2019, 02:36:55 AM
Hello, in a fresh installation of CWP the webserver was configured with Nginx & Varnish & Apache (PHP-FPM)

The default domain was configured and wordpress was mounted on it. Everything works OK.

But ... when trying to install wordpress in a subdomain there are problems with the permalinks, showing error 404 and if I load a .htacces file with the wordpress rules, I get error 403 forbidden.

Anyone know what can it be?
Title: Re: 403 forbidden in subdomain or secondary domain
Post by: Netino on February 27, 2019, 03:13:46 AM
You must check you log files before you load your .htaccess file, and see for what files they are pointing.

Regards,
Netino
Title: Re: 403 forbidden in subdomain or secondary domain
Post by: palts on February 27, 2019, 11:41:35 AM
You must check you log files before you load your .htaccess file, and see for what files they are pointing.

Regards,
Netino

Thanks Netino!, what logs specifically?
Title: Re: 403 forbidden in subdomain or secondary domain
Post by: Netino on March 03, 2019, 03:53:53 AM
The logs of the webserver you are using.
You are using Apache webserver, but although you are using nginx as just a reverse proxy, per si nginx can return code "403" too.

So, I would recommend all of these logs, in this order:
=================================
1) /usr/local/apache/domlogs/domain.error.log
2) /usr/local/apache/domlogs/domain.log
3) /usr/local/apache/logs/error_log
4) /usr/local/apache/logs/access_log
5) /var/log/nginx/error.log
6) /var/log/nginx/access.log
=================================
Title: Re: 403 forbidden in subdomain or secondary domain
Post by: palts on March 04, 2019, 12:40:08 AM
Thank you very much for your help!

Finally I deleted this line in the vhost (apache) in the domain configuration and it worked.  ;D

<Directory "/xx/xx/xx">
   Options -Indexes -FollowSymLinks
   AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
Title: Re: 403 forbidden in subdomain or secondary domain
Post by: studio4host on March 04, 2019, 10:05:36 AM
this is a security issue when you remove that config, you have instruction how to do that properly on the cwp wiki

http://wiki.centos-webpanel.com/options-followsymlinks-not-allowed
Title: Re: 403 forbidden in subdomain or secondary domain
Post by: palts on March 04, 2019, 03:13:42 PM
this is a security issue when you remove that config, you have instruction how to do that properly on the cwp wiki

http://wiki.centos-webpanel.com/options-followsymlinks-not-allowed

Thanks!!!, it worked perfectly with this fix.