当前位置:网站首页>Openresty Foundation

Openresty Foundation

2022-06-23 16:16:00 chinusyan

Preparation before installation

You must add these libraries perl 5.6.1+, libpcre, libssl Installed on your computer . about Linux Come on ,

yum install pcre-devel openssl-devel gcc curl postgresql-devel

structure OpenResty

From the download page Download Download the latest OpenResty Source package , And unzip it like the following example :

wget https://openresty.org/download/openresty-1.21.4.1.tar.gz
tar -xvzf openresty-1.21.4.1.tar.gz

./configure

And then into openresty-1.21.4.1/ Catalog , Then enter the following command to configure :

./configure --prefix=/usr/local/openresty \
            --with-luajit \
            --without-http_redis2_module \
            --with-http_iconv_module \
            --with-http_postgres_module \
            --with-http_stub_status_module \
            --with-http_gzip_static_module \
            --with-luajit \
            --with-http_ssl_module
           

Default , --prefix=/usr/local/openresty The program will be installed in /usr/local/openresty Catalog .
Try to use ./configure --help See more options .

make

You can use the following command to compile :

make

If your computer supports multicore make The nature of work , You can compile :

make -j2 # Suppose your machine is dual core .

make install

If the previous steps are all right , You can use the following command to install OpenResty To your system :

make install

ssl certificate
https://cloud.tencent.com/document/product/400/35244

nginx To configure

server {
    
    listen 443 ssl;
    # To configure HTTPS The default access port for is 443.
    # If not configured here HTTPS The default access port of , It may cause Nginx Can't start .
    # If you use Nginx 1.15.0 And above , Please use listen 443 ssl Instead of listen 443 and ssl on.
    server_name yourdomain.com; # Need to put yourdomain.com Replace with domain name bound by certificate .
    root html;
    index index.html index.htm;
    ssl_certificate cert/cert-file-name.pem;  # Need to put cert-file-name.pem Replace with the name of the uploaded certificate file .
    ssl_certificate_key cert/cert-file-name.key; # Need to put cert-file-name.key Replace with the name of the uploaded certificate private key file .
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    # Represents the type of encryption suite used .
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; # Indicates the TLS The type of agreement .
    ssl_prefer_server_ciphers on;
    location / {
    
        root html;  # Site directory .
        index index.html index.htm;
    }
}

原网站

版权声明
本文为[chinusyan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206231507333279.html