I didn’t know much about Linux before, but now I need to use Linux for my project, and then I have to learn it. The command line of Linux system is really too easy to play
I use CentOS 7 system, detailed command can go here to learn blog.csdn.net/qq_40087415…
Steps to install nginx
1. Install dependency packages
// One click to install the above four dependencies
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2. Download and decompress the installation package
// Create a folder
cd /usr/local
mkdir nginx
cd nginx
// Download the tar
wget http:
/ / nginx.org/download/nginx-1.13.7.tar.gz
The tar - XVF nginx - 1.13.7. Tar. Gz
Decompress the tar package
3. Install nginx
// Access the nginx directorycd /usr/local/nginx/nginx-1.13.7 // Notice installation directory ls // Check whether there is configure // run the command./configure // run the make install command make installCopy the code
4. To configure nginx. Conf
Open the configuration file
vi /usr/local/nginx/conf/nginx.conf
Change the port number to 8090. Apeache may occupy port 80. Do not change the apeache port, so change the nginx port.
Change localhost to your server IP address.
Here is the port that needs to be changed, INSERT on the keyboard for editing, and exit save. Esc + command:’ve (ps: other vim command learning www.cnblogs.com/firstcsharp.)
5. Start the nginx
cd /usr/local/nginx/
/usr/local/ nginx/sbin/nginx start after a successful check whether start success: ps - ef | grep nginxCopy the code
6. Disable the FIREWALL on the VM if you want to use an external host to connect to the VM.
Run the systemctl stop firewalld.service command to disable the firewall
Then access that IP to see the Nginx interface.
This completes the Linux installation of Nginx. Other commands can be baidu learning, mutual encouragement!
Original: www.cnblogs.com/yearshar/p/…