最近在玩容器,而且在做一些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;
}
}
隨機文章
- 百貨折扣不夠看 週年慶加碼送現金 (2007-11-21)
- 一階段、兩階段都不如我的「蔣氏零階段」 (2008-01-14)
- 轉貼:用distinct在MySQL中查詢多條不重複記錄值 (2011-10-17)
- hTC是行銷不如人 還是獲利賺太多 還是乎略使用者的聲音? (2013-01-08)
- 盆栽 甜椒盆栽 龍眼盆栽 (2011-11-14)