Preface The computer I use is a Mac, and the operating system is macOS Mojave. A virtual machine is installed on the computer. The Centos7 operating system is installed on the virtual machine, and Nginx and Luau libraries are installed on it. The whole process is recorded after the system installation is completed. It is recommended to take a snapshot before installation so that you can restore it if there is a problem. Preparation If the installed Linux can connect to the Internet and the Linux ports can be used normally externally, you can ignore the following two steps: 1. Set up automatic IP acquisition (1) Enter the command on Linux [root@localhost ~]ip addr #View ip [root@localhost ~]nmcli connection show You can view the current network card information Mine is ens33 (2) Modify information [root@localhost ~]vi /etc/sysconfig/network-scripts/ifcfg-ens33 Change the last line ONBOOT=no to ONBOOT=yes (3) Restart network services [root@localhost ~]# systemctl restart network 2. Turn off the firewall systemctl stop firewalld.service #Stop firewall systemctl disable firewalld.service #Disable firewall startup 3. If you find that there is no wget command when preparing to install, you can first install it according to the line surface. If there is no wget command as prompted below, you can execute this step [root@localhost ~]#yum -y install wget Install 1. Install dependent environment [root@localhost ~]#yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel 2. Install LuaJIT I created the LuaJIT folder in the /usr/local path [root@localhost LuaJIT]#wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz [root@localhost LuaJIT]#tar –xvf LuaJIT-2.0.2.tar.gz [root@localhost LuaJIT]#cd LuaJIT-2.0.2 [root@localhost LuaJIT-2.0.2]#make install 3. Install nginx (1) Download ngx_devel_kit, lua-nginx-module, nginx I created the nginx folder in the /usr/local path [root@localhost nginx]#wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz [root@localhost nginx]#wget https://github.com/openresty/lua-nginx-module/archive/v0.10.9rc7.tar.gz [root@localhost nginx]#wget http://nginx.org/download/nginx-1.12.1.tar.gz #Note that the compressed package after downloading has no file name, but the version number can be used to distinguish which file it is [root@localhost nginx]#tar -xvf v0.3.0.tar.gz [root@localhost nginx]#tar -xvf v0.10.9rc7.tar.gz [root@localhost nginx]#tar -xvf nginx-1.12.1.tar.gz (2) Compile Nginx [root@localhost nginx]# cd nginx-1.12.1 [root@localhost nginx-1.12.1]#./configure --prefix=/usr/local/nginx --add-module=../ngx_devel_kit-0.3.0 --add-module=../lua-nginx-module-0.10.9rc7 (3) Installation [root@localhost nginx-1.12.1]#make [root@localhost nginx-1.12.1]#make install (4) Start nginx Nginx may report an error when starting
The file libluajit-5.1.so.2 cannot be found Solution 1. Find the two files libluajit-5.1.so.2 and libluajit-5.1.so.2.0.2 and copy them to the corresponding lib 64-bit is /usr/lib64 32-bit is /usr/lib [root@localhost nginx-1.12.1]#find / -name libluajit-5.1.so.2 Discover The file is installed by default in /usr/local/lib/libluajit-5.1.so.2 [root@localhost nginx-1.12.1]#cp /usr/local/lib/libluajit-5.1.so.2 /usr/lib64/ [root@localhost nginx-1.12.1]#cp /usr/local/lib/libluajit-5.1.so.2.0.2 /usr/lib64 In the nginx installation directory, modify the nginx.conf file Add the following code under the Server code block location /hello{ default_type 'text/plain'; content_by_lua 'ngx.say("hello,lua")'; } Start nginx [root@localhost nginx-1.12.1]#./configure Access the virtual corresponding address http://xxx.xxx.xxx/hello in the browser Display as follows So far, we have succeeded The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: CentOS6.9+Mysql5.7.18 source code installation detailed tutorial
>>: How to update the view synchronously after data changes in Vue
After a lot of trouble, I finally figured out the...
1. MYSQL index Index: A data structure that helps...
How to display text overflow? What are your needs...
Computed properties Sometimes we put too much log...
Table of contents A JSON is built on two structur...
When we write code, we often need to know the dif...
When I was at work today, the business side asked...
Today I was browsing the blog site - shoptalkshow...
NC's full name is Netcat (Network Knife), and...
Table of contents Environment Setup Overview 1.Wh...
You need to apply CSS to div or span at the same t...
Table of contents 1. Introduction 2. Usage 3. Dev...
Table of contents We have written about drag and ...
During the installation of Ubuntu 18, the mmx64.e...
1. Download address https://dev.mysql.com/downloa...