1. 程式人生 > 資訊 >Android 12 將原生支援第三方應用商店:可直接安裝和自動更新應用

Android 12 將原生支援第三方應用商店:可直接安裝和自動更新應用

安裝前準備

①安裝前檢視是否安裝nginx,可以是檢視版本

nginx -v

②升級前可以先備份,主要備份 nginx配置檔案 nginx.conf

cp -rf /usr/local/nginx_bak/conf/nginx.conf /usr/local/nginx/conf/nginx.conf

安裝命令:

1、前置的模組下載

yum -y install gcc pcre-devel zlib-devel openssl openssl-devel

2、官網下載 http://nginx.org/download.html 找到自己需要的版本下載(以下為最新版本)

#執行如下命令:
cd /home/tmp # 切換到安裝包下載路勁路徑
wget http://nginx.org/download/nginx-1.18.0.tar.gz # 去官網下載
wget http://nginx.org/download/nginx-版本號.tar.gz

3、解壓

tar -zxvf nginx-1.18.0.tar.gz # 預設解壓到nginx-1.18.0

注:nginx-1.18.0.tar.gz為下載的壓縮包名

# 解壓到指定資料夾
tar -zxvf nginx-1.18.0.tar.gz /home/temp/nginx_new  
# 解壓到指定路徑/home/temp/nginx_new

4、進入nginx目錄

cd nginx-1.18.0

5、配置

./configure --prefix=/usr/local/nginx  # 編譯的時候用來指定程式存放路徑

↑指定路徑為/usr/local/nginx

# 使用下面的配置
./configure --prefix=/usr/local/nginx --user=www-data --group=www-data --pid-path=/var/run/ginx.pid \
    --with-http_stub_status_module     \
    --with-http_gzip_static_module   \
    --with-http_realip_module          \

注:此處\表示是一行命令

。。。。

OK,現在可以執行make 了。

6、編譯&安裝

執行make、make install命令

make

make install

7、測試是否安裝成功

# cd到剛才配置的安裝目錄/usr/loca/nginx/
./sbin/nginx -t

作者安裝時遇到的錯誤,若沒有出現可忽略
錯誤資訊:

nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (2: No such file or directory)

2016/09/13 19:08:56 [emerg] 6996#0: open() "/usr/local/nginx/logs/access.log" failed (2: No such file or directory)

原因分析:nginx/目錄下沒有logs資料夾

解決方法:

# 建立logs資料夾
mkdir logs

# 修改logs資料夾許可權,所有者讀、寫、可執行
chmod 700 logs

正常情況的資訊輸出:

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

8、替換原本的nginx.conf

# 安裝後就有一個預設的nginx.conf
# 確認配置檔案 ,cp -rf 原來的nginx.conf 安裝路徑下的nginx.conf
cp -rf /usr/local/nginx_bak/conf/nginx.conf /usr/local/nginx/conf/nginx.conf

9、啟動nginx

# 在安裝的sbin下有啟動檔案
cd /usr/local/nginx/sbin

# 啟動nginx
./nginx

在瀏覽器中輸入伺服器的ip地址,如:192.168.1.12

====================== 分割線 ====================

配置完畢!

2、配置nginx開機自啟動

vim /etc/rc.d/rc.local

檢視nginx版本

nginx -v

檢視編譯引數

nginx -V

檢視安裝目錄

 rpm -ql nginx