Instalacion de Laravel 52

Versión 1 (Guillermo Zdanowicz, 14/01/2018 11:49)

1 1 Guillermo Zdanowicz
h1. Instalacion de Laravel 5.2
2 1 Guillermo Zdanowicz
<pre>
3 1 Guillermo Zdanowicz
4 1 Guillermo Zdanowicz
 1003  sudo apt-get install software-properties-common
5 1 Guillermo Zdanowicz
 1004  sudo add-apt-repository ppa:ondrej/php
6 1 Guillermo Zdanowicz
 1005  sudo apt-get update
7 1 Guillermo Zdanowicz
 1006  sudo apt-get install php7.1
8 1 Guillermo Zdanowicz
 1007  sudo apt-get install php7.1 php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm
9 1 Guillermo Zdanowicz
 1008  php --ini |grep Loaded
10 1 Guillermo Zdanowicz
 1009  sudo mcedit /etc/php/7.1/cli/php.ini
11 1 Guillermo Zdanowicz
12 1 Guillermo Zdanowicz
aqui hay que habilitar y modificar la linea que dice
13 1 Guillermo Zdanowicz
14 1 Guillermo Zdanowicz
cgi.fix_pathinfo=0 esta por defecto en 1 y cambiarla a 0
15 1 Guillermo Zdanowicz
16 1 Guillermo Zdanowicz
 1010  sudo systemctl restart php7.1-fpm.service
17 1 Guillermo Zdanowicz
 1011  sudo apt-get install nginx
18 1 Guillermo Zdanowicz
 1012  sudo touch /etc/nginx/sites-available/escuela.com
19 1 Guillermo Zdanowicz
 1013  sudo mcedit /etc/nginx/sites-available/escuela.com
20 1 Guillermo Zdanowicz
 1014  sudo ln -s /etc/nginx/sites-available/escuela.com /etc/nginx/sites-enabled/escuela.com
21 1 Guillermo Zdanowicz
 1015  sudo nginx -t
22 1 Guillermo Zdanowicz
 1016  sudo systemctl restart nginx.service
23 1 Guillermo Zdanowicz
 1017  sudo systemctl enable nginx.service
24 1 Guillermo Zdanowicz
 1018  sudo systemctl enable php7.1-fpm.service
25 1 Guillermo Zdanowicz
 1019  sudo mcedit /etc/hosts
26 1 Guillermo Zdanowicz
 1020  cd /var/www/html/escuela/
27 1 Guillermo Zdanowicz
28 1 Guillermo Zdanowicz
dar permiso para crear proyecto
29 1 Guillermo Zdanowicz
30 1 Guillermo Zdanowicz
31 1 Guillermo Zdanowicz
 1025  sudo apt-get install php7.1-mysqlnd
32 1 Guillermo Zdanowicz
 1026  sudo apt-get install php7.1-opcache
33 1 Guillermo Zdanowicz
 1027  sudo apt-get install php7.1-pdo
34 1 Guillermo Zdanowicz
 1028  sudo apt-get install php7.1-xml
35 1 Guillermo Zdanowicz
36 1 Guillermo Zdanowicz
 1029  composer install
37 1 Guillermo Zdanowicz
38 1 Guillermo Zdanowicz
 1031  sudo mcedit /etc/nginx/sites-available/escuela.com 
39 1 Guillermo Zdanowicz
40 1 Guillermo Zdanowicz
/etc/nginx/sites-available/escuela.com  
41 1 Guillermo Zdanowicz
42 1 Guillermo Zdanowicz
----------------------------------------------------
43 1 Guillermo Zdanowicz
                                                
44 1 Guillermo Zdanowicz
server {
45 1 Guillermo Zdanowicz
        listen 80;
46 1 Guillermo Zdanowicz
47 1 Guillermo Zdanowicz
        root /var/www/html/escuela/public;
48 1 Guillermo Zdanowicz
        index index.php index.html index.htm;
49 1 Guillermo Zdanowicz
50 1 Guillermo Zdanowicz
        # Make site accessible from http://localhost/
51 1 Guillermo Zdanowicz
        server_name escuela.com www.escuela.com>;
52 1 Guillermo Zdanowicz
53 1 Guillermo Zdanowicz
        location / {
54 1 Guillermo Zdanowicz
                # First attempt to serve request as file, then
55 1 Guillermo Zdanowicz
                # as directory, then fall back to displaying a 404.
56 1 Guillermo Zdanowicz
                try_files $uri $uri/ /index.php?$query_string;
57 1 Guillermo Zdanowicz
                # Uncomment to enable naxsi on this location
58 1 Guillermo Zdanowicz
                # include /etc/nginx/naxsi.rules
59 1 Guillermo Zdanowicz
        }
60 1 Guillermo Zdanowicz
        location ~ \.php$ {
61 1 Guillermo Zdanowicz
                try_files $uri =404;
62 1 Guillermo Zdanowicz
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
63 1 Guillermo Zdanowicz
                fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
64 1 Guillermo Zdanowicz
                fastcgi_index index.php;
65 1 Guillermo Zdanowicz
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
66 1 Guillermo Zdanowicz
                include fastcgi_params;
67 1 Guillermo Zdanowicz
        }
68 1 Guillermo Zdanowicz
}
69 1 Guillermo Zdanowicz
 
70 1 Guillermo Zdanowicz
------------------------------
71 1 Guillermo Zdanowicz
72 1 Guillermo Zdanowicz
copiar al /etc/nginx/site-enabled 
73 1 Guillermo Zdanowicz
74 1 Guillermo Zdanowicz
editar el archivo /etc/hosts agregando
75 1 Guillermo Zdanowicz
76 1 Guillermo Zdanowicz
127.0.1.1   escuela.com
77 1 Guillermo Zdanowicz
78 1 Guillermo Zdanowicz
 1032  sudo service nginx restart
79 1 Guillermo Zdanowicz
80 1 Guillermo Zdanowicz
 1034  chown www-data: -R escuela
81 1 Guillermo Zdanowicz
 1035  sudo chown www-data: -R escuela
82 1 Guillermo Zdanowicz
para todos los permisos 
83 1 Guillermo Zdanowicz
 1081  sudo chmod 777 escuela -R
84 1 Guillermo Zdanowicz
85 1 Guillermo Zdanowicz
 1074  composer create-project laravel/laravel escuela dev-develop
86 1 Guillermo Zdanowicz
87 1 Guillermo Zdanowicz
 1083  cd escuela
88 1 Guillermo Zdanowicz
89 1 Guillermo Zdanowicz
 1085  mcedit .env 
90 1 Guillermo Zdanowicz
91 1 Guillermo Zdanowicz
en caso de no exisitr hacer copia de .env.sample a .env
92 1 Guillermo Zdanowicz
93 1 Guillermo Zdanowicz
 1086  mysql -uroot -p
94 1 Guillermo Zdanowicz
 
95 1 Guillermo Zdanowicz
1087  mcedit .env
96 1 Guillermo Zdanowicz
97 1 Guillermo Zdanowicz
configuro la base de datos y las configuraciones
98 1 Guillermo Zdanowicz
99 1 Guillermo Zdanowicz
--------------------------------
100 1 Guillermo Zdanowicz
APP_NAME=Laravel
101 1 Guillermo Zdanowicz
APP_ENV=local
102 1 Guillermo Zdanowicz
APP_KEY=base64:3Kctjp9paCPZVuJ3JekH3nbd8UDvZv+tc22uT4e8Ur0=
103 1 Guillermo Zdanowicz
APP_DEBUG=true
104 1 Guillermo Zdanowicz
APP_URL=http://escuela.com
105 1 Guillermo Zdanowicz
106 1 Guillermo Zdanowicz
LOG_CHANNEL=single
107 1 Guillermo Zdanowicz
108 1 Guillermo Zdanowicz
DB_CONNECTION=mysql
109 1 Guillermo Zdanowicz
DB_HOST=127.0.0.1
110 1 Guillermo Zdanowicz
DB_PORT=3306
111 1 Guillermo Zdanowicz
DB_DATABASE=escuela
112 1 Guillermo Zdanowicz
DB_USERNAME=root
113 1 Guillermo Zdanowicz
DB_PASSWORD=xxxxxxx
114 1 Guillermo Zdanowicz
115 1 Guillermo Zdanowicz
BROADCAST_DRIVER=log
116 1 Guillermo Zdanowicz
CACHE_DRIVER=file
117 1 Guillermo Zdanowicz
SESSION_DRIVER=file
118 1 Guillermo Zdanowicz
SESSION_LIFETIME=120
119 1 Guillermo Zdanowicz
QUEUE_DRIVER=sync
120 1 Guillermo Zdanowicz
121 1 Guillermo Zdanowicz
REDIS_HOST=127.0.0.1
122 1 Guillermo Zdanowicz
REDIS_PASSWORD=null
123 1 Guillermo Zdanowicz
REDIS_PORT=6379
124 1 Guillermo Zdanowicz
125 1 Guillermo Zdanowicz
MAIL_DRIVER=smtp
126 1 Guillermo Zdanowicz
MAIL_HOST=smtp.gmail.com
127 1 Guillermo Zdanowicz
MAIL_PORT=587
128 1 Guillermo Zdanowicz
MAIL_USERNAME=correo@gmail.com
129 1 Guillermo Zdanowicz
MAIL_PASSWORD=xxxxx
130 1 Guillermo Zdanowicz
MAIL_ENCRYPTION=TLS
131 1 Guillermo Zdanowicz
--------------------------------
132 1 Guillermo Zdanowicz
133 1 Guillermo Zdanowicz
para crear autenticacion de laravel
134 1 Guillermo Zdanowicz
135 1 Guillermo Zdanowicz
 1088  php artisan make:auth
136 1 Guillermo Zdanowicz
137 1 Guillermo Zdanowicz
 1090  php artisan migrate
138 1 Guillermo Zdanowicz
139 1 Guillermo Zdanowicz
 1092  sudo chmod 777 /var/www/html/escuela/storage/logs/ -R 
140 1 Guillermo Zdanowicz
141 1 Guillermo Zdanowicz
1093  php artisan migrate -v
142 1 Guillermo Zdanowicz
143 1 Guillermo Zdanowicz
si queresmo ver los errores de laravel hay que editar
144 1 Guillermo Zdanowicz
/config/app.php
145 1 Guillermo Zdanowicz
146 1 Guillermo Zdanowicz
'debug' => env('APP_DEBUG', false),   cambiar por true
147 1 Guillermo Zdanowicz
</pre>
Redmine Appliance - Powered by TurnKey Linux