《Linux系统网站部署》一眼就会,【linux基础】【纯静态网站】【简单版】

68 篇文章 0 订阅
54 篇文章 3 订阅

抽时间做了笔记:

为了安全所有的路径必须特定-重新建立指定。再此就不做要求了选择了默认路径。
linux基础:
-----------start-------------
设置新密码:
# sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
登录:
# su root
Password:
root@ubuntu:/home/ubuntu# ls
root@ubuntu:/home/ubuntu# cd /
root@ubuntu:/# ls

----(root@redhad:/# apt install yum
----root@redhad:/# yum install -y lrzsz)
安装文件系统:
root@VM-8-15-ubuntu:/# apt-get install -y lrzsz
上传文件:
root@VM-8-15-ubuntu:/# rz
--add pull file

更新:
sudo apt-get update
安装:nginx
sudo apt-get install nginx
输入y

测试:sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

云服务开启相关端口:
浏览器ip回车:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

配置ssl/https:
]# cd /etc/nginx/
拷贝文件:
#rz
---上传ssl 配置文件,key and  crt

添加文件:
 cd /usr/share/nginx/html
rz


cd /etc/nginx/conf.d
touch xxxkeji.conf 
vim xxxkeji.conf 
加入:
--

server {
        listen      443 ssl;

        server_name  www.xxxkeji.com;
        
        root         /usr/share/nginx/html;
        
        ssl_certificate          xxkeji.crt;
        ssl_certificate_key      xxkeji.key;
        
        include /etc/nginx/default.d/*.conf;

        location / {
        root    /usr/share/nginx/html;
        index   xxxkeji.html;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

--
--保存退出:esc键 :wq 
--
root@VM-0-16-ubuntu:/etc/nginx/conf.d# cd
root@VM-0-16-ubuntu:~# service nginx restart
root@VM-0-16-ubuntu:~# 
2.进入该目录下
cd /usr/sbin

3. 重启
./nginx -s reload
--开启云上服务器进出安全规则443端口及域名解析www、关联云服务器IP。

------其他--------
----rar------------------------------------------------------
----------------
压缩功能

安装 sudo apt-get install rar
--卸载 sudo apt-get remove rar

解压功能

安装 sudo apt-get install unrar
--卸载 sudo apt-get remove unrar

.rar

解压:rar x FileName.rar

--压缩:rar a FileName.rar DirName
--(删除html文件夹:rm html -r  新建:mkdir html 
删除文件:rm files.txt -r

--------end------
-----------------
-------------------------------------------------------------
--安装路径:
var/lib/nginx
etc/nginx
html文件路径:
 /usr/share/nginx/html

在使用vim编辑
按Esc进入命令:
输入小写:gg 至首行
再输入小写:d
再输入大写(按住Ctrl+G):G
--d为删除,G为至末尾。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值