Hot answers tagged

12

I wouldn't delete all sessions, start with the older ones first. Since the quote is valid for 30 days you could try going with that. In your var/session folder. find . -mtime +30 -exec rm {} \; This will find all files older then 30 days and delete them. Optionally you can run this as a cronjob, do remember to replace the dot with the full path to the ...


11

You can safely delete the files in the following folders: /media/import /var/report Besides of that you can also remove old session files by using find /path/to/magento/var/session -name 'sess_*' -type f -mtime +7 -exec rm {} \; Removing old session files can already have a performance impact. For improving the performance of you Magento installation ...


8

While it's ok to remove /www/media/catalog/product/cache it's where Magento stores resized images and doing it on a live site will cause a slowdown while Magento recreates all those cached images so it doesn't have to recreate them 'on the fly' whenever it needs to serve them out. It's better to expire out cached images older than X days as removing product ...


4

try to run: php bin/magento setup:static-content:deploy --area adminhtml


4

The default path is determined in Mage_Catalog_Model_Product_Media_Config::getBaseMediaPath(). By default it looks like this: public function getBaseMediaPath() { return Mage::getBaseDir('media') . DS . 'catalog' . DS . 'product'; } Rewrite the class and change it to what ever you need. But you will also have to change the mehtod ...


4

This is a web server setup issue. Since the server software being used isn't identified, I will leave it up to you to find the settings if you are not running Apache. The following setting needs to be made in .htaccess to stop directory listings Options -Indexes


3

The docs you linked are for Magento 2. It is ideal to not allow any access to cron.php via HTTP, as it is the default since Magento 1.9.2.2, and execute it only via CLI and system crontab. If for some reason you cannot to that, an IP whitelist is a valid alternative.


3

When you extend any file ( which is in vendor/magento/module-x folder ) its path is always start with \Magento\X so in your case if you are extending file from module-shipping then its path would be \Magento\Shipping\. so here you will see module is replaced with Magento and module name will be named with first letter capital i.e shipping will become ...


3

In addition to @mhauri's answer I'd like to add: Check your var/log directory if the system.log or exception.log files are big. You should have a look at the issues in there before you empty the files.


3

When cloning stores, I often exclude, /var/log /var/session /var/cache /var/full_page_cache /var/report /var/tmp /includes/src/ /media/catalog/product/cache /var/backups


2

To prevent access to a non-Magento related directory like /vendor, you can just deny access from everyone except your own IP addresses by adding the following to your .htaccess file:- order deny,allow deny from all allow from X.X.X.X allow from X.X.X.X allow from X.X.X.X As for the /media directory, you can't block it as otherwise media images in your ...


2

Use .htaccess and configure and test something long these lines: order deny,allow deny from all allow from 192.168.1.5555 or you could use Mod_rewrite RewriteEngine On RewriteCond %{REMOTE_ADDR} !^192\.168\.1\.5555$ RewriteRule .* - [F] However, as Sander pointed out in the comments above, if you block access to /media/ no product images will be ...


2

First verify that it's really a problematic amount of session files: ls -U1 | wc -l is a fast command to give you the number of files in the current directory Then only delete old session files, otherwise you'll log out all customers and empty the cart of all guests (see answer by Sander Mangel) Also have a look at other directories in var. This command ...


2

if you looking for path for Magento core modules, you could check on this folder : <magento_root>/vendor/magento/* especially for the module that you mention \Magento\Shipping\Model\Carrier\AbstractCarrier you could get that class file on this path<magento_root>/vendor/magento/module-shipping/model/carrier/AbstractCarrier.php


2

In your custom module [Namespace]/[Module]/view/frontend/requirejs-config.js add this var config = { map: { '*': { 'Magento_Ui/Magento_Ui/js/view/messages.js':'[Namespace]_[Module]/js/view/messages.js' } } }; your overridden js file should be here [Namespace]_[Module]/view/frontend/web/js/view/messages.js run below ...


2

The SUPEE-6788 and Magento 1.9.2.2 both updated .htaccess to control access to cron.php by both default denying access and giving a recommendation on how to set up password access. ########################################### ## Deny access to cron.php <Files cron.php> ############################################ ## uncomment next lines to enable ...


1

Depending on how much images the store has and whether they are important, I would exclude whole /media


1

A way to do it : RewriteEngine on RewriteCond %{REQUEST_URI} ^/account RewriteRule ^(.*)$ /store/customer/account/login/ [P] It use P Proxy flag (which implies L flag too). To use it, make sure you have mod_proxy_http and mod_proxy enable. a2enmod proxy_http a2enmod proxy service apache2 restart These last commands can depend of your OS. ...


1

The easiest way is to use a version control system like Git and commit the files to a repository (GitLab and BitBucket offer free private repository hosting if you don't want to pay for GitHub). Then set the store up the way you want and export the database. Then you can import the database to your production server and do a Git checkout on your code ...


1

You should place the images in the skin folder under the base/default theme. skin/frontend/base/default/images/{your_extension_name}/image.png. Then access it as: <img src="<?php echo $this->getSkinUrl('images/{your_extension_name}/image.png')?>" alt="" /> If the image is for admin section, then store it in skin/adminhtml/default/default/...


1

--area (-a) Generate files only for the specified areas. The default, with no option specified, is to generate files for all areas. Valid values are adminhtml and frontend For admin php bin/magento setup:static-content:deploy --area adminhtml Documentation Link


1

You can't overwrite .php files using theme, you have to create new module in app/code/Vendor/Module, and create an etc/di.xml file inside this module. This should be inside di.xml file: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config....


1

Is it ideal to IP protect the Magento cron.php? No. You shouldn't ever be executing cron.php directly, whether by CLI or HTTP. The change Magento made in 6788 is as much a bug fix as it is a security fix. The security hole it plugged had the byproduct of forcing those who incorrectly set up their cron to properly re-implement it. You should only ever ...


1

What have you tried? Sure it is possible, but afaik the pathes are hardcoded at various places, so it is a lot of work. Why do you want do it? Beside this maybe a start of an answer: Change only the Mage_Catalog_Helper_Image to return another path and then fix the path with .htaccess or better Vhost config rewrite


1

Add magento-cleanup.php file on your magento root folder and run in browser http://magento.com/magento-cleanup.php Add bellow code in file (magento-cleanup.php) <?php ## Function to set file permissions to 0644 and folder permissions to 0755 function AllDirChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){ $d = new ...


Only top voted, non community-wiki answers of a minimum length are eligible