MobaXterm_Personal是一款远程计算控制的工具,可以帮助你实现,显示系统网络设置、进行远程文件传输、执行网络监控等操作。除了远程监控外,本软件还支持多标签的终端,通过本软件,你可以创建 SSH, Telnet, Rlogin, RDP, VNC, XDMCP, FTP, SFTP or 串口等各种链接。并且你的每次链接都会自动保存并且出现在左侧链接窗口中,除此之外,mobaxterm 11还支持多分屏显示,方便管理多台服务器,并且你可以仅输入一次,让一条命令同时在这些不同的服务器终端执行。
1、
ps -ef | grep nginx 查看是否存在nginx
root 4484 4442 0 10:30 pts/1 00:00:00 grep --color=auto nginx
2、新增用户
useradd leyou
3、把nginx的压缩包放到leyou文件夹下
ll 查看leyou目录下详细信息
总用量 888
-rw-r--r--. 1 root root 908954 12月 11 10:39 nginx-1.10.0.tar.gz
4、解nginx压缩包
tar xvf nginx-1.10.0.tar.gz
5、删除压缩包
rm -rf nginx-1.10.0.tar.gz
6、切换到nginx-1.10.0目录下
cd nginx-1.10.0/
7、查看nginx-1.10.0目录下的详细信息
ll
总用量 668
drwxr-xr-x. 6 leyou leyou 4096 12月 11 10:41 auto
-rw-r--r--. 1 leyou leyou 262619 4月 26 2016 CHANGES
-rw-r--r--. 1 leyou leyou 400302 4月 26 2016 CHANGES.ru
drwxr-xr-x. 2 leyou leyou 168 12月 11 10:41 conf
-rwxr-xr-x. 1 leyou leyou 2481 4月 26 2016 configure
drwxr-xr-x. 4 leyou leyou 72 12月 11 10:41 contrib
drwxr-xr-x. 2 leyou leyou 40 12月 11 10:41 html
-rw-r--r--. 1 leyou leyou 1397 4月 26 2016 LICENSE
drwxr-xr-x. 2 leyou leyou 21 12月 11 10:41 man
-rw-r--r--. 1 leyou leyou 49 4月 26 2016 README
drwxr-xr-x. 9 leyou leyou 91 12月 11 10:41 src
8、安装报错gcc
yum -y install gcc
9、安装pcre-devel
yum -y install pcre-devel
10、安装zlib-devel
yum -y install zlib-devel
11、配置文件目录 ,指定安装目录在/opt/nginx目录下
[root@ly nginx-1.10.0]# ./configure --prefix=/opt/nginx --sbin-path=/usr/bin/ nginx
12、编译安装nginx
make && make install
13、启动nginx
[root@ly nginx-1.10.0]# nginx
14、查看进程
[root@ly nginx-1.10.0]# ps -ef | grep nginx
root 7318 1 0 10:55 ? 00:00:00 nginx: master process nginx
nobody 7319 7318 0 10:55 ? 00:00:00 nginx: worker process
root 7321 4442 0 10:55 pts/1 00:00:00 grep --color=auto nginx
15、防火墙操作
查看防火墙状态: systemctl status firewalld.service
执行关闭命令: systemctl stop firewalld.service
再次执行查看防火墙命令:systemctl status firewalld.service
执行开机禁用防火墙自启命令 : systemctl disable firewalld.service
16、开放端口(防火墙是开启的)
firewall-cmd --zone=public --add-port=80/tcp --permanent
加载
firewall-cmd --reload
重启防火墙:
systemctl stop firewalld.service
systemctl start firewalld.service
配置前先确保防火墙是运行着的 firewall-cmd --state
开启防火墙 service firewalld start
17、访问nginx
http://http://192.168.35.129/
18、开机自启
vi /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/nginx
ExecReload=/usr/bin/nginx -s reload
ExecStop=/usr/bin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl enable nginx.service
19、修改nginx.conf配置文件,配置反向代理
server {
listen 80;
server_name manage.leyou.com;
# access_log logs/big.server.access.log main;
location / {
root html;
proxy_pass http://127.0.0.1:9001;
}
}
server {
listen 80;
server_name api.leyou.com;
# access_log logs/big.server.access.log main;
location /api/upload {
rewrite "^/(.*)$" /zuul/$1;
}
location / {
root html;
proxy_pass http://127.0.0.1:10010;
}
}
重新启动
nginx -s reload