JDK 下載好後使用 rpm -ivh jdk-7u25-linux-x64.rpm 進行安裝。 安裝好後編輯 /etc/profile 文件,在末尾加上: 1 2 3 export JAVA_HOME="/usr/java/jdk1.7.0_25" export CLASSPATH=.:$JAVA ...
JDK
下載好後使用 rpm -ivh jdk-7u25-linux-x64.rpm 進行安裝。
安裝好後編輯 /etc/profile 文件,在末尾加上:
1 2 3 |
export JAVA_HOME="/usr/java/jdk1.7.0_25" export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin |
然後保存退出,接著使用以下命令讓環境變數生效:
Shell
1 |
source /etc/profile |
最後執行 javac 命令以檢查是否正確配置。
centos7下tomcat7 或tomcat8啟動超慢原因
1,找到你的jdk安裝的位置
[html] view plain copy
- ${JAVA_HOME}/jre/lib/security/java.security
2,vi 打開後找到
[html] view plain copy
- securerandom.source=file:/dev/urandom
修改
[html] view plain copy
- securerandom.source=file:/dev/./urandom
3,重新啟動tomcat就好了
Reference-link:
http://www.cnblogs.com/suiyueqiannian/p/6060951.html?utm_source=itdadao&utm_medium=referral
Tomcat
下載好安裝包,解壓到/home/apache-tomcat-7.0.67下
(解壓
tar –xvf file.tar //解壓 tar包
tar -xzvf file.tar.gz //解壓tar.gz
tar -xjvf file.tar.bz2 //解壓 tar.bz2
tar –xZvf file.tar.Z //解壓tar.Z
unrar e file.rar //解壓rar
unzip file.zip //解壓zip
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# 進入Tomcat安裝目錄下的bin目錄 cd /home/apache-tomcat-7.0.67/bin
# 解壓commons-daemon-native.tar.gz tar zxvf commons-daemon-native.tar.gz
cd commons-daemon-1.0.15-native-src/unix
# 這裡需要gcc、make等編譯工具,如果沒有指定JAVA_HOME環境變數,則需要 --with-java= 參數指定jdk目錄 ./configure
Eg ./configure --with-java=/usr/java/jdk1.8.0_141
# 上一步成功後,make make
# make後,會在當前文件夾下生成一個名為 js<a class="keylink" href="http://www.2cto.com/kf/ware/vc/" target="_blank">vc</a> 的文件,將其複製到$CATALINA_HOME/bin目錄 cp jsvc ../../
# 添加一個用來運行Tomcat的用戶 useradd tomcat -M -d / -s /usr/sbin/nologin
# 回到$CATALINA_HOME/bin目錄下 cd ../../
# 接下來便是修改$CATALINA_HOME/bin目錄下的 daemon.sh 文件 # 設置其中的 TOMCAT_USER=tomcat JAVA_HOME=/usr/java/jdk1.7.0_79
# 如果$CATALINA_HOME/bin下的*.sh文件沒有運行許可權,則為其添加運行許可權 chmod +x *.sh
# 設置$CATALINE_HOME文件夾及其所有子文件Owner為tomcat chown -R tomcat:tomcat /home/apache-tomcat-7.0.67
# 啟動Tomcat daemon.sh start ./daemon.sh start
|
設置Tomcat為Service
1 2 3 4 5 6 7 |
# 創建 $CATALINA_HOME/bin/daemon.sh 的一個鏈接到 /etc/init.d/ 下,service名為tomcat7 ln -s /home/apache-tomcat-7.0.67/bin/daemon.sh /etc/init.d/tomcat7
# 啟動Tomcat /etc/init.d/tomcat7 start # 或者 service tomcat7 start |
設置Tomcat開機自啟動 (前提是已經設置Tomcat為Service)
1 2 3 4 5 |
# 設置開機自啟動 update-rc.d tomcat7 defaults
# 取消開機自啟動 update-rc.d tomcat7 remove |
MySQL
[root@iZ28gvqe4biZ ~]# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
獲取http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
準備中... ################################# [100%]
正在升級/安裝...
1:mysql-community-release-el7-5 ################################# [100%]
這個時候查看當前可用的mysql安裝資源:
[root@iZ28gvqe4biZ ~]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community 17
mysql-tools-community/x86_64 MySQL Tools Community 31
mysql56-community/x86_64 MySQL 5.6 Community Server 199
一般來說,只要安裝mysql-server跟mysql-client
這個時候我們可以直接使用yum的方式安裝MySQL了
[root@iZ28gvqe4biZ ~]# yum -y install mysql-community-server
已載入插件:langpacks
正在解決依賴關係
--> 正在檢查事務
---> 軟體包 mysql-community-server.x86_64.0.5.6.28-2.el7 將被 安裝
--> 正在處理依賴關係 mysql-community-common(x86-64) = 5.6.28-2.el7,它被軟體包 mysql-community-server-5.6.28-2.el7.x86_64 需要
--> 正在處理依賴關係 mysql-community-client(x86-64) = 5.6.28-2.el7,它被軟體包 mysql-community-server-5.6.28-2.el7.x86_64 需要
--> 正在處理依賴關係 perl(DBI),它被軟體包 mysql-community-server-5.6.28-2.el7.x86_64 需要
--> 正在檢查事務
---> 軟體包 mysql-community-client.x86_64.0.5.6.28-2.el7 將被 安裝
--> 正在處理依賴關係 mysql-community-libs(x86-64) = 5.6.28-2.el7,它被軟體包 mysql-community-client-5.6.28-2.el7.x86_64 需要
---> 軟體包 mysql-community-common.x86_64.0.5.6.28-2.el7 將被 安裝
---> 軟體包 perl-DBI.x86_64.0.1.627-4.el7 將被 安裝
--> 正在處理依賴關係 perl(RPC::PlServer) >= 0.2001,它被軟體包 perl-DBI-1.627-4.el7.x86_64 需要
--> 正在處理依賴關係 perl(RPC::PlClient) >= 0.2000,它被軟體包 perl-DBI-1.627-4.el7.x86_64 需要
--> 正在檢查事務
---> 軟體包 mariadb-libs.x86_64.1.5.5.40-1.el7_0 將被 取代
---> 軟體包 mysql-community-libs.x86_64.0.5.6.28-2.el7 將被 捨棄
---> 軟體包 perl-PlRPC.noarch.0.0.2020-14.el7 將被 安裝
--> 正在處理依賴關係 perl(Net::Daemon) >= 0.13,它被軟體包 perl-PlRPC-0.2020-14.el7.noarch 需要
--> 正在處理依賴關係 perl(Net::Daemon::Test),它被軟體包 perl-PlRPC-0.2020-14.el7.noarch 需要
--> 正在處理依賴關係 perl(Net::Daemon::Log),它被軟體包 perl-PlRPC-0.2020-14.el7.noarch 需要
--> 正在處理依賴關係 perl(Compress::Zlib),它被軟體包 perl-PlRPC-0.2020-14.el7.noarch 需要
--> 正在檢查事務
---> 軟體包 perl-IO-Compress.noarch.0.2.061-2.el7 將被 安裝
--> 正在處理依賴關係 perl(Compress::Raw::Zlib) >= 2.061,它被軟體包 perl-IO-Compress-2.061-2.el7.noarch 需要
--> 正在處理依賴關係 perl(Compress::Raw::Bzip2) >= 2.061,它被軟體包 perl-IO-Compress-2.061-2.el7.noarch 需要
---> 軟體包 perl-Net-Daemon.noarch.0.0.48-5.el7 將被 安裝
--> 正在檢查事務
---> 軟體包 perl-Compress-Raw-Bzip2.x86_64.0.2.061-3.el7 將被 安裝
---> 軟體包 perl-Compress-Raw-Zlib.x86_64.1.2.061-4.el7 將被 安裝
--> 解決依賴關係完成
依賴關係解決
==============================================================================================
Package 架構 版本 源 大小
==============================================================================================
正在安裝:
mysql-community-libs x86_64 5.6.28-2.el7 mysql56-community 2.0 M
替換 mariadb-libs.x86_64 1:5.5.40-1.el7_0
mysql-community-server x86_64 5.6.28-2.el7 mysql56-community 58 M
為依賴而安裝:
mysql-community-client x86_64 5.6.28-2.el7 mysql56-community 19 M
mysql-community-common x86_64 5.6.28-2.el7 mysql56-community 256 k
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k
事務概要
==============================================================================================
安裝 2 軟體包 (+8 依賴軟體包)
總下載量:80 M
Downloading packages:
警告:/var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.28-2.el7.x86_64.rpm: 頭V3 DSA/SHA1 Signature, 密鑰 ID 5072e1f5: NOKEY
mysql-community-common-5.6.28-2.el7.x86_64.rpm 的公鑰尚未安裝
(1/10): mysql-community-common-5.6.28-2.el7.x86_64.rpm | 256 kB 00:00:14
(2/10): mysql-community-libs-5.6.28-2.el7.x86_64.rpm | 2.0 MB 00:02:57
(3/10): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm | 57 kB 00:00:00
(4/10): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00:00
(5/10): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00:00
(6/10): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:00:00
(7/10): perl-PlRPC-0.2020-14.el7.noarch.rpm
(8/10): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00:00
(9/10): mysql-community-server-5.6.28-2.el7.x86_64.rpm | 58 MB 00:54:45
(10/10): mysql-community-client-5.6.28-2.el7.x86_64.rpm | 19 MB 00:20:42
總計 13 kB/s | 80 MB 01:45:50
從 file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 檢索密鑰
導入 GPG key 0x5072E1F5:
用戶ID : "MySQL Release Engineering <[email protected]>"
指紋 : a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
軟體包 : mysql-community-release-el7-5.noarch (installed)
來自 : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 資料庫已被非 yum 程式修改。
正在安裝 : mysql-community-common-5.6.28-2.el7.x86_64 1/11
正在安裝 : mysql-community-libs-5.6.28-2.el7.x86_64 2/11
正在安裝 : mysql-community-client-5.6.28-2.el7.x86_64 3/11
正在安裝 : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 4/11
正在安裝 : perl-Net-Daemon-0.48-5.el7.noarch 5/11
正在安裝 : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 6/11
正在安裝 : perl-IO-Compress-2.061-2.el7.noarch 7/11
正在安裝 : perl-PlRPC-0.2020-14.el7.noarch 8/11
正在安裝 : perl-DBI-1.627-4.el7.x86_64 9/11
正在安裝 : mysql-community-server-5.6.28-2.el7.x86_64 10/11
正在刪除 : 1:mariadb-libs-5.5.40-1.el7_0.x86_64 11/11
驗證中 : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 1/11
驗證中 : perl-Net-Daemon-0.48-5.el7.noarch 2/11
驗證中 : mysql-community-common-5.6.28-2.el7.x86_64 3/11
驗證中 : perl-IO-Compress-2.061-2.el7.noarch 4/11
驗證中 : mysql-community-libs-5.6.28-2.el7.x86_64 5/11
驗證中 : mysql-community-client-5.6.28-2.el7.x86_64 6/11
驗證中 : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 7/11
驗證中 : perl-DBI-1.627-4.el7.x86_64 8/11
驗證中 : mysql-community-server-5.6.28-2.el7.x86_64 9/11
驗證中 : perl-PlRPC-0.2020-14.el7.noarch 10/11
驗證中 : 1:mariadb-libs-5.5.40-1.el7_0.x86_64 11/11
已安裝:
mysql-community-libs.x86_64 0:5.6.28-2.el7 mysql-community-server.x86_64 0:5.6.28-2.el7
作為依賴被安裝:
mysql-community-client.x86_64 0:5.6.28-2.el7 mysql-community-common.x86_64 0:5.6.28-2.el7
perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7
perl-DBI.x86_64 0:1.627-4.el7 perl-IO-Compress.noarch 0:2.061-2.el7
perl-Net-Daemon.noarch 0:0.48-5.el7 perl-PlRPC.noarch 0:0.2020-14.el7
替代:
mariadb-libs.x86_64 1:5.5.40-1.el7_0
完畢!
安裝完的配置
加入開機啟動
[root@iZ28gvqe4biZ ~]# systemctl enable mysqld
啟動mysql服務進程
[root@iZ28gvqe4biZ ~]# systemctl start mysqld
重置密碼
[root@iZ28gvqe4biZ ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y [設置root用戶密碼]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y [刪除匿名用戶]
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n [禁止root遠程登錄]
... skipping.
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y [刪除test資料庫]
- Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y [刷新許可權]
... Success!
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Cleaning up...
1003錯誤 授權
在本機先使用root用戶登錄mysql: mysql -u root -p
"youpassword" 進行授權操作:
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
重載授權表:
FLUSH PRIVILEGES;
退出mysql資料庫:
exit
登錄測試
[root@yl-web yl]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.41-MariaDB MariaDB Server
新建Hive知識庫
//登錄MYSQL(有ROOT許可權)。這裡我以ROOT身份登錄
[root@iZ28gvqe4biZ ~]# mysql -u root -p
//首先為用戶創建一個資料庫hivemeta
mysql > create database hivemeta;
mysql > use hivemeta
//授權hdp用戶擁有hivemeta資料庫的所有許可權。
mysql > grant all privileges on *.* to hdp@"%" identified by "hdp" with grant option;
//刷新系統許可權表
mysql > flush privileges;
mysql > use hivemeta;
//mysql/hive字元集問題
mysql > alter database hivemeta character set latin1;
MYsql不區分 大小寫
1、用root登錄,修改 /etc/my.cnf;
2、在[mysqld]節點下,加入一行: lower_case_table_names=1
3、重啟MySQL即可;
Service port伺服器埠http://blog.csdn.net/l1028386804/article/details/50779761
Itables
/etc/sysconfig/iptables 內容
# Generated by iptables-save v1.4.7 on Fri Jan 22 16:43:05 2016
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2228 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3128 -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 22 -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 80 -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 3306 -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 2228 -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 3128 -j ACCEPT
COMMIT
# Completed on Fri Jan 22 16:43:05 2016
/etc/ssh/sshd_config
#Port 22
Port 2228
centos7 yum 方式安裝nginx
(1)使用yum安裝nginx需要包括Nginx的庫,安裝Nginx的庫
#rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
(2)使用下麵命令安裝nginx
#yum install nginx
(3)啟動Nginx
#service nginx start
或
#systemctl start nginx.service
systemctl stop nginx.service
systemctl restart lighttpd
Ngnix Server 配置
/etc/nginx/conf.d/com.zero4j.www.conf 內容
#https://www.youhuidongguan.com:443/的ssl配置
upstream backend {
server 127.0.0.1:8288;
#server 127.0.0.1:9682 backup;
#ip_hash;
}
server {
listen 443 ssl http2 default_server;
# listen [::]:443 ssl;
# server_name _;
server_name www.zero4j.com;
root /usr/share/nginx/html;
ssl_certificate ssl/www.zero4j.com.pem;
ssl_certificate_key ssl/www.zero4j.com.key;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://backend;
#Proxy Settings
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 900;
proxy_send_timeout 900;
proxy_read_timeout 900;
proxy_buffer_size 64k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 64k;
}
}
Install Lighttpd
使用包管理器安裝
這裡我們通過使用包管理器這種最簡單的方法來安裝 Lighttpd。只需以 sudo 模式在終端或控制臺中輸入下麵的指令即可。
CentOS 7
由於 CentOS 7.0 官方倉庫中並沒有提供 Lighttpd,所以我們需要在系統中安裝額外的軟體源 epel 倉庫。使用下麵的 yum 指令來安裝 epel。
# yum install epel-release
然後,我們需要更新系統及為 Lighttpd 的安裝做前置準備。
# yum update
# yum install lighttpd
開啟服務
現在,通過執行 systemctl 指令來重啟 Web 服務。
# systemctl start lighttpd
systemctl stop lighttpd
然後我們將它設置為伴隨系統啟動自動運行。
# systemctl enable lighttpd
Lighttpd http 跳轉 https
/etc/lighttpd/lighttpd.conf 內容 下一節 /etc/lighttpd/modules.conf 內容
#######################################################################
##
## /etc/lighttpd/lighttpd.conf
##
## check /etc/lighttpd/conf.d/*.conf for the configuration of modules.
##
#######################################################################
#######################################################################
##
## Some Variable definition which will make chrooting easier.
##
## if you add a variable here. Add the corresponding variable in the
## chroot example aswell.
##
var.log_root = "/var/log/lighttpd"
var.server_root = "/srv/www"
var.state_dir = "/var/run"
var.home_dir = "/var/lib/lighttpd"
var.conf_dir = "/etc/lighttpd"
##
## run the server chrooted.
##
## This requires root permissions during startup.
##
## If you run Chrooted set the the variables to directories relative to
## the chroot dir.
##
## example chroot configuration:
##
#var.log_root = "/logs"
#var.server_root = "/"
#var.state_dir = "/run"
#var.home_dir = "/lib/lighttpd"
#var.vhosts_dir = "/vhosts"
#var.conf_dir = "/etc"
#
#server.chroot = "/srv/www"
##
## Some additional variables to make the configuration easier
##
##
## Base directory for all virtual hosts
##
## used in:
## conf.d/evhost.conf
## conf.d/simple_vhost.conf
## vhosts.d/vhosts.template
##
var.vhosts_dir = server_root + "/vhosts"
$SERVER["socket"] == ":80" {
#tomcat
$HTTP["host"] == "www.zero4j.com" {
url.redirect = ( "^/(.*)" => "https://www.zero4j.com/$1" )
}
}
#$SERVER["socket"] == ":443" {
#$HTTP["scheme"] == "https" {
#
# setenv.add-environment = (
# "HTTPS" => "on"
# )
# ssl.engine = "enable"
# #ssl.use-sslv2 = "disable"
# #ssl.use-sslv3 = "disable"
# #ssl.use-compression = "disable"
# ssl.pemfile = "/etc/lighttpd/ssl/sway.com.cn.pem"
#
# #ssl.verifyclient.activate = "enable"
# #ssl.verifyclient.depth = 1
# #ssl.ca-file = "/etc/lighttpd/ssl/sway.com.cn.crt"
#
# setenv.add-request-header = (
# "Host" => "request.com",
# "X-Real-IP" => "120.24.182.145",
# "X-Forwarded-For" => "some.real.ip.address",
# "X-Forwarded-Proto" => "https",
# "X-Forwarded-Protocol" => "https",
# "HTTP_X_FORWARDED_PROTO" => "https",
# "HTTP_X_FORWARDED_PROTOCOL" => "https",
# "HTTP_SCHEME " => "https",
# "scheme" => "https",
# ":scheme" => "https",
# )
#
# #setenv.add-response-header = ( "X-Frame-Options" => "DENY")
# setenv.add-response-header = ( "Strict-Transport-Security" => "max-age=63072000; includeSubdomains; preload")
#
# #ssl.cipher-list = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM"
# #ssl.honor-cipher-order = "enable"
# #ssl.disable-client-renegotiation = "enable"
#
# proxy.balance = "hash"
# proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 9503 ) ) )
#
#}
##
## Cache for mod_compress
##
## used in:
## conf.d/compress.conf
##
var.cache_dir = "/var/cache/lighttpd"
##
## Base directory for sockets.
##
## used in:
## conf.d/fastcgi.conf
## conf.d/scgi.conf
##
var.socket_dir = home_dir + "/sockets"
##
#######################################################################
#######################################################################
##
## Load the modules.
include "modules.conf"
##
#######################################################################
#######################################################################
##
## Basic Configuration
## ---------------------
##
server.port = 80
##
## Use IPv6?
##
server.use-ipv6 = "disable"
##
## bind to a specific IP
##
#server.bind = "localhost"
##
## Run as a different username/groupname.
## This requires root permissions during startup.
##
server.username = "lighttpd"
server.groupname = "lighttpd"
##
## enable core files.
##
#server.core-files = "disable"
##
## Document root
##
server.document-root = server_root + "/lighttpd"
##
## The value for the "Server:" response field.
##
## It would be nice to keep it at "lighttpd".
##
#server.tag = "lighttpd"
##
## store a pid file
##
server.pid-file = state_dir + "/lighttpd.pid"
##
#######################################################################
#######################################################################
##
## Logging Options
## ------------------
##
## all logging options can be overwritten per vhost.
##
## Path to the error log file
##
server.errorlog = log_root + "/error.log"
##
## If you want to log to syslog you have to unset the
## server.errorlog setting and uncomment the next line.
##
#server.errorlog-use-syslog = "enable"
##
## Access log config
##
include "conf.d/access_log.conf"
##
## The debug options are moved into their own file.
## see conf.d/debug.conf for various options for request debugging.
##
include "conf.d/debug.conf"
##
#######################################################################
#######################################################################
##
## Tuning/Performance
## --------------------
##
## corresponding documentation:
## http://www.lighttpd.net/documentation/performance.html
##
## set the event-handler (read the performance section in the manual)
##
## possible options on linux are:
##
## select
## poll
## linux-sysepoll
##
## linux-sysepoll is recommended on kernel 2.6.
##
server.event-handler = "linux-sysepoll"
##
## The basic network interface for all platforms at the syscalls read()
## and write(). Every modern OS provides its own syscall to help network
## servers transfer files as fast as possible
##
## linux-sendfile - is recommended for small files.
## writev - is recommended for sending many large files
##
server.network-backend = "linux-sendfile"
##
## As lighttpd is a single-threaded server, its main resource limit is
## the number of file descriptors, which is set to 1024 by default (on
## most systems).
##
## If you are running a high-traffic site you might want to increase this
## limit by setting server.max-fds.
##
## Changing this setting requires root permissions on startup. see
## server.username/server.groupname.
##
## By default lighttpd would not change the operation system default.
## But setting it to 2048 is a better default for busy servers.
##
server.max-fds = 2048
##
## Stat() call caching.
##
## lighttpd can utilize FAM/Gamin to cache stat call.
##
## possible values are:
## disable, simple or fam.
##
server.stat-cache-engine = "simple"
##
## Fine tuning for the request handling
##
## max-connections == max-fds/2 (maybe /3)
## means the other file handles are used for fastcgi/files
##
server.max-connections = 1024
##
## How many seconds to keep a keep-alive connection open,
## until we consider it idle.
##
## Default: 5
##
#server.max-keep-alive-idle = 5
##
## How many keep-alive requests until closing the connection.
##
## Default: 16
##
#server.max-keep-alive-requests = 16
##
## Maximum size of a request in kilobytes.
## By default it is unlimited (0).
##
## Uploads to your server cant be larger than this value.
##
#server.max-request-size = 0
##
## Time to read from a socket before we consider it idle.
##
## Default: 60
##
#server.max-read-idle = 60
##
## Time to write to a socket before we consider it idle.
##
## Default: 360
##
#server.max-write-idle = 360
##
## Traffic Shaping
## -----------------
##
## see /usr/share/doc/lighttpd/traffic-shaping.txt
##
## Values are in kilobyte per second.
##
## Keep in mind that a limit below 32kB/s might actually limit the
## traffic to 32kB/s. This is caused by the size of the TCP send
## buffer.
##
## per server:
##
#server.kbytes-per-second = 128
##
## per connection:
##
#connection.kbytes-per-second = 32
##
#######################################################################
#######################################################################
##
## Filename/File handling
## ------------------------
##
## files to check for if .../ is requested
## index-file.names = ( "index.php", "index.rb", "index.html",
## "index.htm", "default.htm" )
##
index-file.names += (
"index.xhtml", "index.html", "index.htm", "default.htm", "index.php"
)
##
## deny access the file-extensions
##
## ~ is for backupfiles from vi, emacs, joe, ...
## .inc is often used for code includes which should in general not be part
## of the document-root
url.access-deny = ( "~", ".inc" )
##
## disable range requests for pdf files
## workaround for a bug in the Acrobat Reader plugin.
##
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
##
## url handling modules (rewrite, redirect)
##
#url.rewrite = ( "^/$" => "/server-status" )
#url.redirect = ( "^/wishlist/(.+)" => "http://www.example.com/$1" )
##
## both rewrite/redirect support back reference to regex con