CentOS6.5 install Openresty
The first step to Learning Open-source software is to go to the official website and check the installation guide and demo (examples ). For openresty, the official website provides detailed installation instructions:Http://openresty.org/en/installation.html
Let's start TIY.
1. Install Dependencies
Openresty depends on perl 5.6.1 +, libreadline, libpcre, libssl
Centos is a clone of Red Hat. Therefore, follow the steps of the RedHat user.
To avoid manual input during installation, add the-y option to the yum command.
Run 'sudoyum-y install readline-devel pcre-devel openssl-devel gcc'
If the installation is successful, you will see the completed
2. Install openresty
2.1 Download openresty of a release version
I did not use the latest version, but chose 1.9.7.3.
2.2 decompress the file
Run the 'tar-zxvf openresty-1.9.7.3.tar.gz'
2.3 run './configure' to generate several files, including an important configuration file Makefile
2.4 run 'make' to execute the first compilation rule in Makefile. If you are familiar with ant in java (basically corresponding to ant target), then you can easily do something, let's take a look at the Makefile content.
2.5 After compilation, run 'make install'
If everything goes well, openresty will be installed.
The installation may fail and a permission error is prompted. This is because openresty is installed in the/usr/local/openresty/directory by default and requires the root permission, run 'sudo make install' again to complete the installation.
2.6 start nginx
Okay. So far, we have successfully installed Openresty, and the rest is to configure and use it.