apache_conf 罗盘配置样板

罗盘配置样板

Config.rb

# Note that while this file is in our config folder, it is
# symlinked to our site folders, so paths are relative from there
# Require gems and Compass plugins

# General
output_style = :compressed
relative_assets = true
project_path = File.dirname(__FILE__) + '/'
# add_import_path project_path + '../all/public/assets/styles/src/'
# lib_dir = project_path + '../../system/lib/'

# Sass Paths
http_path = '/'
http_stylesheets_path = http_path + 'styles'
http_images_path = http_path + 'images'

# Sass Directories
css_dir = 'css'
sass_dir = 'scss'
images_dir = '../images'
fonts_dir = 'scss/frameworks/fontawesome/fonts'

# Quantize 8-bit sprites
# on_sprite_saved do |file|
#   unless is_32bit?(file)
#     quantize(file, lib_dir + 'pngquant/pngquant-mac')
#   end
#   optimize(file, 'ImageOptim')
# end

# Enable Debugging (Line Comments, FireSass)
# Invoke from command line: compass watch -e development --force
if environment == :development
  line_comments = true
  sass_options = { :debug_info => true }
end

# Methods
# def is_32bit?(file)
#   File.basename(file).match(/^png(24|32)/)
# end

# def quantize(file, binary)
#   png8_file = file.sub(/\.png/, '-fs8.png')
#   system binary + ' ' + file
#   sleep 2
#   system 'mv -f ' + png8_file + ' ' + file
#   growl('Sprite: ' + File.basename(file) + ' quantized')
# end

# def optimize(file, image_app)
#   system 'open -a ' + image_app + '.app ' + file
#   growl('Sprite: ' + File.basename(file) + ' optimized')
# end

# def growl(msg)
#   GNTP.notify({
#     :title    => "Compass",
#     :text     => msg,
#     :icon     => "file://#{CompassGrowl::ICON}"
#   })
# end

apache_conf 默认WordPress .htaccess文件。

默认WordPress .htaccess文件。

.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

apache_conf Cambiar el Huso horario是UTC的

Cambiar el Huso horario是UTC的

.htaccess
php_value date.timezone UTC

apache_conf 在.htaccess文件中将时区设置为PHP的协调世界时(UTC)。

在.htaccess文件中将时区设置为PHP的协调世界时(UTC)。

.htaccess
php_value date.timezone UTC

apache_conf 使用ApacheConnector为Jersey 2.x客户端配置代理

Configure Proxy For Jersey 2.x Client with ApacheConnector
        final ClientConfig clientConfig = new ClientConfig ();
        clientConfig.register (JettisonFeature.class).register (GZipEncoder.class);
        clientConfig.property (ClientProperties.CONNECT_TIMEOUT, CONNECTION_TIMEOUT).property (
                ClientProperties.READ_TIMEOUT, RESPONSE_TIMEOUT);
        
        clientConfig.property (ApacheClientProperties.CONNECTION_MANAGER, "org.apache.http.impl.conn.PoolingClientConnectionManager");
        clientConfig.property (ApacheClientProperties.PROXY_URI, "http://proxy:port");
        
        Connector apacheConnector = new ApacheConnector(clientConfig);
        clientConfig.connector (apacheConnector)

        client = ClientBuilder.newClient (clientConfig);

apache_conf htaccess:assets(将css和js添加到项目中)

htaccess:assets(将css和js添加到项目中)

.htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

apache_conf htaccess的:gzip的

htaccess的:gzip的

Gzip.htaccess
# BEGIN GZIP
# mod_gzip compression (legacy, Apache 1.3)
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|xml|txt|css|js)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
# END GZIP

# DEFLATE compression
<IfModule mod_deflate.c>
# Set compression for: html,txt,xml,js,css
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
# Deactivate compression for buggy browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Set header information for proxies
Header append Vary User-Agent
</IfModule>
# END DEFLATE

apache_conf АутентификацияHTTPспомощьюмодуляApache

АутентификацияHTTPспомощьюмодуляApache

.htaccess
<IfModule mod_auth_basic.c>
  AuthType Basic
	AuthName "Access"
	AuthUserFile "/path/to//htpasswd"
	Require valid-user
</IfModule>

# Generation DES password http://www.insidepro.com/hashes.php?lang=rus

apache_conf 含糊不清的定义

含糊不清的定义

confusion
"The point here is that a lot of terms are thrown around in this industry, and not everyone
uses them properly. Additionally, as in this case, the definitions may be nebulous; this,
of course, leads to confusion." - Network Warrior page 2

apache_conf htaccess缓存

htaccess缓存

htaccess cache
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:

SetOutputFilter DEFLATE

ExpiresActive on


ExpiresByType application/javascript "modification plus 614800 seconds"
ExpiresByType text/css "modification plus 614800 seconds"
ExpiresByType image/jpeg "modification plus 614800 seconds"
ExpiresByType image/gif "modification plus 614800 seconds"
ExpiresByType image/x-ico "modification plus 614800 seconds"
ExpiresByType image/png "modification plus 614800 seconds"