about 3 years ago

sudo apt-get update
sudo apt-get install software-properties-common
--nginx
sudo apt-get install nginx
sudo apt-get install php-fpm php-mysql
sudo vim /etc/php/7.0/fpm/pool.d/www.conf

pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

sudo vim /etc/php/7.0/fpm/php.ini
--update cgi.fix_pathinfo=0
--update upload_max_filesize = 8M
--update max_execution_time = 300
sudo vim /etc/nginx/nginx.conf

events{
    worker_connections 1024; # 可以加到 4096
  use epoll;
}
http{
    keepalive_timeout 1;
}

gzip_disable "msie6";

         gzip_vary on;
         gzip_proxied any;
         gzip_comp_level 6;
         gzip_buffers 16 8k;
         gzip_http_version 1.1;
         gzip_min_length 256;
         #gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
        gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss application/javascript text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;

sudo vim /etc/nginx/sites-available/default

server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;

server_name your-IP;
    client_max_body_size 8M;
location / {
    try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_read_timeout 300;
}

location ~ /\.ht {
    deny all;
}

}
--apache2
sudo apt-get install apache2
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php7.0
sudo apt-get install libapache2-mod-php libapache2-mod-php

sudo apt-get install php-xml php-mcrypt php-cli php-curl curl php-cli git php-mbstring php-zip
sudo apt-get install mariadb-server
sudo mysql -u root
CREATE USER 'twjoin'@'localhost' IDENTIFIED BY 'twjoin';
GRANT ALL PRIVILEGES ON . TO 'twjoin'@'localhost' WITH GRANT OPTION;

sudo apt-get install phpmyadmin
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

sudo a2enmod rewrite
--PHP5.6 AND 7.0 UBUNTU 14.04
sudo apt-get install php-mysql php-gettext php-mbstring php-xdebug php-gd php-iconv php-json

Laravel Setting
sudo chown -R www-data:www-data /path/to/your/laravel/root/directory
sudo usermod -a -G www-data ubuntu
sudo find /path/to/your/laravel/root/directory -type f -exec chmod 644 {} \;

sudo find /path/to/your/laravel/root/directory -type d -exec chmod 755 {} \;

sudo chgrp -R www-data storage
sudo chgrp -R www-data bootstrap/cache

sudo chmod -R ug+rwx storage
sudo chmod -R ug+rwx bootstrap/cache

find storage -type f -name ".gitignore" -exec chmod 644 {} \;

install php7.2

sudo apt-get update && apt-get upgrade
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
sudo apt-get install php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml

php7.2 mycrypt

sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install libmcrypt-dev
sudo pecl install mcrypt-1.0.1
← hMailServer 增加DKIM紀錄 Amazon雲端費用試算工具 →
 
comments powered by Disqus