2021年4月12日 星期一

如何用shell在linux升級 Apache2

1.ubuntu 升級 Apache2 的指令
$sudo add-apt-repository ppa:ondrej/apache2
$sudo apt-get update
$sudo apt install apache2

1.01 shell 升級 Apache2
檔案名稱:UbuntuApache2Update.sh
檔案內容: 
#!/bin/bash
add-apt-repository ppa:ondrej/apache2
apt-get update
apt install apache2

2.CentOS7 升級 http 的指令
$sudo cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo
$sudo yum install httpd
$sudo systemctl restart httpd

2.01 shell 升級 Apache2
檔案名稱:CentOSHttpUpdate.sh
檔案內容: 
 #!/bin/bash
cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo
yum install httpd
systemctl restart httpd


沒有留言:

張貼留言

變更套件,重寫程式。只要點兩下,就能離開位子。讓電腦依照規劃自動下載YT影片

系列文章: 1. 只要點兩下,就能離開位子。讓電腦依照規劃自動下載YT影片 https://skjhcreator.blogspot.com/2022/11/youtube.html 2. 只要點兩下,就能離開位子。讓電腦依照公開的PlayList自動下載YT多媒體 https:...