ubuntu 2004 LEMP Quickly Install Guide.

最近在玩容器,而且在做一些linux架構優化,一常常重灌ubuntu,就把會用到的指令記錄下來,加快處理的時間。
1.先更新
sudo apt-get update
2.安裝nginx / mysql-server / php7.4-fpm
sudo apt install nginx php7.4-fpm php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl mysql-server -y
3.設定mysql


sudo mysql_secure_installation
4.常用套件安裝
sudo apt-get install unzip curl wget iftop htop openssh-server cifs-utils
5.nginx 修改
vi /etc/nginx/site-available
server {
listen 80 default_server;
listen [::]:80 default_server;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm index.nginx-debian.html;

    server_name _;

    location ~ \.php$ {
           include snippets/fastcgi-php.conf;

           # With php-fpm (or other unix sockets):
           fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
           # With php-cgi (or other tcp sockets):
           #fastcgi_pass 127.0.0.1:9000;
    }

}

精選文章

讀取中…

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *