更新伪静态

This commit is contained in:
yumo 2023-07-17 17:45:59 +08:00
parent d8e693aa52
commit 8226105ac9
1 changed files with 34 additions and 43 deletions

View File

@ -23,56 +23,47 @@ ape_blog源码云博客
/public /public
/runtime /runtime
3. 安装好拓展 3. 安装好拓展
4. 配置好域名,在浏览器里打开域名,根据安装向导进行安装 4. 设置伪静态
5. 后台登录 http://域名/admin 5. 配置好域名,在浏览器里打开域名,根据安装向导进行安装
6. 后台登录 http://域名/admin
## 手动安装 ## 设置伪静态
1.创建数据库,倒入数据库文件 ```ngnixconf
数据库文件目录/public/install/learn.sql location /admin/ {
index index.php index.html index.htm;
if (!-e $request_filename){
#后台文件更名了需要在这里修改
rewrite ^/admin/(.*)$ /admin.php?s=$1;
}
}
2.修改数据库连接文件 location /api/ {
配置文件路径/.env index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/api/(.*)$ /api.php?s=$1;
}
}
~~~ location / {
APP_DEBUG = true index index.php index.html index.htm;
#如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
if (!-e $request_filename){
#地址作为将参数rewrite到index.php上。
rewrite ^/(.*)$ /index.php?s=$1 last;
#若是子目录则使用下面这句将subdir改成目录名称即可。
#rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1;
}
}
[APP] ```
DEFAULT_TIMEZONE = Asia/Shanghai
[DATABASE] ```apacheconf
TYPE = mysql RewriteRule '^/admin/(.*)$$' /admin.php?s=$1; [L]
HOSTNAME = 127.0.0.1 #数据库连接地址 RewriteRule '^/api/(.*)$$' /api.php?s=$1; [L]
DATABASE = test #数据库名称 RewriteRule '^/(.*)$$' /index.php?s=$1 [L]
USERNAME = username #数据库登录账号 ```
PASSWORD = password #数据库登录密码
HOSTPORT = 3306 #数据库端口
CHARSET = utf8
DEBUG = true
[LANG]
default_lang = zh-cn
~~~
3.安装php拓展
~~~
redis
~~~
4.创建目录并修改目录权限linux系统777
~~~
mkdir public/upload
mkdir runtime
chmod -R 777 public/storage
chmod -R 777 runtime
~~~
5.后台登录:
http://域名/admin
默认账号admin 密码123456
## 文档 ## 文档