Warning: Undefined variable $flag in /home/wwwroot/xiaojun/wwwroot/usr/themes/Jdeal/functions.php on line 208

Warning: Undefined variable $flag in /home/wwwroot/xiaojun/wwwroot/usr/themes/Jdeal/functions.php on line 209

Warning: Undefined variable $output in /home/wwwroot/xiaojun/wwwroot/usr/themes/Jdeal/functions.php on line 215

记录:云服务器部分配置

Oct 11,2024

由于建了相册容量不够用,而虚拟主机普遍存储空间小的可怜,于是想到了服务器,价格便宜,唯一的不足是需要点服务器知识,什么都要自已配置,担心用不来,选来选去最终选了腾讯云轻量服务器。记录一些踩过的坑。

使用腾讯云服务器,进入控制面板选择”宝塔“面板开局,安装好宝塔后在应用管理页面登录 VNC 使用命令sudo /etc/init.d/bt default查询面板地址和用户名信息(使用命令sudo bt可修改用户名及密码)登录宝塔面板,进入后会提示一健部署,之后就可以上传网站、导入数据库等操作了。

伪静态:

网站 --设置--伪静态:

location / {
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php) {
rewrite (.*) $1/index.php;
}
if (!-f $request_filename) {
rewrite (.*) /index.php;
}
}

另一种:

        location / {
            if (-f $request_filename/index.html) {
                rewrite (.*) $1/index.html break;
            }
            if (-f $request_filename/index.php) {
                rewrite (.*) $1/index.php;
            }
            if (!-f $request_filename) {
                rewrite (.*) /index.php;
            }
        }
        # Typecho 伪静态
        if (!-e $request_filename) {
            rewrite ^(.*)$ /index.php$1 last;
        }
        # PHP 代理
        location ~ .*\.php(\/.*)*$ {
            include fastcgi.conf;
            fastcgi_pass unix:/run/php82-fpm/php-fpm.sock;
            fastcgi_index index.php;
        }

exif

开启 exif 扩展真的是让我一通好找,百度的方法完全不管用,原来点一下就好😂

如上图,打开控制面板-应用商店-找到 php8.1-设置-安装扩展-安装-结束。
真是简单的一 B,开始还以为搞服务器很难,其实现在供应商很卷,已经做到一健配置了,没有基础也是可以搞起来的,至此完美收官。

另:通过计划任务可重启服务

* 若非特殊说明,本站文章均为博主原创,码字不易,如需转载,请注明出处!有疑问可留言交流,谢谢。

瞎折腾/主题制作0 

记录:云服务器部分配置 - 哈喽!老王