作业第一次

[C:\~]$ ssh 192.168.227.129

Connecting to 192.168.227.129:22...

Connection established.

To escape to local shell, press 'Ctrl+Alt+]'.

Activate the web console with: systemctl enable --now cockpit.socket

Register this system with Red Hat Insights: insights-client --register

Create an account or view all your systems at https://red.ht/insights-dashboard

Last login: Tue  Apr 23 14:10:37 2024 from 192.168.227.1

[root@server ~]#

[root@server ~]# yum  install  httpd  -y

CentOS-9-stream - Base - mirrors.aliyun.com                                           259  B/s | 3.9 kB     00:15    

CentOS-9-stream - Base - mirrors.aliyun.com             

 mod_http2-1.15.19-4.el9.x86_64          mod_lua-2.4.57-2.el9.x86_64            

完毕!

[root@server ~]# setenforce  0

setenforce: SELinux is disabled

[root@server ~]# systemctl stop  firewalld

[root@server ~]# systemctl disable  firewalld

[root@server ~]# systemctl start  httpd

[root@server ~]# systemctl enable  httpd

Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.

[root@server ~]# systemctl status  httpd

● httpd.service - The Apache HTTP Server

     Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)

     Active: active (running) since Mon 2024-04-10 13:02:19 CST; 13s ago

       Docs: man:httpd.service(8)

   Main PID: 32976 (httpd)

     Status: "Total requests: 0; Idle/Busy workers 100/0;Requests/sec: 0; Bytes served/sec:   0 B/sec"

      Tasks: 213 (limit: 11984)

     Memory: 43.3M

        CPU: 63ms

     CGroup: /system.slice/httpd.service

             ├─32976 /usr/sbin/httpd -DFOREGROUND

             ├─32978 /usr/sbin/httpd -DFOREGROUND

             ├─32979 /usr/sbin/httpd -DFOREGROUND

             ├─32980 /usr/sbin/httpd -DFOREGROUND

             └─32981 /usr/sbin/httpd -DFOREGROUND

4月10 13:02:12 server systemd[1]: Starting The Apache HTTP Server...

4月 10 13:02:12 server httpd[32976]: AH00558: httpd: Could not reliably determine the server's fully qualified domain>

4月 10 13:02:19 server systemd[1]: Started The Apache HTTP Server.

4月 10 13:02:19 server httpd[32976]: Server configured, listening on: port 80

[root@server ~]# echo  "Welcome to openlab.com"  >  /var/www/html/index.html

[root@server ~]# systemctl start httpd

[root@server ~]# vim  /etc/hosts

[root@server ~]# systemctl restart httpd

[root@server ~]# echo  "Welcome to openlab.com"  >  /var/www/html/index.html

[root@server ~]# systemctl restart httpd

[root@server ~]# systemctl restart httpd

[root@server ~]# mkdir -p /www/openlab

[root@server ~]# systemctl restart httpd

[root@server ~]# mkdir -p /www/openlab

[root@server ~]# systemctl restart httpd

[root@server ~]# vim  /etc/hosts

[root@server ~]# vim  /etc/httpd/conf.d/userdir.conf

[root@server ~]# vim  /etc/httpd/conf.d/userdir.conf

[root@server ~]# mkdir -p /www/openlab/student

[root@server ~]# mkdir -p /www/openlab/data

[root@server ~]# mkdir -p /www/openlab/money

[root@server ~]# vim  /etc/hosts

[root@server ~]# vim  /etc/hosts

[root@server ~]# vim  /etc/httpd/conf/httpd.conf

[root@server ~]# systemctl restart httpd

[root@server ~]# systemctl restart httpd

[root@server ~]# vim  /etc/hosts

[root@server ~]# vim  /etc/httpd/conf/httpd.conf

[root@server ~]# vim  /etc/httpd/conf/httpd.conf

[root@server ~]# echo 'this is openlab data' > /www/openlab/data/index.html

[root@server ~]# echo 'this is openlab student' > /www/openlab/student/index.html

[root@server ~]# systemctl restart httpd

[root@server ~]# systemctl restart httpd

[root@server ~]# echo 'this is openlab money' > /www/openlab/money/index.html

[root@server ~]# vim  /etc/httpd/conf/httpd.conf

[root@server ~]# systemctl restart httpd

[root@server ~]#

[root@server ~]# echo 'welcome to openlab!!!' > /www/openlab/index.html

[root@server ~]# systemctl restart httpd

[root@server ~]# mount /dev/sr0 /mnt

mount: /mnt: /dev/sr0 已挂载于 /run/media/root/RHEL-9-1-0-BaseOS-x86_64.

[root@server ~]# yum install mod_ssl -y

======================================================================================================================

 软件包                   架构                    版本                               仓库                        大小

======================================================================================================================

安装:

 mod_ssl                  x86_64                  1:2.4.57-2.el9                     AppStream                  112 k

升级:

 sscg                     x86_64                  3.0.0-7.el9                        AppStream       

[root@server ~]# yum  install  httpd  mod_ssl  -y

软件包 httpd-2.4.57-2.el9.x86_64 已安装。

软件包 mod_ssl-1:2.4.57-2.el9.x86_64 已安装。

依赖关系解决。

无需任何处理。

完毕!

[root@server ~]# cd  /etc/pki/tls/private/

[root@server private]# ls

localhost.key  openlab.key

[root@server private]# openssl  genrsa  -aes128   2048  >  zy.key

Enter PEM pass phrase:

Verifying - Enter PEM pass phrase:

[root@server private]# mkdir /openlab

[root@server private]# cd

[root@server ~]# mkdir /openlab

mkdir: 无法创建目录 “/openlab”: 文件已存在

[root@server ~]# cd  /etc/pki/tls/private/

[root@server private]# openssl  genrsa  -aes128   2048  >  openlab.key

Enter PEM pass phrase:

Verifying - Enter PEM pass phrase:

[root@server private]# cd

[root@server ~]# mkdir  /openlab

mkdir: 无法创建目录 “/openlab”: 文件已存在

[root@server ~]# cd  /etc/pki/tls/private/

[root@server private]# ls

localhost.key  openlab.key  zy.key

[root@server private]# openssl  genrsa  -aes128   2048  >  openlab.key

Enter PEM pass phrase:

Verifying - Enter PEM pass phrase:

[root@server private]# cd  /etc/pki/tls/certs/

[root@server certs]# openssl  req  -utf8  -new  -key  /etc/pki/tls/private/openlab.key  -x509  -days  365  -out  openlab.crt

Enter pass phrase for /etc/pki/tls/private/openlab.key:

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter '.', the field will be left blank.

-----

Country Name (2 letter code) [XX]:86

State or Province Name (full name) []:shanxi

Locality Name (eg, city) [Default City]:xi'an

Organization Name (eg, company) [Default Company Ltd]:openlab

Organizational Unit Name (eg, section) []:ce

Common Name (eg, your name or your server's hostname) []:server

Email Address []:andy@qq.com

[root@server certs]# cd

[root@server ~]# vim  /etc/httpd/conf.d/ssl.conf

[root@server ~]# systemctl start httpd

[root@server ~]# mkdir /openlab

mkdir: 无法创建目录 “/openlab”: 文件已存在

[root@server ~]# cd  /etc/pki/tls/private/

[root@server private]# openssl  genrsa  -aes128   2048  >  openlab.key

Enter PEM pass phrase:

Verifying - Enter PEM pass phrase:

[root@server private]# cd

[root@server ~]# mkdir  /openlab

mkdir: 无法创建目录 “/openlab”: 文件已存在

[root@server ~]# cd  /etc/pki/tls/private/

[root@server private]# ls

localhost.key  openlab.key  zy.key

[root@server private]# openssl  genrsa  -aes128   2048  >  openlab.key

Enter PEM pass phrase:

Verifying - Enter PEM pass phrase:

[root@server private]# cd  /etc/pki/tls/certs/

[root@server certs]# openssl  req  -utf8  -new  -key  /etc/pki/tls/private/openlab.key  -x509  -days  365  -out  openlab.crt

Enter pass phrase for /etc/pki/tls/private/openlab.key:

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter '.', the field will be left blank.

-----

Country Name (2 letter code) [XX]:86

State or Province Name (full name) []:shanxi

Locality Name (eg, city) [Default City]:xi'an

Organization Name (eg, company) [Default Company Ltd]:openlab

Organizational Unit Name (eg, section) []:ce

Common Name (eg, your name or your server's hostname) []:server

Email Address []:andy@qq.com

[root@server certs]# cd

[root@server ~]# vim  /etc/httpd/conf.d/ssl.conf

[root@server ~]# systemctl start httpd

  • 13
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值