Instalacion
Versión 13 (Guillermo Zdanowicz, 26/04/2018 10:27)
| 1 | 1 | Guillermo Zdanowicz | h1. Instalacion |
|---|---|---|---|
| 2 | 1 | Guillermo Zdanowicz | |
| 3 | 3 | Guillermo Zdanowicz | Instalacion de Nginx |
| 4 | 3 | Guillermo Zdanowicz | |
| 5 | 3 | Guillermo Zdanowicz | sudo apt-get update |
| 6 | 3 | Guillermo Zdanowicz | sudo apt-get install nginx |
| 7 | 3 | Guillermo Zdanowicz | |
| 8 | 3 | Guillermo Zdanowicz | sudo ufw app list |
| 9 | 3 | Guillermo Zdanowicz | |
| 10 | 3 | Guillermo Zdanowicz | Available applications: |
| 11 | 3 | Guillermo Zdanowicz | Nginx Full <------- |
| 12 | 3 | Guillermo Zdanowicz | Nginx HTTP |
| 13 | 3 | Guillermo Zdanowicz | Nginx HTTPS |
| 14 | 3 | Guillermo Zdanowicz | OpenSSH |
| 15 | 3 | Guillermo Zdanowicz | Postfix |
| 16 | 3 | Guillermo Zdanowicz | Postfix SMTPS |
| 17 | 3 | Guillermo Zdanowicz | Postfix Submission |
| 18 | 3 | Guillermo Zdanowicz | |
| 19 | 3 | Guillermo Zdanowicz | sudo ufw allow 'Nginx Full' |
| 20 | 3 | Guillermo Zdanowicz | |
| 21 | 3 | Guillermo Zdanowicz | systemctl status nginx |
| 22 | 3 | Guillermo Zdanowicz | |
| 23 | 3 | Guillermo Zdanowicz | sudo apt-get install curl |
| 24 | 3 | Guillermo Zdanowicz | |
| 25 | 4 | Guillermo Zdanowicz | sudo apt-get install php-fpm php-mysql |
| 26 | 4 | Guillermo Zdanowicz | |
| 27 | 4 | Guillermo Zdanowicz | /etc/php/7.0/fpm/php.ini |
| 28 | 4 | Guillermo Zdanowicz | |
| 29 | 4 | Guillermo Zdanowicz | cgi.fix_pathinfo=0 |
| 30 | 4 | Guillermo Zdanowicz | |
| 31 | 4 | Guillermo Zdanowicz | sudo systemctl restart php7.0-fpm |
| 32 | 4 | Guillermo Zdanowicz | |
| 33 | 4 | Guillermo Zdanowicz | |
| 34 | 4 | Guillermo Zdanowicz | sudo mcedit /etc/nginx/sites-available/default |
| 35 | 4 | Guillermo Zdanowicz | |
| 36 | 4 | Guillermo Zdanowicz | <pre> |
| 37 | 4 | Guillermo Zdanowicz | server { |
| 38 | 11 | Guillermo Zdanowicz | listen 4001; |
| 39 | 11 | Guillermo Zdanowicz | # server_name aranceles.dev; |
| 40 | 1 | Guillermo Zdanowicz | |
| 41 | 11 | Guillermo Zdanowicz | root /var/www/html/proyecto/aranceles/public/; |
| 42 | 11 | Guillermo Zdanowicz | index index.php index.html index.htm; |
| 43 | 1 | Guillermo Zdanowicz | |
| 44 | 11 | Guillermo Zdanowicz | error_log /tmp/laranceles.error.log; |
| 45 | 11 | Guillermo Zdanowicz | access_log /tmp/laranceles.access.log; |
| 46 | 1 | Guillermo Zdanowicz | |
| 47 | 11 | Guillermo Zdanowicz | location / { |
| 48 | 11 | Guillermo Zdanowicz | try_files $uri $uri/ /index.php$is_args$args; |
| 49 | 11 | Guillermo Zdanowicz | } |
| 50 | 4 | Guillermo Zdanowicz | |
| 51 | 11 | Guillermo Zdanowicz | # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock |
| 52 | 11 | Guillermo Zdanowicz | location ~ \.php$ { |
| 53 | 11 | Guillermo Zdanowicz | try_files $uri =404; |
| 54 | 11 | Guillermo Zdanowicz | fastcgi_split_path_info ^(.+\.php)(/.+)$; |
| 55 | 11 | Guillermo Zdanowicz | fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; |
| 56 | 11 | Guillermo Zdanowicz | fastcgi_index index.php; |
| 57 | 11 | Guillermo Zdanowicz | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 58 | 13 | Guillermo Zdanowicz | include fastcgi_params; |
| 59 | 4 | Guillermo Zdanowicz | |
| 60 | 11 | Guillermo Zdanowicz | } |
| 61 | 4 | Guillermo Zdanowicz | } |
| 62 | 4 | Guillermo Zdanowicz | </pre> |
| 63 | 4 | Guillermo Zdanowicz | |
| 64 | 4 | Guillermo Zdanowicz | Pare verificar si todo esta bien |
| 65 | 4 | Guillermo Zdanowicz | |
| 66 | 4 | Guillermo Zdanowicz | sudo nginx -t |
| 67 | 4 | Guillermo Zdanowicz | |
| 68 | 4 | Guillermo Zdanowicz | sudo systemctl reload nginx |
| 69 | 2 | Guillermo Zdanowicz | |
| 70 | 1 | Guillermo Zdanowicz | LARAVEL DESDE CERO |
| 71 | 2 | Guillermo Zdanowicz | |
| 72 | 1 | Guillermo Zdanowicz | Dependencias |
| 73 | 2 | Guillermo Zdanowicz | |
| 74 | 1 | Guillermo Zdanowicz | # apt install php-mcrypt php-gd php-mbstring |
| 75 | 2 | Guillermo Zdanowicz | |
| 76 | 1 | Guillermo Zdanowicz | Instalacion de composer |
| 77 | 2 | Guillermo Zdanowicz | |
| 78 | 1 | Guillermo Zdanowicz | # curl -sS https://getcomposer.org/installer | php |
| 79 | 2 | Guillermo Zdanowicz | |
| 80 | 2 | Guillermo Zdanowicz | Mover composer para usarlo desde cualquier carpeta |
| 81 | 2 | Guillermo Zdanowicz | |
| 82 | 2 | Guillermo Zdanowicz | # mv composer.phar /usr/local/bin/composer |
| 83 | 2 | Guillermo Zdanowicz | |
| 84 | 2 | Guillermo Zdanowicz | Hacer ejecutable |
| 85 | 2 | Guillermo Zdanowicz | |
| 86 | 2 | Guillermo Zdanowicz | # chmod +x /usr/local/bin/composer |
| 87 | 2 | Guillermo Zdanowicz | |
| 88 | 2 | Guillermo Zdanowicz | Crear el directorio para el proyecto |
| 89 | 2 | Guillermo Zdanowicz | |
| 90 | 2 | Guillermo Zdanowicz | # mkdir /var/www/html/your_website |
| 91 | 2 | Guillermo Zdanowicz | |
| 92 | 2 | Guillermo Zdanowicz | Ingresamos |
| 93 | 2 | Guillermo Zdanowicz | |
| 94 | 2 | Guillermo Zdanowicz | # cd /var/www/html/your_website |
| 95 | 2 | Guillermo Zdanowicz | |
| 96 | 2 | Guillermo Zdanowicz | Bajamos Laravel |
| 97 | 8 | Guillermo Zdanowicz | |
| 98 | 9 | Guillermo Zdanowicz | --------------------------------------------- |
| 99 | 9 | Guillermo Zdanowicz | |
| 100 | 9 | Guillermo Zdanowicz | composer create-project laravel/laravel aranceles dev-develop |
| 101 | 8 | Guillermo Zdanowicz | --------------------------------------------- |
| 102 | 8 | Guillermo Zdanowicz | Para bajar laravel en version Flarepoint |
| 103 | 8 | Guillermo Zdanowicz | git clone https://github.com/Bottelet/Flarepoint-crm.git |
| 104 | 8 | Guillermo Zdanowicz | |
| 105 | 8 | Guillermo Zdanowicz | 32 sudo apt-get install php-xml |
| 106 | 8 | Guillermo Zdanowicz | 33 sudo service php7.0-fpm restart |
| 107 | 8 | Guillermo Zdanowicz | 36 sudo apt-get install php7.0-curl |
| 108 | 8 | Guillermo Zdanowicz | 37 sudo apt-get install php7.0-gd |
| 109 | 8 | Guillermo Zdanowicz | 39 sudo apt-get install php7.0-mbstring |
| 110 | 12 | Guillermo Zdanowicz | sudo apt-get install php7.0-zip |
| 111 | 8 | Guillermo Zdanowicz | 33 sudo service php7.0-fpm restart |
| 112 | 8 | Guillermo Zdanowicz | ----------------------------------------------- |
| 113 | 2 | Guillermo Zdanowicz | En version limpia |
| 114 | 2 | Guillermo Zdanowicz | git clone https://github.com/laravel/laravel.git |
| 115 | 2 | Guillermo Zdanowicz | |
| 116 | 2 | Guillermo Zdanowicz | cd .. |
| 117 | 2 | Guillermo Zdanowicz | |
| 118 | 2 | Guillermo Zdanowicz | Aplico permisos a carpetas |
| 119 | 2 | Guillermo Zdanowicz | |
| 120 | 2 | Guillermo Zdanowicz | chown www-data: -R laravel |
| 121 | 1 | Guillermo Zdanowicz | |
| 122 | 2 | Guillermo Zdanowicz | Ingreso al proyecto |
| 123 | 2 | Guillermo Zdanowicz | |
| 124 | 2 | Guillermo Zdanowicz | cd laravel/ |
| 125 | 2 | Guillermo Zdanowicz | |
| 126 | 2 | Guillermo Zdanowicz | copio archivos de configuracion |
| 127 | 2 | Guillermo Zdanowicz | |
| 128 | 2 | Guillermo Zdanowicz | cp .env.example .env |
| 129 | 2 | Guillermo Zdanowicz | |
| 130 | 2 | Guillermo Zdanowicz | Edito archivo de configuracion |
| 131 | 2 | Guillermo Zdanowicz | |
| 132 | 10 | Guillermo Zdanowicz | El acceso a la base de datos se configura en 2 lugares |
| 133 | 10 | Guillermo Zdanowicz | |
| 134 | 10 | Guillermo Zdanowicz | en config/database.php |
| 135 | 10 | Guillermo Zdanowicz | |
| 136 | 11 | Guillermo Zdanowicz | <pre> |
| 137 | 10 | Guillermo Zdanowicz | 'mysql' => [ |
| 138 | 10 | Guillermo Zdanowicz | 'driver' => 'mysql', |
| 139 | 10 | Guillermo Zdanowicz | 'host' => env('DB_HOST', '192.168.2.172'), |
| 140 | 10 | Guillermo Zdanowicz | 'port' => env('DB_PORT', '3306'), |
| 141 | 10 | Guillermo Zdanowicz | 'database' => env('DB_DATABASE', 'laravel'), |
| 142 | 10 | Guillermo Zdanowicz | 'username' => env('DB_USERNAME', 'laravel'), |
| 143 | 10 | Guillermo Zdanowicz | 'password' => env('DB_PASSWORD', 'ucu522'), |
| 144 | 10 | Guillermo Zdanowicz | 'unix_socket' => env('DB_SOCKET', ''), |
| 145 | 10 | Guillermo Zdanowicz | 'charset' => 'utf8mb4', |
| 146 | 10 | Guillermo Zdanowicz | 'collation' => 'utf8mb4_unicode_ci', |
| 147 | 10 | Guillermo Zdanowicz | 'prefix' => '', |
| 148 | 10 | Guillermo Zdanowicz | 'strict' => true, |
| 149 | 10 | Guillermo Zdanowicz | 'engine' => null, |
| 150 | 10 | Guillermo Zdanowicz | ], |
| 151 | 11 | Guillermo Zdanowicz | </pre> |
| 152 | 10 | Guillermo Zdanowicz | |
| 153 | 2 | Guillermo Zdanowicz | |
| 154 | 2 | Guillermo Zdanowicz | mcedit .env |
| 155 | 2 | Guillermo Zdanowicz | |
| 156 | 2 | Guillermo Zdanowicz | Cambio parametros |
| 157 | 5 | Guillermo Zdanowicz | |
| 158 | 5 | Guillermo Zdanowicz | DB_DATABASE=larevel |
| 159 | 5 | Guillermo Zdanowicz | DB_USERNAME=laravel |
| 160 | 5 | Guillermo Zdanowicz | DB_PASSWORD=ucu522 |
| 161 | 5 | Guillermo Zdanowicz | |
| 162 | 5 | Guillermo Zdanowicz | CREAR BASE DE DATOS EN OTRO SERVIDOR |
| 163 | 5 | Guillermo Zdanowicz | |
| 164 | 5 | Guillermo Zdanowicz | mysql> create database laravel |
| 165 | 5 | Guillermo Zdanowicz | mysql> GRANT ALL ON laravel.* to laravel@'192.168.2.166' IDENTIFIED BY 'ucu522' |
| 166 | 2 | Guillermo Zdanowicz | mysql> flush privileges; |
| 167 | 2 | Guillermo Zdanowicz | |
| 168 | 2 | Guillermo Zdanowicz | Ejecuto sentencia |
| 169 | 6 | Guillermo Zdanowicz | |
| 170 | 6 | Guillermo Zdanowicz | sudo apt-get install php-xml |
| 171 | 7 | Guillermo Zdanowicz | |
| 172 | 7 | Guillermo Zdanowicz | |
| 173 | 7 | Guillermo Zdanowicz | en caso de tener error respecto a la longitud de campos en archivo de /app/Providers/AppServiceProvider.php modificar |
| 174 | 7 | Guillermo Zdanowicz | |
| 175 | 7 | Guillermo Zdanowicz | <pre> |
| 176 | 7 | Guillermo Zdanowicz | .... |
| 177 | 7 | Guillermo Zdanowicz | namespace App\Providers; |
| 178 | 7 | Guillermo Zdanowicz | |
| 179 | 7 | Guillermo Zdanowicz | *use Illuminate\Support\Facades\Schema;* |
| 180 | 7 | Guillermo Zdanowicz | use Illuminate\Support\ServiceProvider; |
| 181 | 7 | Guillermo Zdanowicz | |
| 182 | 7 | Guillermo Zdanowicz | class AppServiceProvider extends ServiceProvider |
| 183 | 7 | Guillermo Zdanowicz | { |
| 184 | 7 | Guillermo Zdanowicz | /** |
| 185 | 7 | Guillermo Zdanowicz | * Bootstrap any application services. |
| 186 | 7 | Guillermo Zdanowicz | * |
| 187 | 7 | Guillermo Zdanowicz | * @return void |
| 188 | 7 | Guillermo Zdanowicz | */ |
| 189 | 7 | Guillermo Zdanowicz | public function boot() |
| 190 | 7 | Guillermo Zdanowicz | { |
| 191 | 7 | Guillermo Zdanowicz | // |
| 192 | 7 | Guillermo Zdanowicz | *Schema::defaultStringLength(191);* |
| 193 | 7 | Guillermo Zdanowicz | } |
| 194 | 7 | Guillermo Zdanowicz | </pre> |
| 195 | 6 | Guillermo Zdanowicz | |
| 196 | 6 | Guillermo Zdanowicz | composer update --no-scripts |
| 197 | 2 | Guillermo Zdanowicz | |
| 198 | 8 | Guillermo Zdanowicz | php artisan key:generate |
| 199 | 8 | Guillermo Zdanowicz | |
| 200 | 2 | Guillermo Zdanowicz | |
| 201 | 2 | Guillermo Zdanowicz | |
| 202 | 2 | Guillermo Zdanowicz | Agretar autenticacion de usuario |
| 203 | 2 | Guillermo Zdanowicz | |
| 204 | 2 | Guillermo Zdanowicz | php artisan make:auth |
| 205 | 2 | Guillermo Zdanowicz | |
| 206 | 2 | Guillermo Zdanowicz | php artisan migrate |
| 207 | 2 | Guillermo Zdanowicz | |
| 208 | 1 | Guillermo Zdanowicz | php artisan db:seed |