最近在玩容器,而且在做一些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-01)
- 國泰世華支票出包燒到我~靠北邊走 (2011-03-10)
- 南山網站系統寫的這麼爛 被罰 真的一點也不意外 (2019-09-26)
- 本站開始轉到專業的VPS上運作 (2010-11-23)
- 誰說大廠不會出包 (2015-10-05)