Posts

Showing posts with the label Apache

httpd config

Seperate the config of virtualhost to individual file 1. put the vitualhost context into one file /etc/httpd/conf.d Example: file name: httpd-vhosts.conf Context:  <VirtualHost *:80>     ServerName gitserver     DocumentRoot /var/www/gitweb     <Directory /var/www/gitweb>         Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch         AllowOverride All         order allow,deny         Allow from all         AddHandler cgi-script cgi         DirectoryIndex gitweb.cgi     </Directory> </VirtualHost> Set username and password for httpd website 1, Change the context of httpd-vhosts.conf as following <VirtualHost *:80>     ServerName gitserver     DocumentRoot /var/www/gitweb     <Directory /var/www/gitweb> ...

Apache Knowledge

Before doing httpd setting, need disable the selinux For httpd2.2 no need to set rule by default For httpd2.4 need to set rule by default Response Code: 100 - 199 信息提示 200 - 299 成功状态码 300 - 399 重定向 400 - 499 客户端错误 401: 认证失败 402: 找不到请求的资源 403: 对资源没有访问权限 500 - 599 服务端错误 Installation  Install apache with yum : yum install httpd Manually install apache:  After change config file, check httpd config: service httpd configtest Only after change port, need to restart service: service httpd restart Other config change, need to reload: service httpd reload Httpd config A. Config file: (rpm -qc httpd --> find config files) /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/*.conf /etc/sysconfig/httpd (work module) B. Program file: (rpm -ql httpd | grep httpd --> find program files) /usr/sbin/httpd /usr/sbin/httpd.event /usr/sbin/httpd.worker C. Help file: (rpm -qd httpd --> find help files) D. Log file: /var/log/htt...