详解CentOS 7.0源码包搭建LNMP 实际环境搭建

2019-10-13 13:12:24刘景俊

6、给 /etc/init.d/nginx 可执行权限

chmod +x /etc/init.d/nginx

7、设置开机启动

chkconfig nginx on

8、启动nginx

service nginx start

十一、测试

[root@QKA169 src]# openssl version  
OpenSSL 1.1.0c 10 Nov 2016
mysql -u root -p123456
mysql> show databases; 
+--------------------+
| Database   |
+--------------------+
| information_schema |
| mysql    |
| performance_schema |
| sys    |
+--------------------+
4 rows in set (0.00 sec)
看看是否登陆成功。远程带IP是否登陆成功
mysql -u root -h192.168.1.69 -p123456
mysql> show databases; 
+--------------------+
| Database   |
+--------------------+
| information_schema |
| mysql    |
| performance_schema |
| sys    |
+--------------------+
4 rows in set (0.00 sec)
 
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 6
Server version: 5.7.16 Source distribution
 
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
 
mysql>

测试nginx 是否能打开

[root@QKA169 html]# ps -ef | grep php-fpm
root  337433  1 0 18:03 ?  00:00:00 php-fpm: master process (/usr/local/php7/etc/php-fpm.conf)
nobody 337434 337433 0 18:03 ?  00:00:00 php-fpm: pool www
nobody 337435 337433 0 18:03 ?  00:00:00 php-fpm: pool www
root  337454 37888 0 18:12 pts/0 00:00:00 grep --color=auto php-fpm
[root@QKA169 html]# ps -ef | grep nginx
root  337400  1 0 18:01 ?  00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx  337401 337400 0 18:01 ?  00:00:00 nginx: worker process
root  337456 37888 0 18:13 pts/0 00:00:00 grep --color=auto nginx
[root@QKA169 html]# netstat -nalp | grep 80
tcp  0  0 0.0.0.0:80    0.0.0.0:*    LISTEN  337400/nginx: maste 
tcp  0  0 192.168.1.69:80   192.168.6.6:54714  TIME_WAIT -     
tcp  0  0 192.168.1.69:80   192.168.6.6:54709  TIME_WAIT - 
远程打开     
http://192.168.1.69/

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易采站长站。