zoukankan      html  css  js  c++  java
  • linux系统中部署apache服务(为个人网站设置密码)

    实验环境接“ linux系统中部署apache服务(个人用户主页功能)”。

    1、在PC1服务器端为用户usertest1创建密码库

    [root@PC1 ~]# htpasswd -c /etc/httpd/passwd usertest1  ## 这个usertest1不必是系统已经存在的账户,只是用于登录用
    New password: 
    Re-type new password: 
    Adding password for user usertest1

    2、在PC1主机中修改个人用户主页功能的配置文件

     …………
    28
    # Control access to UserDir directories. The following is an example 29 # for a site where these directories are restricted to read-only. 30 # 31 <Directory "/home/*/public_html"> 32 AllowOverride all 33 authuserfile "/etc/httpd/passwd" 34 authname "My privately website" 35 authtype basic 36 require user usertest1 ## 这个账户不必是已经存在的用户,只是一个登录账号 37 </Directory> 38

    3、 在PC1服务器端重启httpd服务

    [root@PC1 ~]# systemctl restart httpd
    [root@PC1 ~]# systemctl enable httpd
    [root@PC1 ~]# systemctl status httpd.service 
    httpd.service - The Apache HTTP Server
       Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
       Active: active (running) since Thu 2020-12-17 00:04:07 CST; 19s ago
     Main PID: 4861 (httpd)
       Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
       CGroup: /system.slice/httpd.service
               ├─4861 /usr/sbin/httpd -DFOREGROUND
               ├─4862 /usr/sbin/httpd -DFOREGROUND
               ├─4863 /usr/sbin/httpd -DFOREGROUND
               ├─4864 /usr/sbin/httpd -DFOREGROUND
               ├─4865 /usr/sbin/httpd -DFOREGROUND
               └─4866 /usr/sbin/httpd -DFOREGROUND
    
    Dec 17 00:04:07 PC1 systemd[1]: Starting The Apache HTTP Server...
    Dec 17 00:04:07 PC1 httpd[4861]: AH00557: httpd: apr_sockaddr_info_get() failed for PC1
    Dec 17 00:04:07 PC1 httpd[4861]: AH00558: httpd: Could not reliably determine the s...age
    Dec 17 00:04:07 PC1 systemd[1]: Started The Apache HTTP Server.
    Hint: Some lines were ellipsized, use -l to show in full.

    3、在PC2客户端测试配置效果

     

     

     

    注:这个账户就是普通的账户,不必是系统已经存在的账户

    以上实验实现了对个人主页功能登录账号和密码的设置。

  • 相关阅读:
    (C#)一个WCF简单实例
    C#如何为winform程序打包发布应用(图解教程)
    CSLA之对象状态的跟踪
    猎豹浏览器中附带的2个文件【12306抢票插件相关的】
    将数据库表直接导到Visio中!
    Visual Studio 开发 SharePoint 2010
    Sharepoint 2010 应用范围
    SharePoint自定义权限级别【转】
    SharePoint 2010 安装系统和所需软件
    objectiveC nil,Nil,NULL 和NSNull的小结
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/14147592.html
Copyright © 2011-2022 走看看