需要本地搭建1个伪授权站

原版主题:

伪站搭建(以apache2为例)

1.www下新建zibll目录, 添加index.php文件:

此处内容需要评论回复后方可阅读。

  1. 添加伪静态.htaccess文件:
<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
  1. 添加VirtualHost:
nano /etc/apache2/sites-enabled/000-default.conf
## 添加api.zibll.com
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName api.zibll.comb
    DocumentRoot /var/www/zibll

    ErrorLog ${APACHE_LOG_DIR}/error.log
    #CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
nano /etc/apache2/sites-enabled/
  1. 添加HTTPS,SSL用自签证书:
cd /etc/apache2/ssl
# 私钥文件
openssl genrsa -out private.key 2048
## 证书请求文件 默认回车即可
openssl req -new -key private.key -out server.csr
## 自签名证书
openssl x509 -req -days 365 -in server.csr -signkey private.key -out server.crt

nano /etc/apache2/sites-enabled/default-ssl.conf
## 添加api.zibll.com
    <VirtualHost *:443>
        ServerAdmin webmaster@localhost

        ServerName api.zibll.com
        DocumentRoot /var/www/zibll
    LogLevel error

        SSLEngine on
        SSLCertificateFile  /etc/apache2/ssl/server.crt
        SSLCertificateKeyFile /etc/apache2/ssl/private.key
    </VirtualHost>
  1. 修改hosts:
nano /etc/hosts
# 添加
# 127.0.0.1 api.zibll.com

service apache2 restart
  1. 登录后台,点击授权

QQ截图20230919211202.png

最后修改:2023 年 09 月 24 日 03 : 49 PM
如果觉得我的文章对你有用,无需赞赏用心感谢!