Typecho:修订间差异

来自MalacoKnowledge
imported>Malacology
→‎nginx:​ formatting
imported>Malacology
→‎PHP:​ formattig
 
第45行: 第45行:


==PHP==
==PHP==
<pre>$ vim /etc/php7/php.ini</pre>去掉<pre>;extension=mysqli
<pre>$ vim /etc/php7/php.ini</pre>去掉
;extension=pdo_mysql</pre>前面的<code>;</code><pre>systemctl enable php-fpm7
<pre>;extension=mysqli
;extension=pdo_mysql</pre>前面的<code>;</code>
 
<pre>systemctl enable php-fpm7
systemctl restart php-fpm7</pre>
systemctl restart php-fpm7</pre>
==mariadb==
==mariadb==
详见 mariadb 一节
详见 mariadb 一节

2022年5月25日 (三) 04:54的最新版本

安装

$ yay -S typecho

nginx

编辑配置文件

$ vim /etc/nginx/conf.d/typecho.conf

文件内容如下,# 注释内容可以不注释,但是前提是自己配置好 SSL 的公钥和密钥。

server {
            listen 80;
            server_name 127.0.0.1;
#            return 301 https://$server_name$request_uri;
#}
#server {
#    listen 443 ssl http2;
#    server_name domain;
    root /usr/share/webapps/typecho;
#    ssl_certificate /etc/KEY;
#    ssl_certificate_key /etc/KEY;
#    ssl_session_cache builtin:1000 shared:SSL:10m;
#    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
#    ssl_prefer_server_ciphers on;
    access_log /var/log/nginx/freshrss_access.log;
    error_log /var/log/nginx/freshrss_error.log;
     location / {
            index  index.php index.html index.htm;
     }
        location  ~ .*\.php(\/.*)*$ {
        # 404
        try_files $fastcgi_script_name =404;
    fastcgi_split_path_info ^(.+?.php)(/.*)$;
        # default fastcgi_params
        include fastcgi_params;

        # fastcgi settings
        fastcgi_pass            unix:/run/php-fpm7/php-fpm.sock;
        fastcgi_index           index.php;
        fastcgi_buffers         8 16k;
        fastcgi_buffer_size     32k;

        # fastcgi params
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        fastcgi_param SCRIPT_FILENAME   $realpath_root$fastcgi_script_name;
        #fastcgi_param PHP_ADMIN_VALUE  "open_basedir=$base/:/usr/lib/php/:/tmp/";
    }
}

PHP

$ vim /etc/php7/php.ini

去掉

;extension=mysqli
;extension=pdo_mysql

前面的;

systemctl enable php-fpm7
systemctl restart php-fpm7

mariadb

详见 mariadb 一节

美化

网站根目录为/usr/share/webapps/typecho所以主题目录应该放置于/usr/share/webapps/typecho/usr/themes/下。