[主]文件使用实例 [1]

nginx实例:

Short names:  nginx
Filenames:  nginx.conf
MIME types: text/x-nginx-conf
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
user www-data www-data;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    access_log	/var/nginx/log/access.log;
}

squid配置文件(redis):

Short names:  squidconf, squid.conf, squid
Filenames:  squid.conf
MIME types: text/x-squidconf
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 注释说明
daemonize no

pidfile /var/run/redis.pid

port 6379

# bind 127.0.0.1

# include /path/to/other.conf

various domain-specific languages

thrift:

Short names:  thrift
Filenames:  *.thrift
MIME types: application/x-thrift

protobuf:

Short names:  protobuf, proto
Filenames:  *.proto
MIME types: None

简单的

语言

Erlang实例:

Short names:  erlang
Filenames:  *.erl, *.hrl, *.es, *.escript
MIME types: text/x-erlang

Short names:  erl
Filenames:  *.erl-sh
MIME types: text/x-erl-shellsession
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
%% @author author <author@example.com>
%% @copyright YYYY author.

%% @doc calllist analysis startup code

-module(ca).
-author('author <author@example.com>').
-export([start/0]).

start(App) ->
    case application:start(App) of
        ok ->
            ok;
        {error, {already_started, App}} ->
            ok
    end.

php实例:

 Short names: php, php3, php4, php5
Filenames:  *.php, *.php[345], *.inc
MIME types: text/x-php
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php
/*
 * 注释说明
 */
if (defined('ENVIRONMENT'))
{
	switch (ENVIRONMENT)
	{
		case 'development':
			break;
		default:
			exit('The application environment is not set correctly.');
	}
}

mysql实例:

Short names:  mysql
Filenames:  None
MIME types: text/x-mysql
1
2
3
4
5
6
7
8
9
[client]
port		= 3306
socket		= /tmp/mysql.sock
#socket      = /var/run/mysqld/mysqld.sock

[mysqld]
user        = mysql
port		= 3306
socket		= /tmp/mysql.sock

其他

配置文件configuration file formats

docker:

Short names:  docker, dockerfile
Filenames:  Dockerfile, *.docker
MIME types: text/x-dockerfile-config
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[Service]
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// $OPTIONS \
          $DOCKER_STORAGE_OPTIONS \
          $DOCKER_NETWORK_OPTIONS \
          $BLOCK_REGISTRY \
          $INSECURE_REGISTRY

ini:

Short names:  ini, cfg, dosini
Filenames:  *.ini, *.cfg, *.inf
MIME types: text/x-ini, text/inf

properties(java):

Short names:  properties, jproperties
Filenames:  *.properties
MIME types: text/x-java-properties
1
2
3
4
5
6
7
8
# the directory where the snapshot is stored.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=0
initLimit=10
syncLimit=5

apache配置文件:

Short names:  apacheconf, aconf, apache
Filenames:  .htaccess, apache.conf, apache2.conf
MIME types: text/x-apacheconf
<VirtualHost *:80>
        ServerName a.com
        ServerAdmin webmaster@localhost
        DocumentRoot /home/data/www/a
        ErrorLog /home/data/log/a_error.log
        CustomLog /home/data/log/a_access.log combined
</Virtualhost>
<VirtualHost *:80>
        ServerName b.com
    ServerAdmin webmaster@localhost
        DocumentRoot /home/data/www/b
        ErrorLog /home/data/log/b_error.log
        CustomLog /home/data/log/b_access.log combined
</Virtualhost>

CSS相关

css:

Short names:  css
Filenames:  *.css
MIME types: text/css

less:

Short names:  less
Filenames:  *.less
MIME types: text/x-less-css

数据文件格式:

Short names:  json
Filenames:  *.json
MIME types: application/json
[1]http://pygments.org/docs/lexers/#lexers-for-php-and-related-languages