GVKun编程网logo

Linux 安装 MSSQL2017 使用 mssql-conf 配置参数

2

如果您想了解Linux安装MSSQL2017使用mssql-conf配置参数的知识,那么本篇文章将是您的不二之选。同时我们将深入剖析#cat/alidata/server/httpd-2.2.27/c

如果您想了解Linux 安装 MSSQL2017 使用 mssql-conf 配置参数的知识,那么本篇文章将是您的不二之选。同时我们将深入剖析# cat /alidata/server/httpd-2.2.27/conf/httpd.conf、./alidata/server/httpd-2.2.27/conf/httpd.conf、apache 的 /etc/httpd/conf/httpd.conf 和 /usr/local/apache2/conf/httpd.conf 区别、apache2.4 AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache2/conf/httpd.conf:53的各个方面,并给出实际的案例分析,希望能帮助到您!

本文目录一览:

Linux 安装 MSSQL2017 使用 mssql-conf 配置参数

Linux 安装 MSSQL2017 使用 mssql-conf 配置参数

Linux 上安装 SQL Server 2017

1. 下载 Microsoft SQL Server 2017 Red Hat 存储库配置文件:

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo

2. 运行以下命令以安装 SQL Server:

sudo yum install -y mssql-server

3. 包安装完成后,运行 mssql-conf setup,按照提示设置 SA 密码并选择版本。

sudo /opt/mssql/bin/mssql-conf setup

4.systemctl status mssql-server

systemctl status mssql-server

5. 防火墙上打开 SQL Server 端口。 默认的 SQL Server 端口为 TCP 1433

sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
sudo firewall-cmd --reload

 

安装方法 2 :

wget https://packages.microsoft.com/rhel/7/mssql-server-2017/mssql-server-14.0.3281.6-2.x86_64.rpm
yum install bzip2 gdb libsss_nss_idmap cyrus-sasl cyrus-sasl-gssapi
rpm -ivh mssql-server-14.0.3281.6-2.x86_64.rpm
/opt/mssql/bin/mssql-conf setup

*********************************************************************************
只有 2G 的内存,需要修改以后才能安装:

[root@localhost bin]# mv sqlservr sqlservr.old
[root@localhost bin]# python
>>> a = open("sqlservr.old", "rb").read()
>>> b = a.replace("\x80\x10\xb7\xc1", "\x00\x80\x84\x1e")
>>> open("sqlservr", "wb").write(b)

[root@localhost bin]# chmod +x sqlservr
[root@localhost bin]# /opt/mssql/bin/mssql-conf setup
*********************************************************************************

 

安装命令行工具

1. 下载 Microsoft Red Hat 存储库配置文件。

sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo

2. 如果安装了早期版本的 mssql-tools,请删除所有旧的 unixODBC 包。

sudo yum remove unixODBC-utf16 unixODBC-utf16-devel

3. 运行以下命令,以使用 unixODBC 开发人员包安装 mssql-tools。

sudo yum install -y mssql-tools unixODBC-devel  msodbcsql17

4. 向 PATH 环境变量

echo ''export PATH="$PATH:/opt/mssql-tools/bin"'' >> ~/.bash_profile
echo ''export PATH="$PATH:/opt/mssql-tools/bin"'' >> ~/.bashrc
source ~/.bashrc

5. 使用 sqlcmd 本地连接到新的 SQL Server 实例

sqlcmd -S localhost,1433 -U SA -P ''<YourPassword>''

 

安装 SQLSERVER 代理

1.2017CU4 及更高版本,启用代理方法

sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
sudo systemctl restart mssql-server

2.2017CU3 及更低版本,需安装代理

sudo yum install mssql-server-agent
sudo systemctl restart mssql-server

已安装,需要更新

sudo yum check-update
sudo yum update mssql-server-agent
sudo systemctl restart mssql-server

 

 

mssql-conf 进行参数配置

Agent 启用 SQL Server 代理
Collation 设置一个新的排序规则
Customer feedback 选择是否发送反馈给微软
Database Mail Profile 设置默认数据库邮件配置
Default data directory 修改新的数据文件的默认路径
Default log directory 修改新的日志文件的默认路径
Default master database file directory 修改 master 数据库的默认路径
Default master database file name 修改 master 数据库文件的名字
Default dump directory 修改新的内存 DUMP 和其他排错文件的默认路径
Defalut error log directory 修改新的 SQL Server 错误日志文件、默认跟踪、
系统健康会话扩展事件和 Hekaton 会话扩展事件文件
Default backup directory 修改新的备份文件的默认路径
Dump type 选择内存 DUMP 文件收集的 DUMP 类型
High availability 启用可用性组
Local Audit directory 配置一个添加本地审核文件的目录
Locale 配置 SQL Server 使用的地区(配置语言环境)
Memory limit 配置 SQL Server 内存限制
TCP port 修改 SQL Server 连接监听的端口
TLS 配置 TLS(Transport Level Security)
Traceflags 设置服务使用的跟踪标识

 

 

. 查看当前设置

cat /var/opt/mssql/mssql.conf

 

[sqlagent]

enabled = true

[EULA]
accepteula = Y

[network]
tcpport = 15559

[telemetry]
customerfeedback = false

[filelocation]
defaultdatadir = /data/mssqlserver/data

 

0. 修改需要重启服务

systemctl stop mssql-server.service

systemctl start mssql-server.service

1. 启用 SQL Server 代理(默认,SQL Server 代理是禁用的)
/opt/mssql/bin/mssql-conf set sqlagent.enabled true

2. 修改 SQL Server 排序规则(默认,对于所有版本该值设置为 true)
/opt/mssql/bin/mssql-conf set-collation

3. 配置客户反馈
/opt/mssql/bin/mssql-conf set telemetry.customerfeedback false

4. 修改默认数据和日志目录位置
mkdir /data/mssqlserver/data -p
chown mssql /data/mssqlserver/data
chgrp mssql /data/mssqlserver/data
/opt/mssql/bin/mssql-conf set filelocation.defaultdatadir /data/mssqlserver/data


5. 修改默认 master 数据库文件目录位置
mkdir /data/mssqlserver/masterdatabasedir -p
chown mssql /data/mssqlserver/masterdatabasedir
chgrp mssql /data/mssqlserver/masterdatabasedir
/opt/mssql/bin/mssql-conf set filelocation.masterdatafile /data/mssqlserver/masterdatabasedir/master.mdf
/opt/mssql/bin/mssql-conf set filelocation.masterlogfile /data/mssqlserver/masterdatabasedir/mastlog.ldf
mv /var/opt/mssql/data/master.mdf /data/mssqlserver/masterdatabasedir/master.mdf
mv /var/opt/mssql/data/mastlog.ldf /data/mssqlserver/masterdatabasedir/mastlog.ldf


6. 修改 master 数据库文件的名字
/opt/mssql/bin/mssql-conf set filelocation.masterdatafile /var/opt/mssql/data/masternew.mdf
/opt/mssql/bin/mssql-conf set filelocation.mastlogfile /var/opt/mssql/data /mastlognew.ldf
mv /var/opt/mssql/data/master.mdf /var/opt/mssql/data/masternew.mdf
mv /var/opt/mssql/data/mastlog.ldf /var/opt/mssql/data/mastlognew.ldf


7. 修改默认的 DUMP 目录位置(DUMP,当遇到故障时内存和 SQL DUMP 生成的默认位置)
mkdir /data/mssqlserver/dump -p
chown mssql /data/mssqlserver/dump
chgrp mssql /data/mssqlserver/dump
/opt/mssql/bin/mssql-conf set filelocation.defaultdumpdir /data/mssqlserver/dump


8. 修改默认错误日志目录位置
mkdir /data/mssqlserver/logs -p
chown mssql /data/mssqlserver/logs
chgrp mssql /data/mssqlserver/logs
/opt/mssql/bin/mssql-conf set filelocation.errorlogfile /data/mssqlserver/logs/errorlog


9. 修改默认备份目录位置
mkdir /data/mssqlserver/backup -p
chown mssql /data/mssqlserver/backup
chgrp mssql /data/mssqlserver/backup
/opt/mssql/bin/mssql-conf set filelocation.defaultbackupdir /data/mssqlserver/backup

10. 指定核心 DUMP 设置(默认值为 false)
/opt/mssql/bin/mssql-conf set coredump.captureminiandfull <true or false>
/opt/mssql/bin/mssql-conf set coredump.coredumptype <dump_type>

coredump.coredumptype 的值:mini、miniplus、filtered、full

mini:
Mini 是最小的 DUMP 文件类型。它使用 Linux 系统信息决定进程里的线程和模块。DUMP 只包含主机环境线程栈和模块。它不包含间接内存参照或全局变量。

miniplus:
Miniplus 类似于 mini,但是它包含其他内存。它理解 SQLPAL 和主机环境的内幕,添加内存区域到 DUMP:
-- 各种全局变量
--64TB 以上内存
-- 在 /proc/$pid/maps 发现的所有命名区域
-- 从线程到栈的间接内存
-- 线程信息
-- 相关的 Teb’s 和 Peb’s
-- 模块信息
--VMM 和 VAD 数

filtered:
Filtered 使用基于减法的设计进程中的所有内存位置都包含,除非专门排除。该设计理解 SQLPAL 的内幕和主机环境,从 DUMP 排除特定区域。

full:
Full 是一个位于 /proc/$pid/maps 的完整进程 DUMP 包含所有区域。它不受 coredump.captureminiandfull 设置的控制。


11. 设置默认数据库邮件配置
sudo /opt/mssq/bin/mssql-conf set sqlagent.databasemailprofile <profile_name>


12. 高可用性
/opt/mssql/bin/mssql-conf set hadr.hadrenabled 1


13. 设置本地审核目录
mkdir /data/mssqlserver/audit -p
chown mssql /data/mssqlserver/audit
chgrp mssql /data/mssqlserver/audit
/opt/mssql/bin/mssql-conf set telemetry.userrequestedlocalauditdirectory /data/mssqlserver/audit


14. 修改 SQL Server 本地化
/opt/mssql/bin/mssql-conf set language.lcid 1036


15. 设置内存限制(默认是物理内存的 80%)
/opt/mssql/bin/mssql-conf set memory.memorylimitmb 3328

 

16. 修改 TCP 端口
/opt/mssql/bin/mssql-conf set network.tcpport <new_tcp_port>


17. 指定 TLS 设置
Network.forceencryption:
如果为 1,SQL Server 强制加密所有连接。默认,该选项为 0.

Network.tlscert:
SQL Server 用于 TLS 的证书的完整路径。例如:/etc/ssl/certs/mssql.pem。证书必需通过 mssql 帐户访问。微软推荐使用 chown mssql:mssql <file>; chmod 400 <file > 限制访问文件。

Network.tlskey:
SQL Server 用于 TLS 的私钥文件的完整路径。例如:/etc/ssl/private/mssql.key。证书必需通过 mssql 帐户访问。微软推荐使用 chown mssql:mssql <file>; chmod 400 <file > 限制访问文件。

Network.tlsprotocols:
SQL Server 运行使用的以逗号分隔的 TLS 协议列表。SQL Server 总是尝试协商最强允许的协议。如果客户端不支持任何允许的协议,SQL Server 拒绝连接尝试。为了兼容性,默认允许所有支持的协议(1.2,1.1,1.0)。如果客户端支持 TLS 1.2,微软推荐只允许 TLS 1.2。

Network.tlsciphers:
指定对于 TLS,SQL Server 允许的密码。该字符串必需以 OpenSSL 的密码列表格式格式化。通常,你不需要修改该选项。
默认,允许以下密码:
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA

Network.kerberoskeytabfile:
Kerberos keytab 文件路径


18. 启用 / 禁用跟踪标志(单或者多个禁止或启用)
/opt/mssql/bin/mssql-conf traceflag 1234 on
/opt/mssql/bin/mssql-conf traceflag 2345 3456 on
/opt/mssql/bin/mssql-conf traceflag 1234 2345 3456 off


19. 移除一个设置
/opt/mssql/bin/mssql-conf unset network.tcpport

# cat /alidata/server/httpd-2.2.27/conf/httpd.conf

# cat /alidata/server/httpd-2.2.27/conf/httpd.conf

[root@AY140716161543837722Z ~]# cat /alidata/server/httpd-2.2.27/conf/httpd.conf

#

# This is the main Apache HTTP server configuration file.  It contains the

# configuration directives that give the server its instructions.

# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.

# In particular, see

# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>

# for a discussion of each configuration directive.

#

# Do NOT simply read the instructions in here without understanding

# what they do.  They''re here only as hints or reminders.  If you are unsure

# consult the online docs. You have been warned.

#

# Configuration and logfile names: If the filenames you specify for many

# of the server''s control files begin with "/" (or "drive:/" for Win32), the

# server will use that explicit path.  If the filenames do *not* begin

# with "/", the value of ServerRoot is prepended -- so ''log/access_log''

# with ServerRoot set to ''/www'' will be interpreted by the

# server as ''/www/log/access_log'', where as ''/log/access_log'' will be

# interpreted as ''/log/access_log''.


#

# ServerRoot: The top of the directory tree under which the server''s

# configuration, error, and log files are kept.

#

# Do not add a slash at the end of the directory path.  If you point

# ServerRoot at a non-local disk, be sure to point the LockFile directive

# at a local disk.  If you wish to share the same ServerRoot for multiple

# httpd daemons, you will need to change at least LockFile and PidFile.

#

ServerRoot "/alidata/server/httpd"


#

# Listen: Allows you to bind Apache to specific IP addresses and/or

# ports, instead of the default. See also the <VirtualHost>

# directive.

#

# Change this to Listen on specific IP addresses as shown below to

# prevent Apache from glomming onto all bound IP addresses.

#

#Listen 12.34.56.78:80

Listen 80


#

# Dynamic Shared Object (DSO) Support

#

# To be able to use the functionality of a module which was built as a DSO you

# have to place corresponding `LoadModule'' lines at this location so the

# directives contained in it are actually available _before_ they are used.

# Statically compiled modules (those listed by `httpd -l'') do not need

# to be loaded here.

#

# Example:

# LoadModule foo_module modules/mod_foo.so

#

LoadModule authn_file_module modules/mod_authn_file.so

LoadModule authn_dbm_module modules/mod_authn_dbm.so

LoadModule authn_anon_module modules/mod_authn_anon.so

LoadModule authn_dbd_module modules/mod_authn_dbd.so

LoadModule authn_default_module modules/mod_authn_default.so

LoadModule authz_host_module modules/mod_authz_host.so

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so

LoadModule authz_user_module modules/mod_authz_user.so

LoadModule authz_dbm_module modules/mod_authz_dbm.so

LoadModule authz_owner_module modules/mod_authz_owner.so

LoadModule authz_default_module modules/mod_authz_default.so

LoadModule auth_basic_module modules/mod_auth_basic.so

LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule file_cache_module modules/mod_file_cache.so

LoadModule cache_module modules/mod_cache.so

LoadModule disk_cache_module modules/mod_disk_cache.so

LoadModule mem_cache_module modules/mod_mem_cache.so

LoadModule dbd_module modules/mod_dbd.so

LoadModule dumpio_module modules/mod_dumpio.so

LoadModule reqtimeout_module modules/mod_reqtimeout.so

LoadModule ext_filter_module modules/mod_ext_filter.so

LoadModule include_module modules/mod_include.so

LoadModule filter_module modules/mod_filter.so

LoadModule substitute_module modules/mod_substitute.so

LoadModule deflate_module modules/mod_deflate.so

LoadModule log_config_module modules/mod_log_config.so

LoadModule log_forensic_module modules/mod_log_forensic.so

LoadModule logio_module modules/mod_logio.so

LoadModule env_module modules/mod_env.so

LoadModule mime_magic_module modules/mod_mime_magic.so

LoadModule cern_meta_module modules/mod_cern_meta.so

LoadModule expires_module modules/mod_expires.so

LoadModule headers_module modules/mod_headers.so

LoadModule ident_module modules/mod_ident.so

LoadModule usertrack_module modules/mod_usertrack.so

LoadModule unique_id_module modules/mod_unique_id.so

LoadModule setenvif_module modules/mod_setenvif.so

LoadModule version_module modules/mod_version.so

LoadModule ssl_module modules/mod_ssl.so

LoadModule mime_module modules/mod_mime.so

LoadModule status_module modules/mod_status.so

LoadModule autoindex_module modules/mod_autoindex.so

LoadModule asis_module modules/mod_asis.so

LoadModule info_module modules/mod_info.so

LoadModule cgi_module modules/mod_cgi.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

LoadModule negotiation_module modules/mod_negotiation.so

LoadModule dir_module modules/mod_dir.so

LoadModule imagemap_module modules/mod_imagemap.so

LoadModule actions_module modules/mod_actions.so

LoadModule speling_module modules/mod_speling.so

LoadModule userdir_module modules/mod_userdir.so

LoadModule alias_module modules/mod_alias.so

LoadModule rewrite_module modules/mod_rewrite.so

LoadModule php5_module        modules/libphp5.so


<IfModule !mpm_netware_module>

<IfModule !mpm_winnt_module>

#

# If you wish httpd to run as a different user or group, you must run

# httpd as root initially and it will switch.

#

# User/Group: The name (or #number) of the user/group to run httpd as.

# It is usually good practice to create a dedicated user and group for

# running httpd, as with most system services.

#

User www

Group www


</IfModule>

</IfModule>


# ''Main'' server configuration

#

# The directives in this section set up the values used by the ''main''

# server, which responds to any requests that aren''t handled by a

# <VirtualHost> definition.  These values also provide defaults for

# any <VirtualHost> containers you may define later in the file.

#

# All of these directives may appear inside <VirtualHost> containers,

# in which case these default settings will be overridden for the

# virtual host being defined.

#


#

# ServerAdmin: Your address, where problems with the server should be

# e-mailed.  This address appears on some server-generated pages, such

# as error documents.  e.g. admin@your-domain.com

#

ServerAdmin you@example.com


#

# ServerName gives the name and port that the server uses to identify itself.

# This can often be determined automatically, but we recommend you specify

# it explicitly to prevent problems during startup.

#

# If your host doesn''t have a registered DNS name, enter its IP address here.

#

ServerName www.example.com:80


#

# DocumentRoot: The directory out of which you will serve your

# documents. By default, all requests are taken from this directory, but

# symbolic links and aliases may be used to point to other locations.

#

DocumentRoot "/"


#

# Each directory to which Apache has access can be configured with respect

# to which services and features are allowed and/or disabled in that

# directory (and its subdirectories).

#

# First, we configure the "default" to be a very restrictive set of

# features.

#


#

# Note that from this point forward you must specifically allow

# particular features to be enabled - so if something''s not working as

# you might expect, make sure that you have specifically enabled it

# below.

#


#

# This should be changed to whatever you set DocumentRoot to.

#

<Directory "/">

    #

    # Possible values for the Options directive are "None", "All",

    # or any combination of:

    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

    #

    # Note that "MultiViews" must be named *explicitly* --- "Options All"

    # doesn''t give it to you.

    #

    # The Options directive is both complicated and important.  Please see

    # http://httpd.apache.org/docs/2.2/mod/core.html#options

    # for more information.

    #

    Options FollowSymLinks


    #

    # AllowOverride controls what directives may be placed in .htaccess files.

    # It can be "All", "None", or any combination of the keywords:

    #   Options FileInfo AuthConfig Limit

    #

    AllowOverride All


    #

    # Controls who can get stuff from this server.

    #

    Order allow,deny

    Allow from all


</Directory>


#

# DirectoryIndex: sets the file that Apache will serve if a directory

# is requested.

#

<IfModule dir_module>

    DirectoryIndex index.html index.htm index.php

</IfModule>


#

# The following lines prevent .htaccess and .htpasswd files from being

# viewed by Web clients.

#

<FilesMatch "^\.ht">

    Order allow,deny

    Deny from all

    Satisfy All

</FilesMatch>


#

# ErrorLog: The location of the error log file.

# If you do not specify an ErrorLog directive within a <VirtualHost>

# container, error messages relating to that virtual host will be

# logged here.  If you *do* define an error logfile for a <VirtualHost>

# container, that host''s errors will be logged there and not here.

#

ErrorLog "logs/error_log"


#

# LogLevel: Control the number of messages logged to the error_log.

# Possible values include: debug, info, notice, warn, error, crit,

# alert, emerg.

#

LogLevel warn


<IfModule log_config_module>

    #

    # The following directives define some format nicknames for use with

    # a CustomLog directive (see below).

    #

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

    LogFormat "%h %l %u %t \"%r\" %>s %b" common


    <IfModule logio_module>

      # You need to enable mod_logio.c to use %I and %O

      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    </IfModule>


    #

    # The location and format of the access logfile (Common Logfile Format).

    # If you do not define any access logfiles within a <VirtualHost>

    # container, they will be logged here.  Contrariwise, if you *do*

    # define per-<VirtualHost> access logfiles, transactions will be

    # logged therein and *not* in this file.

    #

    CustomLog "logs/access_log" common


    #

    # If you prefer a logfile with access, agent, and referer information

    # (Combined Logfile Format) you can use the following directive.

    #

    #CustomLog "logs/access_log" combined

</IfModule>


<IfModule alias_module>

    #

    # Redirect: Allows you to tell clients about documents that used to

    # exist in your server''s namespace, but do not anymore. The client

    # will make a new request for the document at its new location.

    # Example:

    # Redirect permanent /foo http://www.example.com/bar


    #

    # Alias: Maps web paths into filesystem paths and is used to

    # access content that does not live under the DocumentRoot.

    # Example:

    # Alias /webpath /full/filesystem/path

    #

    # If you include a trailing / on /webpath then the server will

    # require it to be present in the URL.  You will also likely

    # need to provide a <Directory> section to allow access to

    # the filesystem path.


    #

    # ScriptAlias: This controls which directories contain server scripts.

    # ScriptAliases are essentially the same as Aliases, except that

    # documents in the target directory are treated as applications and

    # run by the server when requested rather than as documents sent to the

    # client.  The same rules about trailing "/" apply to ScriptAlias

    # directives as to Alias.

    #

    ScriptAlias /cgi-bin/ "/alidata/server/httpd/cgi-bin/"


</IfModule>


<IfModule cgid_module>

    #

    # ScriptSock: On threaded servers, designate the path to the UNIX

    # socket used to communicate with the CGI daemon of mod_cgid.

    #

    #Scriptsock logs/cgisock

</IfModule>


#

# "/alidata/server/httpd/cgi-bin" should be changed to whatever your ScriptAliased

# CGI directory exists, if you have that configured.

#

<Directory "/alidata/server/httpd/cgi-bin">

    AllowOverride None

    Options None

    Order allow,deny

    Allow from all

</Directory>


#

# DefaultType: the default MIME type the server will use for a document

# if it cannot otherwise determine one, such as from filename extensions.

# If your server contains mostly text or HTML documents, "text/plain" is

# a good value.  If most of your content is binary, such as applications

# or images, you may want to use "application/octet-stream" instead to

# keep browsers from trying to display binary files as though they are

# text.

#

DefaultType text/plain


<IfModule mime_module>

    #

    # TypesConfig points to the file containing the list of mappings from

    # filename extension to MIME-type.

    #

    TypesConfig conf/mime.types


    #

    # AddType allows you to add to or override the MIME configuration

    # file specified in TypesConfig for specific file types.

    #

    #AddType application/x-gzip .tgz

    #

    # AddEncoding allows you to have certain browsers uncompress

    # information on the fly. Note: Not all browsers support this.

    #

    #AddEncoding x-compress .Z

    #AddEncoding x-gzip .gz .tgz

    #

    # If the AddEncoding directives above are commented-out, then you

    # probably should define those extensions to indicate media types:

    #

    AddType application/x-compress .Z

    AddType application/x-gzip .gz .tgz


    #

    # AddHandler allows you to map certain file extensions to "handlers":

    # actions unrelated to filetype. These can be either built into the server

    # or added with the Action directive (see below)

    #

    # To use CGI scripts outside of ScriptAliased directories:

    # (You will also need to add "ExecCGI" to the "Options" directive.)

    #

    #AddHandler cgi-script .cgi


    # For type maps (negotiated resources):

    #AddHandler type-map var


    #

    # Filters allow you to process content before it is sent to the client.

    #

    # To parse .shtml files for server-side includes (SSI):

    # (You will also need to add "Includes" to the "Options" directive.)

    #

    #AddType text/html .shtml

    #AddOutputFilter INCLUDES .shtml

</IfModule>


#

# The mod_mime_magic module allows the server to use various hints from the

# contents of the file itself to determine its type.  The MIMEMagicFile

# directive tells the module where the hint definitions are located.

#

#MIMEMagicFile conf/magic


#

# Customizable error responses come in three flavors:

# 1) plain text 2) local redirects 3) external redirects

#

# Some examples:

#ErrorDocument 500 "The server made a boo boo."

#ErrorDocument 404 /missing.html

#ErrorDocument 404 "/cgi-bin/missing_handler.pl"

#ErrorDocument 402 http://www.example.com/subscription_info.html

#


#

# MaxRanges: Maximum number of Ranges in a request before

# returning the entire resource, or one of the special

# values ''default'', ''none'' or ''unlimited''.

# Default setting is to accept 200 Ranges.

#MaxRanges unlimited


#

# EnableMMAP and EnableSendfile: On systems that support it,

# memory-mapping or the sendfile syscall is used to deliver

# files.  This usually improves server performance, but must

# be turned off when serving from networked-mounted

# filesystems or if support for these functions is otherwise

# broken on your system.

#

#EnableMMAP off

#EnableSendfile off


# Supplemental configuration

#

# The configuration files in the conf/extra/ directory can be

# included to add extra features or to modify the default configuration of

# the server, or you may simply copy their contents here and change as

# necessary.


# Server-pool management (MPM specific)

Include conf/extra/httpd-mpm.conf


# Multi-language error messages

#Include conf/extra/httpd-multilang-errordoc.conf


# Fancy directory listings

#Include conf/extra/httpd-autoindex.conf


# Language settings

#Include conf/extra/httpd-languages.conf


# User home directories

#Include conf/extra/httpd-userdir.conf


# Real-time info on requests and configuration

#Include conf/extra/httpd-info.conf


# Virtual hosts

Include conf/extra/httpd-vhosts.conf


# Local access to the Apache HTTP Server Manual

#Include conf/extra/httpd-manual.conf


# Distributed authoring and versioning (WebDAV)

#Include conf/extra/httpd-dav.conf


# Various default settings

#Include conf/extra/httpd-default.conf


# Secure (SSL/TLS) connections

#Include conf/extra/httpd-ssl.conf

#

# Note: The following must must be present to support

#       starting without SSL on platforms with no /dev/random equivalent

#       but a statically compiled-in mod_ssl.

#

<IfModule ssl_module>

SSLRandomSeed startup builtin

SSLRandomSeed connect builtin

</IfModule>

HostnameLookups off

AddType application/x-httpd-php .php


./alidata/server/httpd-2.2.27/conf/httpd.conf

./alidata/server/httpd-2.2.27/conf/httpd.conf

[root@AY140716161543837722Z ~]# cd /
[root@AY140716161543837722Z /]# ls
alidata  boot  etc   lib    lost+found  mnt  proc  sbin     srv  tmp  var
bin      dev   home  lib64  media       opt  root  selinux  sys  usr
[root@AY140716161543837722Z /]# find . -name httpd.conf
./var/ftp/wordpressData/alt/httpd.conf
./var/ftp/wordpressData/httpd.conf
./root/sh-1.3.0-centos/httpd-2.2.27/docs/conf/httpd.conf
./alidata/server/httpd-2.2.27/conf/original/httpd.conf
./alidata/server/httpd-2.2.27/conf/httpd.conf


apache 的 /etc/httpd/conf/httpd.conf 和 /usr/local/apache2/conf/httpd.conf 区别

apache 的 /etc/httpd/conf/httpd.conf 和 /usr/local/apache2/conf/httpd.conf 区别

一、问题

centos 系统用 yum 安装完 apache 后,重启后有时会失效,然后去网上找资料,发现有的说重启命令是这样的:

/etc/init.d/httpd restart

而有的呢,说重启命令应该是这样的:

service httpd restart

这两行命令写法不同,但其实是同一个东西,都是重启 httpd 服务。

但很多时候发现改了配置文件后,重启并不生效,然后网上的资料有的让改 /etc/httpd/conf/httpd.conf 这个文件,有的让改 /usr/local/apache2/conf/httpd.conf 文件。那这两个文件到底哪一个对呢?这两个文件有什么区别呢?

二、区别

这两个文件都是 apache 的配置文件,只是一个是系统自带的(/etc/httpd/conf/httpd.conf),一个是 yum 安装产生的(/usr/local/apache2/conf/httpd.conf)。

三、解决办法

上面的命令不起作用的原因,往往是因为 /etc/init.d/httpd 中用的是系统自带的 apache,但我们改的是 yum 安装的 apache 的配置文件。既然知道原因了,解决就简单了,有两种办法:

1、把 /etc/init.d/httpd 中的 apache 改为我们要使用的那个

2、在要使用的 apache 的安装目录下启动 apache,如在 /usr/local/apache2/bin 下执行命令:

$ sudo apachectl restart

apache2.4 AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache2/conf/httpd.conf:53

apache2.4 AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache2/conf/httpd.conf:53

AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache2/conf/httpd.conf:53

这是什么原因?我在httpd.conf里配了个NameVirtualHost 192.168.1.84:80 就会报错

今天的关于Linux 安装 MSSQL2017 使用 mssql-conf 配置参数的分享已经结束,谢谢您的关注,如果想了解更多关于# cat /alidata/server/httpd-2.2.27/conf/httpd.conf、./alidata/server/httpd-2.2.27/conf/httpd.conf、apache 的 /etc/httpd/conf/httpd.conf 和 /usr/local/apache2/conf/httpd.conf 区别、apache2.4 AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache2/conf/httpd.conf:53的相关知识,请在本站进行查询。

本文标签: