Mostrando entradas con la etiqueta zend. Mostrar todas las entradas
Mostrando entradas con la etiqueta zend. Mostrar todas las entradas

lunes, enero 20, 2014

Instalacion Zend Framework 1.12 Full

  1. Descargar http://www.zend.com/en/company/community/downloads
  2. Instalar:

  3. [root@ip-172-31-42-158 ~]# yum -y install httpd httpd-devel
    [root@ip-172-31-42-158 ~]# yum -y install mysql mysql-server
    [root@ip-172-31-42-158 ~]# yum -y install php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
    [root@ip-172-31-42-158 ~]# chkconfig httpd on
    [root@ip-172-31-42-158 ~]# chkconfig mysqld on
    [root@ip-172-31-42-158 ~]# /etc/init.d/httpd start
    [root@ip-172-31-42-158 ~]# /etc/init.d/mysqld start
    [root@ip-172-31-42-158 ~]# tar -xzvf ZendFramework-1.12.3.tar.gz
    [root@ip-172-31-42-158 ~]# mv ZendFramework-1.12.3 /var/zend
    [root@ip-172-31-42-158 ~]# vim /etc/php.ini
    -----------------------------------------------------------
    ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;;
    ; UNIX: "/path1:/path2"
    ;include_path = ".:/php/includes"
    include_path = ".:/var/zend/library"
    -----------------------------------------------------------
    [root@ip-172-31-42-158 html]# vim /etc/httpd/conf.d/site1.conf
    -----------------------------------------------------------

    <virtualhost *:80>
    ServerAdmin webmaster@site1.com
    DocumentRoot /apps/site1/public
    ServerName www.site1.com
    ErrorLog logs/site1.com-error_log
    CustomLog logs/site1.com-access_log common
    SetEnv APPLICATION_ENV "development" 


    <Directory /apps/site1/public>
        DirectoryIndex index.php
       AllowOverride
       All Order allow,deny
       Allow from all
    <Directory>
    </virtualhost>
    -----------------------------------------------------------
    [root@ip-172-31-42-158 html]# vim /etc/httpd/conf/httpd.conf
    ------------------------------------
    # Use name-based virtual hosting.
    NameVirtualHost *:80
    ------------------------------------
    [root@ip-172-31-42-158 html]# mkdir /apps && cd /apps
    [root@ip-172-31-42-158 apps]# /var/zend/bin/zf.sh create project site1
    [root@ip-172-31-42-158 apps]# cp -R /var/zend/library/Zend/* /apps/site1/library/
    [root@ip-172-31-42-158 apps]# /etc/init.d/httpd configtest
    Syntax OK
    [root@ip-172-31-42-158 apps]# /etc/init.d/httpd reload
    Reloading httpd:
  1. Probar Ingresando al site (como es mi unico site, tambien puedo ingresar por ip, caso contrario tendre que ingresar por dominio site1.com)

    1.  

viernes, enero 17, 2014

Instalación de Zend Framework 2

Requerimientos:

  • Tener instalado Servidor WEB (en mi caso ZendServer2 + Apache) + PHP
  • SO: en mi caso Linux

Procedimiento:

    1. Crear un directorio virtual donde se instalara nuestro proyecto y ademas poseer un dominio, en mi caso registrare mi dominio aws.3a2.com en http://www.midominiogratis.es/
    2. Generare mi sitio virtual en /etc/http/vhost/3a2.conf
      # vim /etc/httpd/conf/httpd.conf
      ------------------------------
      #añado esta linea
      Include vhost/*.conf 
      #Verificar esta linea
      NameVirtualHost *:80
      ------------------------------
      # mkdir /etc/httpd/vhost
      # vim /etc/httpd/vhost/3a2.conf
      ------------------------------
      <virtualhost *:80> 
      ServerAdmin webmaster@3a2.com
      DocumentRoot /apps/3a2
      ServerName aws.3a2.com
      ErrorLog logs/3a2.com-error_log
      CustomLog logs/3a2.com-access_log common
          <Directory /apps/3a2 *:80>
          DirectoryIndex index.php
          Order allow,deny
          Allow from all
          Options FollowSymLinks -Indexes
          Order allow,deny
          Allow from all
          AllowOverride None
          RewriteEngine On
          RewriteCond %{REQUEST_FILENAME} -s [OR]
          RewriteCond %{REQUEST_FILENAME} -l [OR]
          RewriteCond %{REQUEST_FILENAME} -d
          RewriteRule ^.*$ - [NC,L]
          RewriteRule ^.*$ index.php [NC,L] 
          </Directory *:80> 
      </virtualhost> 
      -------------------------------
      # mkdir /apps && mkdir /apps/3a2
      # vim /apps/3a2/index.php
      --------------------------------
      phpinfo();
      ?>
      --------------------------------
      # /etc/init.d/httpd reload
    3. Antes de proceder a instalar proceder a verificar que el site levante
      3a2
    4. Ahora procederemos a instalar el framework, para esto clonaremos el site de modelo (Skeleton) que se posee en el github
      # yum -y install git
      # cd /apps/3a2/
      # git clone git://github.com/zendframework/ZendSkeletonApplication.git
      Initialized empty Git repository in /apps/3a2/ZendSkeletonApplication/.git/
      remote: Reusing existing pack: 2426, done.
      remote: Total 2426 (delta 0), reused 0 (delta 0)
      Receiving objects: 100% (2426/2426), 1.24 MiB | 1.08 MiB/s, done.
      Resolving deltas: 100% (1060/1060), done.
      # mv ZendSkeletonApplication/* .
      # rm -rf ZendSkeletonApplication
      # ls -l
      total 912
      -rw-r--r-- 1 root root    338 Jan 17 14:32 composer.json
      -rwxr-xr-x 1 root root 891620 Jan 17 14:32 composer.phar
      drwxr-xr-x 3 root root   4096 Jan 17 14:32 config
      drwxr-xr-x 3 root root   4096 Jan 17 14:32 data
      -rw-r--r-- 1 root root     40 Jan 17 12:52 index.php
      -rw-r--r-- 1 root root   1807 Jan 17 14:32 init_autoloader.php
      -rw-r--r-- 1 root root   1548 Jan 17 14:32 LICENSE.txt
      drwxr-xr-x 3 root root   4096 Jan 17 14:32 module
      drwxr-xr-x 6 root root   4096 Jan 17 14:32 public
      -rw-r--r-- 1 root root   2551 Jan 17 14:32 README.md
      drwxr-xr-x 3 root root   4096 Jan 17 14:32 vendor
      # /usr/local/zend/bin/php composer.phar self-update
      Updating to version b20021cc6aa113069e4223b78d0074a1fc7dd4e8.
          Downloading: 100%
      # /usr/local/zend/bin/php composer.phar install
      Loading composer repositories with package information
      Installing dependencies (including require-dev)
        - Installing zendframework/zendframework (2.2.5)
          Downloading: 100%
      
      zendframework/zendframework suggests installing doctrine/annotations (Doctrine Annotations >=1.0 for annotation features)
      zendframework/zendframework suggests installing ircmaxell/random-lib (Fallback random byte generator for Zend\Math\Rand if OpenSSL/Mcrypt extensions are unavailable)
      zendframework/zendframework suggests installing ocramius/proxy-manager (ProxyManager to handle lazy initialization of services)
      zendframework/zendframework suggests installing zendframework/zendpdf (ZendPdf for creating PDF representations of barcodes)
      zendframework/zendframework suggests installing zendframework/zendservice-recaptcha (ZendService\ReCaptcha for rendering ReCaptchas in Zend\Captcha and/or Zend\Form)
      Writing lock file
      Generating autoload files
    5. Ahora modificaremos las siguientes lineas del 3a2.conf para que apunte al public y añadiremos el SetEnv
      # vim /etc/httpd/vhost/3a2.conf
      ------------------------------
      <virtualhost *:80>
      ServerAdmin webmaster@3a2.com
      DocumentRoot /apps/3a2/public
      ServerName aws.3a2.com
      ErrorLog logs/3a2.com-error_log
      CustomLog logs/3a2.com-access_log common
      SetEnv APPLICATION_ENV "development" 
         <Directory /apps/3a2/public *:80>
         DirectoryIndex index.php
         Order allow,deny
         Allow from all
         Options FollowSymLinks -Indexes
         Order allow,deny
         Allow from all
         AllowOverride None
         RewriteEngine On
         RewriteCond %{REQUEST_FILENAME} -s [OR]
         RewriteCond %{REQUEST_FILENAME} -l [OR]
         RewriteCond %{REQUEST_FILENAME} -d
         RewriteRule ^.*$ - [NC,L]
         RewriteRule ^.*$ index.php [NC,L] 
         </Directory >
      </virtualhost> 
                     -------------------------------




  • Ahora a probar en el navegador debe salir
  • jueves, enero 16, 2014

    Instalacion Zend Server 2.0

    Primero instalar repositorios epel http://dl.fedoraproject.org/pub/epel/6/x86_64/ (busca el que se adecua mejor a tu Linux).

    CentOS 6.X

    Para instalar Zend-Server podemos seguir el manual que se encuentra en la pagina oficial: http://files.zend.com/help/Zend-Server-5.6-Community-Edition/zend-server-community-edition.htm#rpm_installation.htm
    1. Instalamos de la siguiente manera:
    • yum -y install httpd httpd-devel    
    • yum -y install mysql mysql-server
    • yum -y install php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
    • chkconfig httpd on
    • chkconfig mysqld on
    • /etc/init.d/httpd start
    • /etc/init.d/mysqld start
    • vim /etc/yum.repos.d/zend.repo   //agregamos repo de zend
      [Zend]
      name=zend-server
      baseurl=http://repos.zend.com/zend-server/6.2/rpm/$basearch
      enabled=1
      gpgcheck=1
      gpgkey=http://repos.zend.com/zend.key
      
      [Zend_noarch]
      name=zend-server - noarch
      baseurl=http://repos.zend.com/zend-server/6.2/rpm/noarch
      enabled=1
      gpgcheck=1
      gpgkey=http://repos.zend.com/zend.key
    • rpm -qa | grep php
                  php-5.3.28-1.2.amzn1.x86_64
    • yum -y install php5.3-zendframework
    • yum install zend-server-nginx-php5.3
    • Descargamos el paquete de: http://www.zend.com/en/products/server/downloads (debemos registrarnos)
    • cd ZendServer-RepositoryInstaller-linux/
    • ./install.sh 5.3
    Nota: Se pueden presentar problemas al levantar el servicio de apache, en ese cado deshabilita el SELINUX en /etc/selinnux/config y no olvides darle permisos en el firewall y/o en el peor de los casos deshabilitarlo tambien.

    AMI (Amazon Web)

    1. Instalar requerimientos de Zend-Server
      yum -y install httpd
      yum -y install policycoreutils-python
    2. Ahora editaremos un repositorio para zend:
      vim /etc/yum.repos.d/zend.repo
      ------------------------------------------------------------
      [Zend]
      name=zend-server
      baseurl=http://repos.zend.com/zend-server/6.1/rpm/$basearch
      enabled=1
      gpgcheck=1
      gpgkey=http://repos.zend.com/zend.key
      
      [Zend_noarch]
      name=zend-server - noarch
      baseurl=http://repos.zend.com/zend-server/6.1/rpm/noarch
      enabled=1
      gpgcheck=1
      gpgkey=http://repos.zend.com/zend.key
      -------------------------------------------------------------
    3. Procedemos a instalar el zend-common para que se instalen las dependencias
      yum -y install zend-server-php-5.4-common
    4. Descargar los rpm de http://repos-source.zend.com/zend-server/6.2/rpm/x86_64/ (elige los que mas se adecuen a tu linux)
      wget http://repos-source.zend.com/zend-server/6.2/rpm/x86_64/zend-server-php-5.4-common-6.2.0-2002.x86_64.rpm
      wget http://repos-source.zend.com/zend-server/6.2/rpm/x86_64/zend-server-php-5.4-6.2.0-2002.x86_64.rpm 
      wget http://repos-source.zend.com/zend-server/6.2/rpm/x86_64/mod-php-5.4-apache2-zend-server-5.4.21-20.x86_64.rpm
    5. Ahora instalaremos el Zend Server (en el paso 4 lo descargamos) actualizando el common
      rpm -Uvh zend-server-php-5.4-common-6.2.0-2002.x86_64.rpm
      rpm -Uvh zend-server-php-5.4-6.2.0-2002.x86_64.rpm mod-php-5.4-apache2-zend-server-5.4.21-20.x86_64.rpm –replacefiles
    6. Ahora corroboramos que los servicios este corriendo, sino los levantamos
      
      
      [root@ip-172-31-13-18 ec2-user]# /etc/init.d/httpd status
      httpd (pid  19511) is running...
      [root@ip-172-31-13-18 ec2-user]# /etc/init.d/zend-server status
      [15.01.2014 17:51:35 SYSTEM] watchdog for monitor is running.
      [15.01.2014 17:51:35 SYSTEM] monitor is running.
      httpd (pid  19511) is running...
      [15.01.2014 17:51:35 SYSTEM] watchdog for lighttpd is running.
      [15.01.2014 17:51:35 SYSTEM] lighttpd is running.
      [15.01.2014 17:51:35 SYSTEM] watchdog for scd is running.
      [15.01.2014 17:51:35 SYSTEM] scd is running.
      [15.01.2014 17:51:35 SYSTEM] watchdog for zdd is running.
      [15.01.2014 17:51:35 SYSTEM] zdd is running.
      [15.01.2014 17:51:35 SYSTEM] watchdog for jqd is running.
      [15.01.2014 17:51:35 SYSTEM] jqd is running.
      [15.01.2014 17:51:35 SYSTEM] watchdog for zsd is running.
      [15.01.2014 17:51:35 SYSTEM] zsd is running.

    En cualquiera de los 2 casos podemos probar que se halla instalado correctamente generando un script con el phpinfo() en la ruta de tu apache que generalmente es: /var/www/html/, donde deberemos observar que el archivo de configracion se encuentra en /usr/local/zend/etc/php.ini

    Para acceder, por navegador solo pones la ip, si no carga verifica que tienes el servicio iniciado.

    test

    Saludos.