Total Pageviews

Friday, April 1, 2011

Mengkonfigurasi / etc / httpd / conf / httpd.conf

Mengkonfigurasi / etc / httpd / conf / httpd.conf

The httpd.conf file is the main configuration file for the Apache web server. File httpd.conf adalah file konfigurasi utama untuk server web Apache. A lot options exist, and it's important to read the documentation that comes with Apache for more information on different settings and parameters. Sebuah pilihan ada banyak, dan sangat penting untuk membaca dokumentasi yang datang dengan Apache untuk informasi lebih lanjut tentang pengaturan yang berbeda dan parameter. The following configuration example is a minimal working configuration file for Apache, with SSL support. Contoh konfigurasi berikut adalah konfigurasi file kerja minimal untuk Apache, dengan dukungan SSL. Also, it's important to note that we only comment the parameters that relate to security and optimization, and leave all the others to your own research. Juga, penting untuk dicatat bahwa kami hanya komentar parameter yang berhubungan dengan keamanan dan optimasi, dan meninggalkan semua orang lain untuk riset Anda sendiri.
Edit the httpd.conf file, vi /etc/httpd/conf/httpd.conf and add/change: Edit file httpd.conf, vi / etc / httpd / conf / httpd.conf dan tambahkan / perubahan:
  ### Section 1: Global Environment # # # Bagian 1: Lingkungan Global
      # #
      ServerType standalone ServerType mandiri
      ServerRoot "/etc/httpd" ServerRoot "/ etc / httpd"
      PidFile /var/run/httpd.pid Pidfile / var / run / httpd.pid
      ResourceConfig /dev/null ResourceConfig / dev / null
      AccessConfig /dev/null AccessConfig / dev / null
      Timeout 300 Timeout 300
      KeepAlive On KeepAlive Pada
      MaxKeepAliveRequests 0 MaxKeepAliveRequests 0
      KeepAliveTimeout 15 KeepAliveTimeout 15
      MinSpareServers 16 MinSpareServers 16
      MaxSpareServers 64 MaxSpareServers 64
      StartServers 16 StartServers 16
      MaxClients 512 MaxClients 512
      MaxRequestsPerChild 100000 MaxRequestsPerChild 100000

      ### Section 2: 'Main' server configuration # # # Section 2: 'Main' server konfigurasi
      # #
      Port 80 Port 80

       
      Listen 80 Listen 80
      Listen 443 Listen 443
       

      User www User www
      Group www Group www
      ServerAdmin admin@openna.com ServerAdmin admin@openna.com
      ServerName www.openna.com ServerName www.openna.com
      DocumentRoot "/home/httpd/ona" DocumentRoot "/ home / httpd / Ona"

       
      Options None Tidak ada Pilihan
      AllowOverride None AllowOverride None
      Order deny,allow Order deny, memungkinkan
      Deny from all Deny dari semua
       

       
      Options None Tidak ada Pilihan
      AllowOverride None AllowOverride None
      Order allow,deny Order allow, deny
      Allow from all Izinkan dari semua
       

       
      Options None Tidak ada Pilihan
      AllowOverride None AllowOverride None
      Order deny,allow Order deny, memungkinkan
      Deny from all Deny dari semua
       

       
      DirectoryIndex index.htm index.html index.php index.php3 default.html index.cgi DirectoryIndex index.htm index.html index.php index.php3 default.html index.cgi
       

      # # 
      #Include conf/mmap.conf # Include conf / mmap.conf
      # # 

      UseCanonicalName On UseCanonicalName Pada

       
      TypesConfig /etc/httpd/conf/mime.types TypesConfig / etc / httpd / conf / mime.types
       

      DefaultType text/plain DefaultType text / plain
      HostnameLookups Off HostnameLookups Off

      ErrorLog /var/log/httpd/error_log ErrorLog / var / log / httpd / error_log
      LogLevel warn LogLevel memperingatkan
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "% h% l% u% t \"% r \ "%> s% b \"% {Referer} i \ "\"% {User-Agent} i \ "" gabungan
      SetEnvIf Request_URI \.gif$ gif-image SetEnvIf Request_URI \. Gif $ gif-image
      CustomLog /var/log/httpd/access_log combined env=!gif-image CustomLog / var / log / httpd / access_log gabungan env =! Gif-image
      ServerSignature Off ServerSignature Off

       
      ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/" ScriptAlias ​​/ cgi-bin / "/ home / httpd / cgi-bin /"
       
      AllowOverride None AllowOverride None
      Options None Tidak ada Pilihan
      Order allow,deny Order allow, deny
      Allow from all Izinkan dari semua
       
       

       
      AddEncoding x-compress Z AddEncoding x-compress Z
      AddEncoding x-gzip gz tgz AddEncoding x-gzip gz tgz

      AddType application/x-tar .tgz AddType application / x-tar. Tgz
       

      ErrorDocument 500 "The server made a boo boo. ErrorDocument 500 "Server membuat boo boo.
      ErrorDocument 404 http://192.168.1.1/error.htm ErrorDocument 404 http://192.168.1.1/error.htm
      ErrorDocument 403 "Access Forbidden -- Go away. ErrorDocument 403 "Akses Forbidden - Pergi.

       
      BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "Mozilla / 2" nokeepalive
      BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch "MSIE 4 \ .0 b2;" downgrade-1.0 nokeepalive force-response-1.0
      BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "RealPlayer 4 \ .0" force-response-1.0
      BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "Java / 1 \ .0" force-response-1.0
      BrowserMatch "JDK/1\.0" force-response-1.0 BrowserMatch "JDK / 1 \ .0" force-response-1.0
       

      ### Section 3: Virtual Hosts # # # Section 3: Virtual Host
      # #
       
      AddType application/x-x509-ca-cert .crt AddType application/x-x509-ca-cert. Crt
      AddType application/x-pkcs7-crl .crl AddType application/x-pkcs7-crl. CRL
       

       
      SSLPassPhraseDialog builtin SSLPassPhraseDialog builtin
      SSLSessionCache dbm:/var/run/ssl_scache SSLSessionCache dbm: / var / run / ssl_scache
      SSLSessionCacheTimeout 300 SSLSessionCacheTimeout 300

      SSLMutex file:/var/run/ssl_mutex SSLMutex file: / var / run / ssl_mutex

      SSLRandomSeed startup builtin SSLRandomSeed startup builtin
      SSLRandomSeed connect builtin SSLRandomSeed terhubung builtin

      SSLLog /var/log/httpd/ssl_engine_log SSLLog / var / log / httpd / ssl_engine_log
      SSLLogLevel warn SSLLogLevel memperingatkan
       

       
       

      DocumentRoot "/home/httpd/ona" DocumentRoot "/ home / httpd / Ona"
      ServerName www.openna.com ServerName www.openna.com
      ServerAdmin admin@openna.com ServerAdmin admin@openna.com
      ErrorLog /var/log/httpd/error_log ErrorLog / var / log / httpd / error_log

      SSLEngine on SSLEngine pada
      SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCipherSuite SEMUA: ADH:! RC4 + RSA: + HIGH: + MEDIUM: + LOW: + SSLv2: + EXP: + eNULL

      SSLCertificateFile /etc/ssl/certs/server.crt SSLCertificateFile / etc / ssl / certs / server.crt
      SSLCertificateKeyFile /etc/ssl/private/server.key SSLCertificateKeyFile / etc / ssl / private / server.key
      SSLCACertificatePath /etc/ssl/certs SSLCACertificatePath / etc / ssl / certs
      SSLCACertificateFile /etc/ssl/certs/ca.crt SSLCACertificateFile / etc / ssl / certs / ca.crt
      SSLCARevocationPath /etc/ssl/crl SSLCARevocationPath / etc / ssl / CRL
      SSLVerifyClient none SSLVerifyClient tidak ada
      SSLVerifyDepth 10 SSLVerifyDepth 10

      SSLOptions +ExportCertData +StrictRequire SSLOptions + ExportCertData + StrictRequire
      SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown SetEnvIf User-Agent ".* MSIE .*" nokeepalive ssl-najis-shutdown
      SetEnvIf Request_URI \.gif$ gif-image SetEnvIf Request_URI \. Gif $ gif-image
      CustomLog /var/log/httpd/ssl_request_log \ CustomLog / var / log / httpd / ssl_request_log \
      "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=!gif-image "% T% h% {SSL_PROTOCOL} x% {SSL_CIPHER} x \"% r \ "% b" env =! Gif-image
       
       
    
This tells httpd.conf file to set itself up for this particular configuration setup with: Ini memberitahu file httpd.conf untuk menetapkan sendiri untuk setup konfigurasi tertentu dengan:

ServerType standalone ServerType mandiri
The option ServerType specifies how Apache should run on the system. Opsi ini ServerType menentukan bagaimana Apache harus berjalan pada sistem. You can run it from the super-server inetd, or as standalone daemon. Anda dapat menjalankannya dari inetd super server, atau sebagai daemon standalone. It's highly recommended to run Apache in standalone type for better performance and speed. Ini sangat direkomendasikan untuk menjalankan Apache dalam tipe mandiri untuk meningkatkan kinerja dan kecepatan.
ServerRoot "/etc/httpd" ServerRoot "/ etc / httpd"
The option ServerRoot specifies the directory in which the configuration files of the Apache server lives. Pilihan ServerRoot menentukan direktori dimana file-file konfigurasi dari kehidupan server Apache. It allows Apache to know where it can find its configuration files when it starts. Hal ini memungkinkan Apache mengetahui dimana dapat menemukan file konfigurasinya saat mulai dijalankan.
PidFile /var/run/httpd.pid Pidfile / var / run / httpd.pid
The option PidFile specifies the location where the server will record the process id of the daemon when it starts. Pilihan pidfile menentukan lokasi dimana server akan mencatat proses id dari daemon saat mulai dijalankan. This option is only required when you configure Apache in standalone mode. Opsi ini hanya diperlukan jika Anda mengkonfigurasi Apache dalam mode standalone.
ResourceConfig /dev/null ResourceConfig / dev / null
The option ResourceConfig specifies the location of the old srm.conf file that Apache read after it finished reading the httpd.conf file. Opsi ini ResourceConfig menentukan lokasi file srm.conf lama yang Apache membacanya setelah selesai membaca file httpd.conf. When you set the location to /dev/null, Apache allows you to include the content of this file in httpd.conf file, and in this manner, you have just one file that handles all your configuration parameters for simplicity. Bila Anda menetapkan lokasi ke / dev / null, Apache memungkinkan Anda untuk memasukkan isi file ini di file httpd.conf, dan dengan cara ini, Anda baru saja satu file yang menangani semua parameter konfigurasi Anda untuk kesederhanaan.
AccessConfig /dev/null AccessConfig / dev / null
The option AccessConfig specifies the location of the old access.conf file that Apache read after it finished reading the srm.conf file. Opsi ini AccessConfig menentukan lokasi file access.conf lama yang Apache membacanya setelah selesai membaca file srm.conf. When you set the location to /dev/null , Apache allows you to include the content of this file in httpd.conf file, and in this manner, you have just one file that handles all your configuration parameters for simplicity. Bila Anda menetapkan lokasi ke / dev / null, Apache memungkinkan Anda untuk memasukkan isi file ini di file httpd.conf, dan dengan cara ini, Anda baru saja satu file yang menangani semua parameter konfigurasi Anda untuk kesederhanaan.
Timeout 300 Timeout 300
The option Timeout specifies the amount of time Apache will wait for a GET, POST, PUT request and ACKs on transmissions. Opsi Timeout menentukan jumlah waktu Apache akan menunggu POST, PUT permintaan GET dan ACK pada transmisi. You can safely leave this option on its default values. Anda dapat dengan aman meninggalkan opsi ini pada nilai-nilai default.
KeepAlive On KeepAlive Pada
The option KeepAlive , if set to On , specifies enabling persistent connections on this web server. Opsi KeepAlive, jika diatur ke Aktif, menetapkan memungkinkan koneksi persistent pada web server. For better performance, it's recommended to set this option to On , and allow more than one request per connection. Untuk kinerja yang lebih baik, itu dianjurkan untuk mengatur pilihan ini ke Aktif, dan memungkinkan lebih dari satu permintaan per sambungan.
MaxKeepAliveRequests 0 MaxKeepAliveRequests 0
The option MaxKeepAliveRequests specifies the number of requests allowed per connection when the KeepAlive option above is set to On. When the value of this option is set to 0 then unlimited requests are allowed on the server. Opsi ini MaxKeepAliveRequests menentukan jumlah permintaan diperbolehkan per sambungan ketika opsi KeepAlive atas diatur ke Aktif. Ketika nilai opsi ini diset ke 0 terbatas permintaan maka diperbolehkan pada server. For server performance, it's recommended to allow unlimited requests. Untuk kinerja server, itu dianjurkan untuk memungkinkan permintaan tak terbatas.
KeepAliveTimeout 15 KeepAliveTimeout 15
The option KeepAliveTimeout specifies how much time, in seconds, Apache will wait for a subsequent request before closing the connection. Opsi ini KeepAliveTimeout menentukan berapa banyak waktu, dalam detik, Apache akan menunggu permintaan berikutnya sebelum menutup sambungan. The value of 15 seconds is a good average for server performance. Nilai 15 detik adalah rata-rata yang baik untuk kinerja server.
MinSpareServers 16 MinSpareServers 16
The option MinSpareServers specifies the minimum number of idle child server processes for Apache, which is not handling a request. Opsi ini MinSpareServers menentukan jumlah minimum proses anak idle server untuk Apache, yang tidak menangani permintaan. This is an important tuning parameter regarding the performance of the Apache web server. Ini adalah parameter tuning penting mengenai kinerja dari server web Apache. For high load operation, a value of 16 is recommended by various benchmarks on the Internet. Untuk pengoperasian beban tinggi, nilai 16 direkomendasikan oleh berbagai benchmark di Internet.
MaxSpareServers 64 MaxSpareServers 64
The option MaxSpareServers specifies the maximum number of idle child server processes for Apache, which is not handling a request. Opsi ini MaxSpareServers menentukan jumlah maksimum proses anak idle server untuk Apache, yang tidak menangani permintaan. This is also an important tuning parameter regarding the performance of the Apache web server. Ini juga merupakan parameter tuning penting mengenai kinerja dari server web Apache. For high load operation, a value of 64 is recommended by various benchmarks on the Internet. Untuk pengoperasian beban tinggi, nilai 64 direkomendasikan oleh berbagai benchmark di Internet.
StartServers 16 StartServers 16
The option StartServers specifies the number of child server processes that will be created by Apache on start-up. Opsi ini StartServers menentukan jumlah proses server anak yang akan dibuat oleh Apache di start-up. This is, again, an important tuning parameter regarding the performance of the Apache web server. Ini, sekali lagi, parameter tuning penting mengenai kinerja dari server web Apache. For high load operation, a value of 16 is recommended by various benchmarks on the Internet. Untuk pengoperasian beban tinggi, nilai 16 direkomendasikan oleh berbagai benchmark di Internet.
MaxClients 512 MaxClients 512
The option MaxClients specifies the number of simultaneous requests that can be supported by Apache. Opsi ini MaxClients menentukan jumlah permintaan simultan yang dapat didukung oleh Apache. This too is an important tuning parameter regarding the performance of the Apache web server. Hal ini juga merupakan parameter tuning penting mengenai kinerja dari server web Apache. For high load operation, a value of 512 is recommended by various benchmarks on the Internet. Untuk pengoperasian beban tinggi, nilai 512 direkomendasikan oleh berbagai benchmark di Internet.
MaxRequestsPerChild 100000 MaxRequestsPerChild 100000
The option MaxRequestsPerChild specifies the number of requests that an individual child server process will handle. Opsi ini MaxRequestsPerChild menentukan jumlah permintaan yang server proses anak individu akan menangani. This too is an important tuning parameter regarding the performance of the Apache web server. Hal ini juga merupakan parameter tuning penting mengenai kinerja dari server web Apache.
User www User www
The option User specifies the UID that Apache server will run as. Pengguna Opsi menentukan UID bahwa server Apache akan dijalankan sebagai. It's important to create a new user that has minimal access to the system, and functions just for the purpose of running the web server daemon. Sangat penting untuk membuat user baru yang memiliki akses minimal terhadap sistem, dan fungsi hanya untuk tujuan menjalankan daemon web server.
Group www Group www
The option Group specifies the GID the Apache server will run as. Opsi Grup menentukan GID server Apache akan dijalankan sebagai. It's important to create a new group that has minimal access to the system and functions just for the purpose of running the web server daemon. Sangat penting untuk membuat grup baru yang memiliki akses minimal terhadap sistem dan fungsi hanya untuk tujuan menjalankan daemon web server.
DirectoryIndex index.htm index.html index.php index.php3 default.html index.cgi DirectoryIndex index.htm index.html index.php index.php3 default.html index.cgi
The option DirectoryIndex specifies the files to use by Apache as a pre-written HTML directory index. Pilihan DirectoryIndex menentukan file untuk digunakan oleh Apache sebagai tertulis HTML direktori-indeks pra. In other words, if Apache can't find the default index page to display, it'll try the next entry in this parameter, if available. Dengan kata lain, jika Apache tidak dapat menemukan halaman default indeks untuk menampilkan, itu akan coba selanjutnya masuk ke dalam parameter ini, jika tersedia. To improve performance of your web server it's recommended to list the most used default index pages of your web site first. Untuk meningkatkan kinerja server web Anda di rekomendasikan untuk daftar halaman indeks default paling banyak digunakan dari situs web pertama Anda.
Include conf/mmap.conf Sertakan conf / mmap.conf
The option Include specifies the location of other files that you can include from within the server configuration files httpd.conf . Pilihan Sertakan menentukan lokasi file-file lain yang Anda dapat mencakup dari dalam konfigurasi httpd.conf file server. In our case, we include the mmap.conf file located under /etc/httpd/conf directory. Dalam kasus kami, kami menyertakan file mmap.conf ditempatkan di bawah / etc / conf direktori httpd. This file mmap.conf maps files into memory for faster serving. Ini file peta mmap.conf file ke dalam memori untuk lebih cepat melayani. See the section on Optimizing Apache for more information. Lihat bagian tentang Mengoptimalkan Apache untuk informasi lebih lanjut.
HostnameLookups Off HostnameLookups Off
The option HostnameLookups , if set to Off , specifies the disabling of DNS lookups. Pilihan HostnameLookups, jika diatur ke Nonaktif, menentukan penonaktifan DNS lookups. It's recommended to set this option to Off in order to save the network traffic time, and to improve the performance of your Apache web server. Ini dianjurkan untuk mengatur pilihan ini ke Tidak aktif dalam rangka untuk menghemat waktu lalu lintas jaringan, dan untuk meningkatkan kinerja dari web server Apache Anda.

No comments:

Post a Comment

Powered By Blogger