typecho 下载
插件列表
http://docs.typecho.org/plugins/download
nginx 安装
yum -y install nginx
systemctl start nginx
systemctl enable nginx
下载 php
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum --enablerepo=remi-php74 install -y php-fpm php-mcrypt php-curl php-cli php-mysql php-gd php-xsl php-json php-intl php-pear php-devel php-common php-mbstring php-tidy php-zip php-soap curl
##设置php
vim /etc/php.ini
cgi.fix_pathinfo=1
#更改php-fpm配置文件
vim /etc/php-fpm.d/www.conf //编辑配置文件
---
user = nginx
group = nginx
listen = /var/run/php-fpm/php-fpm.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
---
启动php-fpm
systemctl start php-fpm
systemctl enable php-fpm
安装mysql
vim /etc/yum.repos.d/mariadb.repo //新建repo
[mariadb]
name = MariaDB
baseurl = http://mirrors.aliyun.com/mariadb/yum/10.4/centos/7.6/x86_64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
enabled=1
gpgcheck=1
yum -y install MariaDB-server MariaDB-client
systemctl start mariadb
systemctl enable mariadb
初始化数据库
mysql_secure_installation //初始化mysql,设置好root密码
mysql -u root -p **** //登陆mysql
mysql > create database typechodb; //新建数据库
mysql > create user 'typechodb'@'localhost' identified by 'Huayun@123'; //新建用户
mysql > grant all privileges on typechodb.* to typechodb@localhost identified by 'Huayun@123'; //赋予新建用户权限
mysql > flush privileges; //刷新权限
mysql > exit; //退出mysql视图
配置nginx 中typecho.conf
vim /etc/nginx/conf.d/typecho.conf
server {
listen 80;
server_name 10.100.214.212;
root /opt/typecho;
access_log /var/log/nginx/typecho_access.log;
error_log /var/log/nginx/typecho_error.log;
client_max_body_size 1G;
fastcgi_buffers 64 4K;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README) {
deny all;
}
location ~ \.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
}
location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
access_log off;
}
}
备注
1.安装过程中
会提示usr/uploads/ 无权限 ,这个目录的绝对路径在 /opt/typecho/usr/uploads
2.mysql数据库填写完信息后会把信息放在根目录下
[root@localhost uploads]# cat /opt/typecho/config.inc.php
<?php
// site root path
define('__TYPECHO_ROOT_DIR__', dirname(__FILE__));
// plugin directory (relative path)
define('__TYPECHO_PLUGIN_DIR__', '/usr/plugins');
// theme directory (relative path)
define('__TYPECHO_THEME_DIR__', '/usr/themes');
// admin directory (relative path)
define('__TYPECHO_ADMIN_DIR__', '/admin/');
// register autoload
require_once __TYPECHO_ROOT_DIR__ . '/var/Typecho/Common.php';
// init
\Typecho\Common::init();
// config db
$db = new \Typecho\Db('Pdo_Mysql', 'typecho_');
$db->addServer(array (
'host' => 'localhost',
'port' => 3306,
'user' => 'typechodb',
'password' => 'Huayun@123',
'charset' => 'utf8mb4',
'database' => 'typechodb',
'engine' => 'InnoDB',
), \Typecho\Db::READ | \Typecho\Db::WRITE);
\Typecho\Db::set($db);
安装 插件
- 插件列表
http://docs.typecho.org/plugins/download
Markdown左右编辑 :docs.typecho.org/_media/plugins/lreditor0.0.4.zip
这个主题目前测试还是比较满意