3 main sections of httpd.conf
---------------------------------------
Main server configuration ( host-specific server directives)
Global environment ( the location of configuration files )
Virtual hosts (Server values specific to virtual hosts)
Global environment
ServerType ( run under inetd daemon or standalone service)
ServerRoot ( identifies server root , for security resons you need to ensure that root has exclusive write access to the server root directory tree and its contents and ordinary users cant make modifications )
Timeout 300 (default is 300 ie 5mins) ( sets time period for which apache waits during certain operations are performed before it sends or recieves a timeout signal )
StartServers ( number of services you want to run on startup)
Main server configuration
it contains directives for main server. the values of these directives are also used as default values for virtual hosts unless virtual hosts section of the file specifes diffrent values
it contains configrations related to
PortNumber
User and Group
ServerAdmin email@address.com ( mails if any notifications of server problems to this id)
ServerName www.validhostname.com:80 (address to which sites clients will connect, so give valid DNS name.)
DocumentRoot "/var/www/html" (content will be in this directory we can use symbolic links if space is less)
DirectoryIndex
ErrorLog
Alias
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
It is important to keep all the CGI scripts and executable files in single direcotry "cgi-bin" to avoid security risks
or if you want to give access to some executables then keep them in another directory.Also keep cgi-bin directory
outside /var/www/html
create different CGI direcotries for diffrent virtualhosts we can do it by setting User and Group
User apache
Group apache
when apache starts or get initiated it starts as root to configure itself but later it forks into child and run as
specified user and group as running as root causes security risks.
ps -aux | grep httpd
(display httpd processes currently running )
Listen 80 ( portnumber to listen to default is 80)
if you want to change port chage port higher than 1023 as below 1024 are reserverd for root's use
most commonly used options for httpd are
------------------------------------------------------
-d serverroot (sets the location of the server root overrieds ServerRoot in httpd.conf)
-f config ( carryout commands in configurations at startup)
-h display summary of possible commands
-L provides directive list and possible argeuments and locations where each directive is valid
-t run syntax tests on configuration files returns 0 if acceptable
-x instructs httpd to run in single-process mode genrally used for internal debugging.
-s verify the virtual host configuration
Virtual hosts
it enables to setup virtual host containers to enable multiple-server capability
without vritual hosting you need to run two seperate web servers listening on diffrent IP addresses, and
have a unique network interface bound to each address.
Virtual hosting enables you to host both sites on one computer with the same IP address.
Linux administration , Unix administration , Vmware Vsphere administration , Oracle DBA ,apache, backup, dhcp, dns, kvm, xen, kernel, ldap, kvm, monitoring, ticketing, networking, Mail servers, SAN,troubleshooting
Labels
- Amanda (2)
- Ansible (2)
- Answer these Questions (2)
- antivirus (2)
- apache (3)
- Bash (16)
- Chef (3)
- Citrix (2)
- clusters (2)
- Concept (22)
- DatabaseAdminstration (11)
- DevOps (1)
- dhcp (2)
- Downloads (3)
- ELK (1)
- ELK stack (1)
- encryption (1)
- Free trainings (1)
- Frequently Used Commands (46)
- FTP (1)
- git (1)
- gpg (2)
- Hardware (1)
- httpd (2)
- Interview Questions (53)
- iptables (1)
- IT NEWS (3)
- java (1)
- kibana (2)
- knife (1)
- KVM (2)
- linux (17)
- Linux installations (22)
- Linux Jobs (4)
- Linux Links (2)
- logstash (1)
- Mac (1)
- MediaWiki (1)
- MySql (2)
- Nagios (2)
- Networking (3)
- open Nebula (5)
- Open Source tools (12)
- OpenNMS (1)
- openSSL (1)
- Oracle on Linux (5)
- Performance Monitoring (1)
- php (1)
- postfix (1)
- postgres (1)
- postgres-XL (1)
- Product Reviews (1)
- Python (2)
- rssh (1)
- Samba (2)
- Scripting (16)
- security (4)
- selinux (1)
- Server (1)
- SFTP (1)
- Social Awareness (1)
- Solaris (1)
- SSL (1)
- svn (1)
- TCP/IP (1)
- Technology (1)
- Tips and Tricks (32)
- Training and materials (8)
- Troubleshooting (6)
- Ubuntu (18)
- unix (1)
- virtualization (17)
- Vmware (25)
- Vyatta (1)
- windows7 (1)
- xml (1)
No comments:
Post a Comment