CakePhp, Xampp & SSL "Internal error has occured" - cakephp

Im trying to set up an SSL connection on my localhost XAMPP. Ive done this before, and had it working, but this time around I have trouble with the SSL connection I guess, cause I doubt its about the code since it was something that worked on before. And there have not been any changes since then. Im using virtual hosts with SSL on only one page. When I try and connect to it, it shows me an error on cakephp, but gives me no information about what the error is. Here is a Screnshot:
Also On my Xampp I have the next configuration for it to work with SSL:
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot "C:\xampp\htdocs\Bebe2go api"
ServerName bebe2goapi.com
SSLEngine on
SSLCertificateFile "C:\xampp\apache\conf\ssl.crt\server.crt"
SSLCertificateKeyFile "C:\xampp\apache\conf\ssl.key\server.key"
<Directory "C:\xampp\htdocs\Bebe2go api">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Im using a Shopify login plugin for the login and calls to Shopify. Right now its not working, but Im not sure why this is happeing. I dont think the error is on the code, but Ive tried quite a few options with no luck at all. Any ideas where I could start to look for a solution for this?
A quick side note here: The favicon from the page is being replaced by the Xampp favicon. Instead of the normal Cakephp icon which should show. Im not sure if this has anything to do with the trouble im haveing. But its worth noting.
If you need any more information please do ask :D
EDIT:
Acutally I just noticed, I get the next error on the cakephp errorlog:
2016-04-13 00:25:16 Error: [CurlException] SSL certificate problem: unable to get local issuer certificate
Request URL: /shopify/install?code=a547ef8d8ceb1470f89a23bd4318fa4d&hmac=c95ccf2fc00221b4e1f15acb645ab7009bcf99ba0bf2eb399c3e105184bdeaad&shop=bebe2go.myshopify.com&signature=f1df3f9788935385932ff577961dcf70&timestamp=1460499916

Ok I just solved my problem, hehehe Apparently I was not pointing to the curl.cainfo from the php.ini wasnt pointing to the right direcction. This made the problem harder to solve cause the error didnt include a description for this error. All I had to do was put the right URL on the curl.cainfo in the php.ini from my xampp program and presto.
The rest was done right.

Related

React.js and folder access denied for user

I don't know if there is any type of post like this one here on StackOverflow but I just wonder how do I make so people who visit my site can't get access to "ip/folder names".
If it for some help I use react.js and I know some people use the .htaccess file but it doesn't work for me or maybe because I do it wrong. I am kind of new of this sort of things.
Error page
I want actually do so if people visit some page/folder or file they come to a page it says "404 page error"
To be able to use .htaccess files depends on how the apache configuration is done on your server. A .htaccess file needs permission to be able to override standard web configurations. If you want to set that up and use them you can try:
sudo vim /etc/apache2/sites-available/default
Then make sure the line AllowOverride has the value All. That means local .htaccees files are allowed to override.
<Directory /var/www/>
...
AllowOverride All
...
</Directory>
Save and restart the service
sudo service apache2 restart
In your .htaccess file you can add following for creating an custom error page
ErrorDocument 404 /my_custom_error_page.html
Here you can read more about writing .htaccess files
https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file
Hope that helped a bit.

Apache localhost authentication

I am trying to setup up basic authentication to a folder on my localhost running apache. Currently the app runs fine without authentication. I have setup a virtual host so I can access my application through dev.myapp.com
The code I add to my .htaccess file to force authentication is:
<Directory "/Users/myusername/Sites/dev.myapp.com">
AuthType Basic
AuthName Test
AuthBasicProvider file
AuthUserFile /etc/apache_users
Require valid-user
</Directory>
I have created a user.
When I type dev.myapp.com into the browser I get an internal server error. I am fairly new to apache. A point in the right direction would be appreciated.
Thanks.
First off, using .htaccess is a bit slower and requires that you have set the AllowOverride directive accordingly. It is recommended that you instead use httpd.conf to establish basic authentication. The Apache documentation explains all of this so check out this link http://httpd.apache.org/docs/2.2/howto/auth.html.
Regardless, I think I see the error. Your <Directory> tag looks a little odd. I understand the name of your site is dev.my.app.com but is that the actual name of the folder where the site dev.myapp.com points to on your server? Your httpd.conf file should have an entry like this:
<VirtualHost *>
DocumentRoot "document/root/path"
Other directives here
</VirtualHost>
The DocumentRoot is where Apache directs all incoming web traffic. If you are trying to establish authentication for your entire site, the value of DocumentRoot is most likely what you would want in your Directory tag ... making it <Directory /document/root/path>.
To locate httpd.conf look in in /etc/apache2/. Make sure to restart your server after you change the file (sudo /etc/init.d/apache2 restart). Hope that helps, please update if you haven't already resolved the problem.

XAMPP with an error message

I have a problem that i cannot to resolve it.
I think this is a XAMPP problem.
When i'm trying to open my website on localhost i have this message :
No such file or directory
When i try to open another on localhost it run without problem.
Can you say me what is the problem please ?
Assuming you are accessing the right resource from your uri Do the following
In the file
\xampp\apache\conf\extra\httpd-xampp.conf
search for "LocationMatch".
Once you find it, make a change to the “Deny from all” to have a # in front of it. See code below.
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
#Deny from all
Allow from ::1 127.0.0.0/8
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

Can't access files in a subdirectory using Apache server

I have an Apache 2.2.21 server installed on my Windows 7 machine.
My site is up and my scripts from /scripts subdirectory are working but when I try to load icons from /icons I get a 403 forbidden error.
I've already added this to my httpd.conf file:
<Directory "c:/wamp/www/icons/">
Options Indexes FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
Still no effect. So the question is: how can I access files in my /icons subfolder?
P.S.: Using /images subdirectory worked out just fine but the question still remains.
I figured out that /icons/ was included as an alias for some other directory. For me, configuration file was located at:
C:\wamp\bin\apache\apache2.2.21\conf\extra\httpd-autoindex.conf
I had to comment out this line:
Alias /icons/ "c:/Apache22/icons/"
Have you checked the Windows permissions on the /icons directory, and made sure that the Apache user can read that directory? Is there possibly an .htaccess file in the picture?
Edit: Okay, so it's not permissions. My next guess is this: your config above says "everyone is forbidden access except when they're coming from 127.0.0.1". But you're on Windows 7. Windows 7 tries to be helpful and modern - and often tries accessing via IPv6 first. So you might show up as coming from ::1, which is probably failing to match 127.0.0.1. Try turning off IPv6 or adding an Allow from ::1 directive.
Ok so if your httpd.conf doesn't do anyhting you should restart apache. Any changes done to documents have to be restarted so Apache can "Refresh".
<Directory "c:/wamp/www/icons/">
Options Indexes FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
So above this is your code. It basically says in line 4 that Apache should deny connection from all incoming connections connections to the /icons/folder.
Also on line 5 it says to allow incoming connections from only 127.0.0.1 or localhost. So basically the server has access to it!
If changing it doesn't work you should look in .htaccess. Another option is just to copy the Code from a folder that works and paste it and just change the paste from EX:
"C:/WAMP/www/images/" to "C:/WAMP/www/icons".

ProxyPassMatch directive problems

We have an environment with Apache 2.2.11 acting as front end to incoming connections to a Tomcat backend server. We are using the following directives in the http-ssl.conf, which works great when not trying to catch 403 errors:
SetEnvIf COMPANY EDLP 4.0.1 NLEDLPKEY=true
General setup for the virtual host
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost:443
ServerAdmin admin#localhost
ProxyRequests Off
ProxyPassMatch / htp://tomcat.company.com**<-- been having issues with this directive (using only one "t" in http to bypass this sites new user can only post one URL per question limitation**
ProxyPassReverse / htp://tomcat.company.com
As you can see we are using the mod_access (now called mod_authz_host in Apache 2.2) module to pass a variable called NLEDLPKEY so that only (Internet Explorer) clients with this variable could access Tomcat via SSL. Also, I am trying to not only reverse proxy SSL connections, but also to redirect the 403 errors (for people without the variable) to a specified page (error_page.html). I have tried:
ProxyPassMatch "^[^(/error_page.html)]" htp://tomcat.company.com and also tried
ProxyPassMatch “^(?!/error_page.html)” htp://tomcat.company.com
to see if it is possible to redirect to the error page and not get the below message:
Forbidden
You don't have permission to access /RDS on this server. <--RDS is just a directory-->
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 Server at apache-company Port 443
Any help would be appreciated
R.
I ran into this issue recently - it took a bit of hunting but here's how I fixed it:
In /etc/apache2/mods-available/proxy.conf (Ubuntu - YMMV) change it to look like the following:
<Proxy *>
AddDefaultCharset off
Order deny,allow
Deny from all
Allow from all
</Proxy>
It's also important to note that for reverse proxies, it is not necessary to have ProxyRequests On configured and doing so in conjunction with Allow from all is hazardous. (Can be used by spammers to send mail via your proxy.)

Resources