403 for Apigility and Cpanel - rest

For some reason, I'm getting a weird 403 issues when I use ZF2 + apigility + Cpanel. I do not know where to look!
I have the same code running on my local machine and an aws server. Both do not have the 403 issues when trying to authenticate using Oauth2.
But, once I moved my code to my client's machine that is running on Cpanel. I have been getting this 403 issue. Initially, I thought it might be a permission issue, but that is not it. The only thing that is different is probably server.
So, I'm guess the problem would be related to security settings.
Please advice what are the possible security settings that might be causing this problem...

If you have managed an error log, start by checking it in order to know exactly why you're getting that 403 issue.
I thought it might be a permission issue, but that is not it
This kind of issue could also be caused by a corrupted .htaccess file. Make sure the htaccess folder could be read.
Or may be you have to add RewriteCond to your main domain's rule :
RewriteCond %{HTTP_HOST} !^(www\.)?addon_domain\.com
where addon_domain should be replaced by the actual domain name.
But for better help, I think, you might do better to ask your host.

Related

Concerning Magenta 1.9. - “Invalid Form Key. Please refresh the page“

I have a problem with the Safari browser complaining about unsecure transfer when adding products to the basket and fails. So, I sat the unsecure transfer to https in configurations. That helped for Safari but now I can’t log in to the Magento admin. I get: “Invalid Form Key. Please refresh the page“.
In phpMyAdmin > core_config_data I changed the unsecure transfer back to http. That didn’t help so I deleted the whole site from the server and uploaded a one-week old backup, but I still got the same error. Finally, I have deleted the backup and uploaded the original. And of course, still have the error.
I have emptied var/session, var/cache and var/reports and flushed my own cache and deleted cookies.
I have found technical solutions as https://www.tigren.com/magento-error-invalid-form-key/, but I’m a novice and on top of that not a programmer.
Now, when I try to address the site via phpMyAdmin I get “mysqli_real_connect(): (HY000/1045): Access denied for user 'username'#'localhost' (using password: YES)”.
When everything else fails for me I can e-mail the host company to work on the server. But what to write?
Could a professional please walk me through a solution?

Server logs: Looking for endless redirect Loop

One of my Drupal websites homepage (just the homepage) is constantly redirecting when the site is visited. Tends to happen randomly. Which I don't understand why it would do this. I talked a bit on the Drupal community and it is said to be a server issue. Not Drupal.
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
I don't currently have CPanel access to check the server logs though. I am somewhat fluent in terminal and I have root SSH access to the server.
Where and what commands would I have to run to find and access the logs that could possible help me figure where to start with fixing this? Would they just be located in /var/? What would I be looking for once I get access to the logs, just a steady stream of the duplicated IP address that it keeps being redirected too?
Found out this IS a Drupal Commerce Kickstart core issue.
Found follow errors in php logs:
PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini
PHP Fatal error: Unsupported operand types in public_html/dev/profiles/commerce_kickstart/modules/contrib/search_api_db/servic‌​e.inc on line 970
Got the redirect loop to stop after increasing the max_input_vars to 9000. I feel it's more of a bandaid fix though. So I'm taking this further into the Commerice Kickstart community.

Unable to get login page in Moodle

I am unable to get a Login page after Moodle 2.5 installation got over. it throws following error
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
I will be more helpful if anybody gives me an answer.
Assuming this is a fresh install?
I would first check this setting is correct in config.php - something like
$CFG->wwwroot = 'http://localhost/yourwebname';
or
$CFG->wwwroot = 'http://www.yourdomainname.com';
If those are correct then clear the cookies in the browser for the specific domain.
And maybe clear the Moodle cache. From a terminal, go to your web directory
cd /var/www/moodle
Then run
php admin/cli/purge_caches.php
http://docs.moodle.org/25/en/Administration_via_command_line#Purge_caches_via_CLI
I had this same issue (except with XAMMP, and Moodle 2.7, but my guess is the same issues are at play). The solution at https://moodle.org/mod/forum/discuss.php?d=239793#p1115879 worked for me.
Basically, delete the contents of moodledata\cache (just use explorer, no need for any CLI stuff), and increase max memory in php.ini (should be wamp\php\php.ini) from 128M to 1024M, then try loading the page again.

Mercural ACL groups causes 502 error

I am setting up my mercurial repo using the ACL extension. When I configure the ACL.deny section I am trying to deny a specific group of users. When blocking them individually ACL works as intended and aborts their change sets. However, when trying to add all these users to one group, and then block the group Mercurial gives a 502 Bad Gateway error.
When looking through my IIS logs I get no meaningful error message, and at this point am basically stuck. Does anyone have experience with this, or have an idea on what could be causing this?
Does the 502 error and the setting up of groups have anything in common, or is that misconfiguration of our IIS or SSL? I have looked and have seen no versions of this problem before, so I am thinking it is not a mercurial issue, but am asking for help with diagnostics.

How to configure MAMP to serve perl CGI scripts (NOT localhost!)

I'm using MAMP-pro to serve my domain to the outside world.
I'm not a very experienced sys-admin, though I've slogged my way through a few basic things. I know what apache is, and I can read-most-of but not generate-without-guide related .conf files.
I've got a perl script which I've tested from the command line and it works (outputs as desired.)
When I try to access said script from the browser, I get 404.
I've tried placing the script at:
/Users/me/Sites/mydomain.com/htdocs/mycgi.pl
/Users/me/Sites/mydomain.com/cgi-bin/mycgi.pl
/Users/me/Sites/mydomain.com/htdocs/cgi-bin/mycgi.pl
and accessing it as:
http://www.mydomain.com/mycgi.pl
http://www.mydomain.com/cgi-bin/mycgi.pl
and all the various combinations, all to no avail (404.)
The script and its container directory have permissions 755.
So, what other steps am I missing? Are there any good set-up guides? I tried the MAMP-Pro manual, but it is filled with such information as "the cancel button cancels the current operation" and not really anything useful. Google turned up several hits that all seem to talk about how to make this work on localhost, but I'm trying to serve this to the outside world.
Any hints?
Thanks!
The official online documentation has a section on virtual hosts. When creating a host for www.mydomain.com you can choose the DocumentRoot which is called "Disk location" within MAMP PRO. If you still get a 404 error, take a look into the error_log for a more specific reason (i.e., where Apache tries to find the file in question).