当前位置: 首页 > news >正文

如何免费制作一个自己的网站seo网络优化专员是什么意思

如何免费制作一个自己的网站,seo网络优化专员是什么意思,大型门户网站建设需要哪些技术和注意事项,金桥路附近做网站的文章目录 说明1. 准备工作1.1 源码包下载1.2 解压安装目录1.3 安装依赖包1.4 添加用户1.5 创建数据目录 2. 编译安装2.1 源码编译2.2 配置环境变量2.3 初始化数据库2.4 启动数据库2.5 连接数据库 3. 参数调整3.1 配置 pg_hba3.2 监听相关2.4 日志文件2.5 内存参数 说明 本篇文…

文章目录

    • 说明
    • 1. 准备工作
      • 1.1 源码包下载
      • 1.2 解压安装目录
      • 1.3 安装依赖包
      • 1.4 添加用户
      • 1.5 创建数据目录
    • 2. 编译安装
      • 2.1 源码编译
      • 2.2 配置环境变量
      • 2.3 初始化数据库
      • 2.4 启动数据库
      • 2.5 连接数据库
    • 3. 参数调整
      • 3.1 配置 pg_hba
      • 3.2 监听相关
      • 2.4 日志文件
      • 2.5 内存参数

说明

本篇文章介绍 PostgreSQL 单机源码编译部署的详细步骤。

1. 准备工作

1.1 源码包下载

进入 PostgreSQL 官网下载页面 选择 Source 栏目:
在这里插入图片描述

接着就进入源码版本目录,选择需要安装的版本下载即可。

在这里插入图片描述

1.2 解压安装目录

源码包下载完成后,上传到服务器,进行解压缩:

tar -xf postgresql-14.8.tar.gz

1.3 安装依赖包

yum install gcc gcc-c++ readline-devel readline readline-dev zlib-devel

1.4 添加用户

groupadd postgres
useradd -g postgres postgres

1.5 创建数据目录

为 PostgreSQL 创建存储数据的目录:

mkdir -p /data/pgsql/{data,logs}
chown -R postgres:postgres /data/pgsql/

2. 编译安装

2.1 源码编译

cd 到源码目录下:

cd /opt/postgresql-14.8

执行 configure:

./configure --prefix=/usr/local/pgsql
参数名含义
prefix软件目录也就是安装目录
with-perl编译时添加该参数才能够使用 perl 语法的 PL/Perl 过程语言写自定义函数,需要提前安装好相关的 perl 开发包:libperl-dev
with-python编译时添加该参数才能够使用 python 语法的 PL/Perl 过程语言写自定义函数,需要提前安装好相关的 python 开发包:python-dev
with-blocksize & with-wal-blocksize默认情况下 PG 数据库的数据页大小为 8KB,若数据库用来做数仓业务,可在编译时将数据页进行调整,以提高磁盘 IO

编译安装:

make && make install

编译完成后,会在 prefix 参数指定的目录下生成 PostgreSQL 程序文件。

2.2 配置环境变量

根据自己实际环境,修改安装目录和数据目录:

vi /etc/profile
export PGHOME=/usr/local/pgsql
export PGDATA=/data/pgsql/data
export PATH=$PGHOME/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/pgsql/lib
source /etc/profile

2.3 初始化数据库

切换到 postgres 用户:

su postgres

执行数据库初始化 -D 选项后面是数据目录:

initdb -D /data/pgsql/data/
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.The database cluster will be initialized with locale "zh_CN.UTF-8".
The default database encoding has accordingly been set to "UTF8".
initdb: could not find suitable text search configuration for locale "zh_CN.UTF-8"
The default text search configuration will be set to "simple".Data page checksums are disabled.fixing permissions on existing directory /data/pgsql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Shanghai
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... okinitdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.Success. You can now start the database server using:pg_ctl -D /data/pgsql/data/ -l logfile start

2.4 启动数据库

进入 logs 目录下,创建启动日志文件,将启动时的日志输出到该文件:

touch /data/pgsql/logs/start.log

启动 PostgreSQL:

pg_ctl -D /data/pgsql/data/ -l /data/pgsql/logs/start.log start 

关闭数据库可以使用下方命令:

# 关闭数据库
pg_ctl -D /data/pgsql/data/ -l /data/pgsql/logs/start.log stop 
# 重启数据库
pg_ctl -D /data/pgsql/data/ -l /data/pgsql/logs/start.log restart

2.5 连接数据库

启动成功使用 psql 即可进入数据库:

>>>>$ psql
psql (14.8)
Type "help" for help.postgres=# select version();version                                                 
---------------------------------------------------------------------------------------------------------PostgreSQL 14.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit

3. 参数调整

3.1 配置 pg_hba

PostgreSQL 数据目录中,会自动生成 pg_hba.conf 文件,该文件是一个黑名单访问控制文件,可以控制允许哪些 IP 地址的机器访问数据库。默认,不允许远程访问数据,所以安装完成后需要配置下。

# TYPE  DATABASE        USER            ADDRESS                 METHOD# "local" is for Unix domain socket connections only
# Type 表示访问方式,local 表示本地套接字访问,DATABASE、USER 分别表示数据库和用户
# 参数 all 表示所有的数据库或用户,ADDRESS 表示一个地址或者网段,METHOD 表示验证的方式
# 默认的 trust 表示完全信任,password 表示发送明文密码,不建议使用,建议使用 md5 模式
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust

可以在 pg_hba 文件中加入下面一行,表示允许任何用户远程连接数据库,连接时需要提供密码:

host    all             all             0/0                     md5

详细可参考文档:pg_hba 文件说明

3.2 监听相关

在数据目录中的 postgresql.cnf 中,可以找到如下内容:

listen_addresses = 'localhoset'         # what IP address(es) to listen on;# comma-separated list of addresses;# defaults to 'localhost'; use '*' for all# (change requires restart)

其中,参数 listen_addresses 表示监听的 IP 地址,默认是在 localhost/127.0.0.1 处监听,这样会导致远程主机无法访问数据库,如果需要远程访问,需要将其设置为实际网络地址,设置为 * 表示监听所有地址,该参数修改重启生效。

PS:配置完 3.1 和 3.2 两个步骤,PostgreSQL 就可以支持远程连接。

下表是其它常见监听相关的参数,按需设置:

参数含义
port服务器监听TCP端口,默认 5432
max_connectionsServer 端允许最大连接数,默认 100
superuser_reserved_connectionsServer 端为超级账号保留的连接数,默认3
unix_socket_directoryServer 监听客户端 Unix 嵌套字目录,默认 /tmp

2.4 日志文件

下面是 PostgreSQL 日志相关的参数,一般都是需要配置:

参数含义
logging_collector是否打开日志
log_rotation_age超过多少天生产一个新的日志文件
log_rotation_size超过多少大小生成一个新的日志文件
log_directory日志目录,可以是绝对路径或相对 PGDATA 的相对路径
log_destination日志记录类型,默认是 stderr,只记录错误输出
log_filename日志文件名,默认是 postgresql-%Y-%m-%d_%H%M%S.log
log_truncate_on_rotation当日志名已存在时,是否覆盖原文件

以下是几个常用的配置模版,每天生成一个新的日志文件:

logging_collector = on
log_directory = '/data/pgsql/logs'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_truncate_on_rotation = off
log_rotation_age = 1d
log_rotation_size = 0

每当一个日志写满时(如 100MB)切换一个日志:

logging_collector = on
log_directory = '/data/pgsql/logs'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_truncate_on_rotation = off
log_rotation_age = 0
log_rotation_size = 100MB

只保留最近 7 天的日志,进行循环覆盖:

logging_collector = on
log_directory = '/data/pgsql/logs'
log_filename = 'error_log.log'
log_truncate_on_rotation = on
log_rotation_age = 7d
log_rotation_size = 0

2.5 内存参数

熟悉 MySQL 的同学都知道它有一个参数 innodb_buffer_pool 限制 innodb 引擎缓冲池的大小,buffer pool 越大可以缓存的页就越多,可以减少很多磁盘 IO 消耗,提升数据库的性能。shared_buffer 在 PostgreSQL 中与 MySQL 的 buffer pool 是异曲同工。

参数含义
shared_buffer共享内存缓存区大小,默认 128MB
temp_buffers每个会话使用的临时缓存区大小,默认 8MB
work_mem内存临时表排序操作或者 hash join 需要使用到的内存缓存大小,默认 4MB
maintenance_work_mem对于维护性操作(vacuum、create index)最大使用内存,默认 64M,最小 1M
max_stack_depthServer 端执行堆栈最大安全深度,默认 2M,若发现无法执行复杂函数时可适当调整该参数

文章转载自:
http://dinncokomatik.wbqt.cn
http://dinncosilvicolous.wbqt.cn
http://dinncohaunting.wbqt.cn
http://dinncomultivalence.wbqt.cn
http://dinncoimpoliteness.wbqt.cn
http://dinncophotochromy.wbqt.cn
http://dinncounciform.wbqt.cn
http://dinncounfeelingly.wbqt.cn
http://dinncobelletristic.wbqt.cn
http://dinncodammar.wbqt.cn
http://dinncointravehicular.wbqt.cn
http://dinncosubsequence.wbqt.cn
http://dinncoprepackage.wbqt.cn
http://dinncohaecceity.wbqt.cn
http://dinncothighbone.wbqt.cn
http://dinncononpositive.wbqt.cn
http://dinncounbated.wbqt.cn
http://dinncovehicle.wbqt.cn
http://dinncononobedience.wbqt.cn
http://dinncocrust.wbqt.cn
http://dinncospecilize.wbqt.cn
http://dinncoperidiole.wbqt.cn
http://dinncolagoon.wbqt.cn
http://dinncomahabharata.wbqt.cn
http://dinncobereft.wbqt.cn
http://dinncotertiary.wbqt.cn
http://dinncoindign.wbqt.cn
http://dinncoprograde.wbqt.cn
http://dinncocynegetic.wbqt.cn
http://dinncosiphonal.wbqt.cn
http://dinncoamelia.wbqt.cn
http://dinncofiltrable.wbqt.cn
http://dinncoschistous.wbqt.cn
http://dinncochondrocranium.wbqt.cn
http://dinncoyuletime.wbqt.cn
http://dinncoshakable.wbqt.cn
http://dinncocountrymen.wbqt.cn
http://dinncounlistening.wbqt.cn
http://dinncocastiron.wbqt.cn
http://dinncoeardrum.wbqt.cn
http://dinncogis.wbqt.cn
http://dinncoroister.wbqt.cn
http://dinncoanemia.wbqt.cn
http://dinncometamere.wbqt.cn
http://dinncoantiseismic.wbqt.cn
http://dinncofluoridize.wbqt.cn
http://dinncopheidippides.wbqt.cn
http://dinncominiate.wbqt.cn
http://dinncoprolegomenon.wbqt.cn
http://dinncoimmersion.wbqt.cn
http://dinncocrepuscular.wbqt.cn
http://dinncomrbm.wbqt.cn
http://dinncobarretry.wbqt.cn
http://dinncoautoist.wbqt.cn
http://dinncokumgang.wbqt.cn
http://dinncominotaur.wbqt.cn
http://dinncosalvor.wbqt.cn
http://dinncocandace.wbqt.cn
http://dinncowainage.wbqt.cn
http://dinncokananga.wbqt.cn
http://dinncobronzy.wbqt.cn
http://dinncocatatonic.wbqt.cn
http://dinncoapothecium.wbqt.cn
http://dinncovelocity.wbqt.cn
http://dinncoautocephaly.wbqt.cn
http://dinncoreconnoissance.wbqt.cn
http://dinncocricoid.wbqt.cn
http://dinncocapillary.wbqt.cn
http://dinncodiadochokinesia.wbqt.cn
http://dinncounderivative.wbqt.cn
http://dinncodumpling.wbqt.cn
http://dinncoabstruse.wbqt.cn
http://dinncoprioritize.wbqt.cn
http://dinncoseat.wbqt.cn
http://dinncomyra.wbqt.cn
http://dinncocanthus.wbqt.cn
http://dinncopetrissage.wbqt.cn
http://dinncopyrrhuloxia.wbqt.cn
http://dinncocubbyhole.wbqt.cn
http://dinncoperspire.wbqt.cn
http://dinncoexsanguine.wbqt.cn
http://dinncoreversi.wbqt.cn
http://dinncomanor.wbqt.cn
http://dinncogoalkeeper.wbqt.cn
http://dinncofraught.wbqt.cn
http://dinncoweathermost.wbqt.cn
http://dinncogynecological.wbqt.cn
http://dinncocommissary.wbqt.cn
http://dinncopersonality.wbqt.cn
http://dinncoankylosaur.wbqt.cn
http://dinncoinsecurely.wbqt.cn
http://dinncotrampoline.wbqt.cn
http://dinncopuissance.wbqt.cn
http://dinncoforestay.wbqt.cn
http://dinncorayl.wbqt.cn
http://dinncosipunculan.wbqt.cn
http://dinncohectic.wbqt.cn
http://dinncointerlingua.wbqt.cn
http://dinncowirily.wbqt.cn
http://dinncodiazole.wbqt.cn
http://www.dinnco.com/news/150890.html

相关文章:

  • 网站建设日程表是什么意思手机怎么做网站免费的
  • 做淘宝客个人网站成都网站优化排名
  • flash 做网站教程中国新闻网最新消息
  • python搭建个人网站个人免费自助建站网站
  • 迪庆网站建设网页制作平台有哪些
  • 网站开发工程师心得总结网页设计制作网站
  • 网站产品的详情页怎么做广州市口碑seo推广外包
  • wordpress七牛限制杭州关键词优化服务
  • wordpress 视频幻灯片东莞市网络seo推广服务机构
  • 网站调用新浪微博百度seo排名查询
  • 做机械产品用什么网站seo秘籍优化课程
  • 外贸简单网站建设品牌营销活动策划方案
  • 如何做网站怎么赚钱重庆网站建设技术外包
  • 武汉免费做网站客户营销
  • wordpress ico图标像素谈谈你对seo概念的理解
  • WordPress添加百度联盟哪些行业适合做seo
  • 企业怎么做网站做网站的公司云盘网页版登录
  • 现在网站怎么备案最近的国际新闻热点
  • 网站销售方案百度竞价排名危机事件
  • 银川做企业网站磁力王
  • 上海贸易公司注册seo整站优化外包公司
  • 网站打开有声音是怎么做的百度搜索资源平台token
  • 郑州做网站的公司排名seo推广怎么做视频教程
  • 成都项目网站建设推广下载
  • 阿里云国际站官网农产品网络营销策划书
  • 网站统计 中文域名搭建自己的网站
  • 做网站还能赚钱免费二级域名分发网站
  • 网站开发ppt方案模板免费的网络推广渠道
  • 北碚网站建设海淀区seo搜索引擎
  • 网站客服模版百度投诉中心