日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟

剛買(mǎi)了阿里云ECS云服務(wù)器,想搭建自己網(wǎng)站
前提 centos服務(wù)管理systemctl 是管制服務(wù)的主要工具,它整合了chkconfig 與 service功能于一體 。
systemctl is-enabled iptables.service
systemctl is-enabled servicename.service #查詢服務(wù)是否開(kāi)機(jī)啟動(dòng)
systemctl enable *.service #開(kāi)機(jī)運(yùn)行服務(wù)
systemctl disable *.service #取消開(kāi)機(jī)運(yùn)行
systemctl start *.service #啟動(dòng)服務(wù)
systemctl stop *.service #停止服務(wù)
systemctl restart *.service #重啟服務(wù)
systemctl reload *.service #重新加載服務(wù)配置文件
systemctl status *.service #查詢服務(wù)運(yùn)行狀態(tài)
systemctl –failed #顯示啟動(dòng)失敗的服務(wù)
【在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟】注:*代表某個(gè)服務(wù)的名字,如http的服務(wù)名為httpd
例如在CentOS 7 上安裝http
[root@CentOS7 ~]# yum -y install httpd
啟動(dòng)服務(wù)(等同于service httpd start)
systemctl start httpd.service
停止服務(wù)(等同于service httpd stop)
systemctl stop httpd.service
重啟服務(wù)(等同于service httpd restart)
systemctl restart httpd.service
查看服務(wù)是否運(yùn)行(等同于service httpd status)
systemctl status httpd.service
開(kāi)機(jī)自啟動(dòng)服務(wù)(等同于chkconfig httpd on)
systemctl enable httpd.service
開(kāi)機(jī)時(shí)禁用服務(wù)(等同于chkconfig httpd on)
systemctl disable httpd.service
查看服務(wù)是否開(kāi)機(jī)啟動(dòng) (等同于chkconfig –list)
一 搭建LNMP環(huán)境使用了阿里云這篇文檔
http://www.jinnalai.com/uploads/article/2021/09/29/86221.html 默認(rèn)網(wǎng)站路徑
配置路徑
vim /etc/nginx/nginx.conf

在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟


默認(rèn)網(wǎng)站路徑
root /usr/share/nginx/html;
在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟


問(wèn)題1: nginx啟動(dòng)不了
netstat -nltp
發(fā)現(xiàn)啟動(dòng)了httpd服務(wù) 這可能是之前操作lamp環(huán)境時(shí)開(kāi)的,
這兩個(gè)服務(wù)不能同時(shí)開(kāi),需要關(guān)閉一個(gè)
停止http服務(wù) systemctl stop httpd
然后再執(zhí)行 systemctl start nginx
而且還需要取消開(kāi)機(jī)啟動(dòng)httpd 服務(wù)
systemctl disable httpd.service
列出網(wǎng)絡(luò)連接
netstat -nltp

在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟



在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟


?
問(wèn)題2:
在地址欄輸入http://<ECS實(shí)例公網(wǎng)IP地址>/phpinfo.php后,打不開(kāi)網(wǎng)頁(yè)
原因,在安全組添加規(guī)則

在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟



在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟


?
具體:

在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟



在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟


?

在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟



在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟


?
問(wèn)題3:

在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟



在服務(wù)器上搭建網(wǎng)站教程 云服務(wù)器建站步驟


?
解決:
云服務(wù)器安全組
參考這篇文章
workbench遠(yuǎn)程連接到linux實(shí)例

    推薦閱讀