Entradas

Como instalar Magento paso a paso

,

Para instalar Magento

php 5.3 son las siguientes extensiones

  • PDO/MySQL
  • MySQLi
  • mcrypt
  • mhash
  • simplexml
  • DOM
  • SOAP
yum install php53-mcrypt

Primera parte

Primero, utilizaremos memcached como gestor de caché. Para ello ejecutamos las siguientes lineas:

Nota: para Centos 5.8, instalar estos repositorios para memcache:

>> rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

>> rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
>> yum install memcached
 >> yum install php-memcache

Luego iniciamos memcached, un servicio de caché en memoria:

>> service memcached start

Seguidamente reiniciamos los servicios web:

>> /usr/local/psa/admin/bin/websrvmng -av
>> service httpd restart

También configuramos para que memcached se ejecute al inicio:

>> chkconfig memcached on

Ahora iremos a nuestra instalación de Magento y modificaremos la configuración de caché, editaremos el fichero /app/etc/local.xml:

<config>
     <global>
         ...
         <cache>
             <backend><![CDATA[memcached]]></backend><!-- apc / memcached / xcache / empty=file -->
             <slow_backend><![CDATA[database]]></slow_backend>
             <memcached><!-- memcached cache backend related config -->
                 <servers><!-- any number of server nodes can be included -->
                     <server>
                         <host><![CDATA[127.0.0.1]]></host>
                         <port><![CDATA[11211]]></port>
                         <persistent><![CDATA[1]]></persistent>
                         <weight><![CDATA[1]]></weight>
                         <timeout><![CDATA[10]]></timeout>
                         <retry_interval><![CDATA[10]]></retry_interval>
                         <status><![CDATA[1]]></status>
                     </server>
                 </servers>
                 <compression><![CDATA[0]]></compression>
                 <cache_dir><![CDATA[]]></cache_dir>
                 <hashed_directory_level><![CDATA[]]></hashed_directory_level>
                 <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
                 <file_name_prefix><![CDATA[]]></file_name_prefix>
             </memcached>
         </cache>
     </global>
     ...
 </config>

Reconfigurar el mysql con esto, editamos el /etc/my.cnf
# Disable Berkley DB functionality, saving memory
skip-bdb
#max_connections = 100
# tmp_table_size/max_heap_table_size: Default is 16MB, but this causes many
# temporary tables to be written to disk, and is ineffecient.
# Keep tmp_table_size and max_heap_table_size the same!
tmp_table_size = 128M # was 64M
max_heap_table_size = 128M # was 64M
### query-cache settings ###
query-cache-type = 1
query-cache-size = 84M # was 32M was 64M
query_cache_limit = 16M # was 1M was 8M
### Buffer size settings ###
#sort_buffer_size = 2M
# key_buffer_size is important for MyISAM tables.
key_buffer_size = 150M # was 16M
#join_buffer_size = 16M # was 2M
thread_cache_size = 8
# table_cache: Approximate by taking max_connections and multiplying by the
# largest number of tables that can be open for any join.
table_cache = 2048 # was 256 was 512 was 1024
### Timing options ###
interactive_timeout = 100
wait_timeout = 20
connect_timeout = 15
### Log slow queries ###
# Make sure you create this file before you start mysql or it will not work!
# Use the this command:   touch /var/log/mysql.slow-queries.log && chown mysql:mysql /var/log/mysql.slow-queries.log
log-slow-queries=/var/log/mysql.slow-queries.log
# Duration a query must run (in seconds) to get logged
long_query_time = 1
### InnoDB settings ###
# for InnoDB settings; They largely depend on your application.
innodb_buffer_pool_size = 1G

Finalmente, con esto ya tenemos una base rápida para que Magento funcione como la seda.

Segunda parte

# Disable Berkley DB functionality, saving memory
skip-bdb
#max_connections = 100
# tmp_table_size/max_heap_table_size: Default is 16MB, but this causes many
# temporary tables to be written to disk, and is ineffecient.
# Keep tmp_table_size and max_heap_table_size the same!
tmp_table_size = 128M # was 64M
max_heap_table_size = 128M # was 64M
### query-cache settings ###
query-cache-type = 1
query-cache-size = 84M # was 32M was 64M
query_cache_limit = 16M # was 1M was 8M
### Buffer size settings ###
#sort_buffer_size = 2M
# key_buffer_size is important for MyISAM tables.
key_buffer_size = 150M # was 16M
#join_buffer_size = 16M # was 2M
thread_cache_size = 8
# table_cache: Approximate by taking max_connections and multiplying by the
# largest number of tables that can be open for any join.
table_cache = 2048 # was 256 was 512 was 1024
### Timing options ###
interactive_timeout = 100
wait_timeout = 20
connect_timeout = 15
### Log slow queries ###
# Make sure you create this file before you start mysql or it will not work!
# Use the this command:   touch /var/log/mysql.slow-queries.log && chown mysql:mysql /var/log/mysql.slow-queries.log
log-slow-queries=/var/log/mysql.slow-queries.log
# Duration a query must run (in seconds) to get logged
long_query_time = 1
### InnoDB settings ###
# for InnoDB settings; They largely depend on your application.
innodb_buffer_pool_size = 1G
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
open_files_limit = 8192
[isamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

Más tarde modificamos el .htacces para activas la compresión:

<IfModule mod_deflate.c>
############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter on all content
    SetOutputFilter DEFLATE
    # Insert filter on selected content types only
    #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html

    # Don't compress images
    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary

    php_flag zlib.output_compression on

</IfModule>

Fuentes:

http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/magento_installation_guide

http://techportal.inviqa.com/2011/03/08/optimising-magento-for-performance/#tuner

Si necesitas ayuda en instalación o configuración de e-commerce Magento, estamos encantados ayudarte.