Internal Server Error for magento site - hosting

New sub domain creates for Magento site and gets this error.
[error] [client ] Soft Exception in Application.cpp:256: File "/index.php" is writable by group
Htaccess code :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Just you need set permission to index.php
set permission 644 to index.php

Htaccess Issue
Htaccess file which is located at Magento root folder. It will be this case if you meet Internal Server Error on every page. Try to remove it for testing purpose If your website was running file for a long time, then it must be a change at Server side, just submit a ticket to Hosting Company.
MEMORY ISSUE :
You should use at least 256M for over 600-700 SKUs. Magento is very resource hungry and it is easy to get these kind of errors if you try to save some bucks from the hosting.
Note: 1and1 server changed the permission of the /app folder to 755. Fixed the problem by changing it back to 775

Look in the Magento bootstrap file (index.php), you’ll see lines similar to the following:
#Mage::setIsDeveloperMode(true);
#ini_set('display_errors', 1);
Uncomment these. In a production system, you’d never want to have your errors display to the browser, but while developing having an errors and warnings thrown immediately in your face is invaluable. This way, you will see the actually problem which lead to the Internal Error Server. In almost cases, the reason is that there is an exception throw after output is sent to browser.
Solution #1
This error might be caused because you have not set the correct permissions for the magento folders. To solve this go to File Manager and then change the file permission of index.php file from 664 to 644.
Solution #2
If you are getting weird 500 internal server errors on specific pages of your site, it might be a matter of resources. I was getting internal server erros on some product pages and on the http://yourdomain.com/checkout/onepage. I found out that the .htacess file of my magento installation was somehow reset and the php_value memory_limit value was set to 32M as soon as I raised it, the internal server errors vanished! You should use at least 256M for over 600-700 SKUs. Magento is very resource hungry and it is easy to get these kind of errors if you try to save some bucks from the hosting.
Solution #3
Htaccess file which is located at Magento root folder. It will be this case if you meet Internal Server Error on every page. Try to remove it for testing purpose.
If your website was running file for a long time, then it must be a change at Server side, just submit a ticket to Hosting Company.

Related

Silly 404 page usage?

Alright, so the only way I know of changing links to not show the file extensions;
this yourwebsite.com/customlink.php to yourwebsite.com/customlink
is either creating a folder called customlink and shoving an index file in there. Or creating a 404 page which snoops around the URL and grabs whatever string is behind the last / and does whatever to show the proper content.
My question is if this way of solving the problem is straight out idiotic, or not? I'm doing this because in my mind it saves space, let me explain: Every page that needs a customlink are the same with some bits and content taken from other places, so instead of creating X amount of folders and index files that includes a main file, I'll just have one 404 file that can handle it.
I apologize in advance if this is really stupid
As you are not mentioning what server your pages are running on (Apache, IIS, ...?), I'll just assume Apache.
Put an .htaccess file into the root of your site with the following content:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
It will internally rewrite everything without an extension to the corresponding php file, provided that:
the request is not a valid directory
a file with a php extension is in fact present
A more common approach is to route all HTTP requests to a single index.php using mod_rewrite in a .htaccess.
Then, based on the requested resource, the index.php outputs the appropriate file, whether it is generated from a database or nested in some other folder.
It's probably not a good idea to use a 404 page (an error page) for anything other than "File Not Found" instances.

Migrating a CodeIgniter site to a different domain and moving the whole thing down one level in directory

I am working on a site, which is built with CodeIgniter.
I have never used the framework before...I've learnt a little bit in the last couple days but really cannot solve my problem.
I have downloaded the site and I want to upload it to my own domain so not to make changes to the live site before testing.
the original site is example.com.
I want to upload it to mysites.com/examplesite (this will be the base - I use this domain for all my clients' test sites).
I have moved all the files and the database is in place.
I have found the database configuration file and have successfully edited it.
I am having trouble getting the site to work, I think it must be because of the site now being down a directory level.
I have edited $config['base_url'] so that it is correct...I am pretty sure it is correct because I can now reach the homepage where I couldn't before editing that variable. But, i can only reach the homepage - when I click on a link to another page, I get 500 error Internal server error.
Does anyone have a quick fix for me?
Thanks!
Keep this code on your project's root .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /examplesite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

Code igniter - 404 not found, routes issue, ssh server

So first off, I am pretty familiar with codeigniter I've used it for multiple occasions. Right now I have a project too do for school and I installed codeigniter on the server but I am getting routing issues I believe.
So additional info about the server which is different from the normal environment I work with, the server uses SSH and it is very weirdly protected in my opinion. You also need a username and password to view the URL in the first place. (I think it's weird)
If this helps the url is:
https://clipper.encs.concordia.ca/~pyc353_2/
and credentials are (username: pyc353_2, password: FMaqRb)
Now I am able to see any page that I set as my 'default_controller' in the routes, but the problem is trying to go to any other page. Right now I'm trying to access the register controller and I just get 404'd (while it works if I set it as default)
I will link all the code I think may be relevant to the error, hopefully it's not server settings since I have no control over any change.
config.php
$config['base_url'] = 'https://clipper.encs.concordia.ca/~pyc353_2/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
routes.php
$route['default_controller'] = "test";
.htaccess (there may be better code for doing this but I used it in the past no problem and the route doesn't work even if I remove htaccess and add back index.php to 'index_page')
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
</IfModule>
So I tried accessing my pagedifferent variations in the url such as: (stackoverflow won't let me post more than 2 physical links)
clipper.encs.concordia.ca/~pyc353_2/register
clipper.encs.concordia.ca/~pyc353_2/index.php/register
neither work although with /index.php/ the error message is: "No input file specified."
So I hope my explanations are clear enough, it's hard to explain something I don't understand the source problem. If you need any additional info feel free to ask. I really need to solve this to proceed at all for my project.
EDIT
I don't know if this is relevant but the 404 message is not even in the codeigniter style it just looks like a plain web 404
Also I am looking at the path on the server and this is the hierarchy: /www/groups/p/py_comp353_2 I don't know if that could affect anything also?
NEWER EDIT
Following what I found here: http://ellislab.com/codeigniter/user-guide/installation/troubleshooting.html
Changing index.php to index.php? (and removing htaccess) actually did make the routing work. Now I am happy enough with this and I can continue working, but being that it's an ugly solve would anyone know how to keep the routing working AND remove the index.php? from my URI?
It appears that your htaccess is not working.
To confirm, create a new PHP file and write this line:
echo phpinfo();
On that page try to search for "mod_rewrite", if it is enabled, you will see it under "Loaded Modules"
It is probable, it is not enabled.
Try this on your server:
a2enmod enable
Then restart the apache server.
For restarting on debian, this should work:
service apache2 restart
For CentOS, this should work:
apachectl restart
That always does not solve the problem.
Even then, try your CI installation in the normal mode after that. (With everything in normal mode: htaccess as before, and no index.php in the URL)
If it does not work, you may need to alter the apache config file httpd.conf
Try to search for this line:
#LoadModule rewrite_module modules/mod_rewrite.so
Uncomment it by removing the # sign
Restart Apache Server.
Test it now, again.
There could still be other things that you could do to enable mod_rewrite.

Magento Godaddy No file input specified

I have Linux webhosting on Godaddy. I tried installing Magento CE 1.8 on subdomain for more than a week and I still cannot get it to work.
Before you say this question is duplicit, I have tried everything I found on Magento Wiki, Forums, Google and Godaddy forum and support and I still cannot get it to work.
For php5.ini I take Magento php.ini.sample, .htaccess is from Magento too.
Using Options -MultiViews in .htaccess usually doesn't do anything.
Settings cgi.fix_pathinfo = 1 in php5.ini creates cyclic redirect.
I have tried playing with RewriteBase in .htaccess and that didnt help either.
I read that Magento doesnt run on fcgi, so I use in my .htaccess, doesnt help either:
Options +ExecCGI
addhandler x-httpd-php5-cgi .php
I always end up with "No file input specified" or cyclic redirect or server error.
Only lines in error log that I see are added:
[Thu Oct 31 01:23:08 2013] [11988011] [negotiation:error] [client 5.178.58.85:65433] AH00687: Negotiation: discovered file(s) matching request: "path" (None could be negotiated).
But I dont know what that does mean or how to fix that.
So is there anything else I can try or am I missing something? I know Magento on Godaddy shared hosting isnt a good idea, but I need to get there my development running and production will run on my clients Dedicated server.
Add this to your .htaccess file and forgot those other fixes....
RewriteRule ^index.php/(.*)$ [L]
If magento lies in a subdirectory then use:
RewriteRule ^index.php/admin(.*) {RewriteBase}/admin$1 [L]
So I managed to solve it after few weeks of trying different solutions on net and trying to get support to help me.
Nothing helped solve it so I tried myself and found out that the problem is "index.php" in url. So I have created simple php function which is run in at the beginning of index.php file. This function removes "index.php/" from url and redirects to this new url.
Also to remove "index.php" from form actions and other places where the url might show up, it is good to create your own router module or modify Magentos router.
Now it all works.
PS:
I have also kept other fixes in place:
In .htaccess:
Options +ExecCGI
AddHandler x-httpd-php5-cgi .php
AddHandler x-httpd-php5-cgi .php5
Options -MultiViews
RewriteBase /
And in php5.ini
cgi.fix_pathinfo = 1
EDIT
What I wrote does work, but is not good solution, redirect in index.php loses all POST data ofcourse. And looking at Magento and changing router takes too much work, so in the end I managed to create working rule in .htaccess for admin. Just put it as last rewrite rule in your .htaccess:
RewriteRule ^index.php/admin(.*) /admin$1 [L]
EDIT
Forgot to write here, that I have changed the rewrite to this:
RewriteRule ^index.php/(.*) /$1 [L]

How can I redirect image 404 error on Amazon S3 to my own server

Is it possible to redirect a 404 error on Amazon S3 server to my own server? Here's the case in my website:
A user uploaded a file, called abc.jpg. I have a set of image types, such as crop or thumb.
When someone access /img/abc.crop.jpg, the webserver check and look for the file /img/abc.crop.jpg. If they found it, webserver will throw the file.
But when the program can't found that file, this .htaccess file will route it to a program:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
So it will go to index.php/img/abc.crop.jpg, where the "img" controller/program will look for abc.jpg and generate a file called abc.crop.jpg on the img folder. So next time another user access the abc.crop.jpg, the program doesn't need to regenerate the file anymore.
Now, when I am using the Amazon S3, I have to generate ALL the different sizes (crop, thumb, etc) one by one to avoid 404 error. The purpose of the above technique is to conserve space. I wanted the flow to be kept consistent with the current condition. Anybody have any idea on how to manipulate S3 404 error so that they'll redirect to my server? Ie. http://bucket.s3.amazonaws.com/img/abc.crop.jpg redirect to http://mysite.com/img/abc.crop.jpg ?
This is my workaround to identifying the 404 error.
Enable S3 web service
Configure the Error Document to a file-not-found.jpg
$result = $s3->getObject(array(
'Bucket' => 'my bucket',
'Key' => 'path/to/file'
));
Use md5 or crc32 to identify if the returned object is file-not-found.jpg
Redirect to your own server
If you're using codeigniter, have a look at the reserved routes http://codeigniter.com/user_guide/general/routing.html. you can specify a specific controller for any 404 error.

Resources