最近在玩容器,而且在做一些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;
}
}
隨機文章
- Windows 10 / Windows 7 使用 RDP wrapper 10分鐘完成遠端桌面多人連線 (2022-06-01)
- 我只懂二次開發,我不懂二次創作 (2017-04-25)
- 域名+DNS設定=免費電郵 (2008-06-06)
- SEO-創建有效鏈接的關鍵 (2007-11-22)
- 北縣立醫院第一個保肝中心成立 免費抽血肝功能檢查 (2007-11-12)