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


沒有留言:

張貼留言

Laravel 12 Model 資料庫中的資料表,並提供與資料庫互動的介面

相關系列文章: 1. 在 windows 10 安裝 laravel 12 studentManagement環境與設定 2. laravel 12 route 路由 3. laravel 12 Blade Templates 網頁模版 4. laravel 12 Control...