Last active
January 6, 2018 19:56
-
-
Save ahkui/8b168657170990f7a8afc7e3efcb3c83 to your computer and use it in GitHub Desktop.
linux install laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| software-properties-common \ | |
| language-pack-en-base && \ | |
| LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php && \ | |
| apt-get update && \ | |
| apt-get upgrade -y && \ | |
| apt-get install -y \ | |
| curl \ | |
| git \ | |
| unzip \ | |
| nginx \ | |
| nodejs \ | |
| npm \ | |
| php7.1-fpm \ | |
| php7.1-mysql \ | |
| php7.1-curl \ | |
| php7.1-mcrypt \ | |
| php7.1-xml \ | |
| php7.1-mbstring \ | |
| php7.1-zip && \ | |
| curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \ | |
| composer global require laravel/installer && \ | |
| echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' > ~/.bashrc && \ | |
| source ~/.bashrc && \ | |
| cd /var/www && \ | |
| laravel new laravel && \ | |
| sed -i -e"s/# listen 443 ssl default_server;/listen 443 ssl default_server;\n\tlisten [::]:443 ssl default_server;/" /etc/nginx/sites-available/default && \ | |
| sed -i -e"s/root \/var\/www\/html;/root \/var\/www\/laravel\/public;/" /etc/nginx/sites-available/default && \ | |
| sed -i -e"s/index index.html index.htm index.nginx-debian.html;/index index.php;/" /etc/nginx/sites-available/default && \ | |
| sed -i -e"s/server_name _;/server_name localhost;/" /etc/nginx/sites-available/default && \ | |
| sed -i -e"s/try_files \$uri \$uri\/ =404/try_files \$uri \$uri\/ \/index.php?\$query_string/" /etc/nginx/sites-available/default && \ | |
| sed -i -e"s/#\tinclude snippets\/fastcgi-php.conf;/location ~ \\\.php$ {\n\t\tinclude snippets\/fastcgi-php.conf;\n\t\tfastcgi_pass unix:\/run\/php\/php7.1-fpm.sock;\n\t\tfastcgi_split_path_info ^(.+\\\.php)(\/.+)$;\n\t}\n\n\tlocation ~ \/\\\.ht {\n\t\tdeny all;\n\t}\n/" /etc/nginx/sites-available/default && \ | |
| cd laravel && \ | |
| composer install && \ | |
| chmod -R 777 ./storage && \ | |
| service php7.1-fpm start && \ | |
| service nginx start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment