Apache

3,183 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,183
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
148
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Apache

  1. 1. APACHE HTTP SERVER
  2. 2. Apache helps in the keen growth of the world wide web.The majority of web servers using Apache run a Unix-like operating system.As of February 2010[update] Apache served over 54.46% of all websites and over 66% of the million busiest INTRODUCTION:
  3. 3. Features Apache supports a variety of features, many implemented as compiled modules which extend the core functionality. These can range from server-side programming language support to authentication schemes. Some common language interfaces support Perl, Python, Tcl, and PHP
  4. 4. PERFORMANCE Although the main design goal of Apache is not to be the "fastest" web server, Apache does have performance comparable to other "high- performance" web servers
  5. 5. MAIN USE Apache is primarily used to serve both static content and dynamic Web pages on the World Wide Web. Many web applications are designed expecting the environment and features that Apache provides
  6. 6. Step 1: We need to have the xampp for linux inorder the run applications so(as per step 1) ,download the xampp for linux with any favourable version on to the computer INSTALLING APACHE IN LINUX:
  7. 7. Step 2: After the successful downloading,we need to extract the 'tar' file on to the system,select a path and just extract them using the following commands gunzip -d httpd-2_0_NN.tar.gz tar xvf httpd-2_0_NN.tar *NN -refers to the current xampp version
  8. 8. CONFIGURATION
  9. 9. Inorder to configure the ,we need to locate the xampp folder to which it is extracted. After the location of these file we can find the configure file in the 'etc' folder as “httpd.config”,inside which we can find the configuration file “configuration file main Apache HTTP server configuration . It contains the configuration directives that give the server its instructions”
  10. 10. ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept ServerRoot "/opt/lampp" Listen: Allows you to bind Apache to specific IP addresses and/or ports, instead of the default. Listen 12.34.56.78:80 Inside which we can fine the various server details,they are:
  11. 11. User/Group: The name (or #number) of the user/group to run httpd as it is usually good practice to create a dedicated user and group for running httpd, as with most system services. User nobody Group nogroup ServerAdmin: Your address, where problems with the server should be e-mailed. This address appears on some server-generated pages, such as error documents. e.g. admin@your-domain.com
  12. 12. ServerName gives the name and port that the server uses to identify itself.This can often be determined automatically, but we recommend you specifyit explicitly to prevent problems during startup.If your host doesn't have a registered DNS name, enter its IP address in it. ServerName www.example.com:80 ServerName localhost DocumentRoot: The directory out of which you will serve your documents. By default, all requests are taken from this directory, but symbolic links and aliases may be used to point to other locations. DocumentRoot "/opt/lampp/htdocs"
  13. 13. Each directory to which Apache has access can be configured with respect to which services and features are allowed and/or disabled in that directory (and its subdirectories). First, we configure the "default" to be a very restrictive set of features. <Directory /> Options FollowSymLinks AllowOverride None #XAMPP #Order deny,allow #Deny from all </Directory>
  14. 14. DirectoryIndex sets the file that Apache will serve if a directory is requested. <IfModule dir_module> #DirectoryIndex index.html # XAMPP DirectoryIndex index.html index.html.var index.php index.php3 index.php4 </IfModule> ------------------------------------------------------------------------------- The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients. <FilesMatch "^.ht"> Order allow,deny Deny from all </FilesMatch>
  15. 15. ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog logs/error_log Redirect: Allows you to tell clients about documents that used to exist in your server's namespace, but do not anymore. The client will make a new request for the document at its new location. Example: Redirect permanent /foo http://www.example.com/bar
  16. 16. Alias: Maps web paths into filesystem paths and is used to access content that does not live under the DocumentRoot. Example: Alias /webpath /full/filesystem/path ScriptAlias: This controls which directories contain server scripts.ScriptAliases are essentially the same as Aliases, except thatdocuments in the target directory are treated as applications and run by the server when requested rather than as documents sent to the client. The same rules about trailing "/" apply to ScriptAliasdirectives as to Alias. ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/"
  17. 17. Supplemental configuration:The configuration files in the etc/extra/ directory can be included to add extra features or to modify the default configuration of the server, or you may simply copy their contents here and change as necessary. Server-pool management (MPM specific) Include etc/extra/httpd-mpm.conf Language settings Include etc/extra/httpd-language User home directories #Include etc/extra/httpd-userdir.conf
  18. 18. Real-time info on requests and configuration Include etc/extra/httpd-info.conf Virtual hosts Include etc/extra/httpd-vhosts.conf Local access to the Apache HTTP Server Manual Include etc/extra/httpd-manual.conf Distributed authoring and versioning (WebDAV) Include etc/extra/httpd-dav.conf Various default settings Include etc/extra/httpd-default.conf
  19. 19. Managing one site on a Web server can be tough enough, and the job is even harder if you have to host multiple client sites on a badly configured setup. If you're running Apache, you can make things easier by setting up virtual hosts, which let you control multiple domains on one IP address, allowing you to specify URLs like http://clientsdomain.com/file_name.html instead of http://yoursite.com/hosted/clients_directory/file_name.html, and letting you forgo setting up domain forwarding with a /srv/www/htdocs/hosted/clients_directory file. If Apache is installed correctly, you can set up virtual hosting easily by editing Apache configuration files. The main .conf files in /etc/apache2 include httpd.conf, error.conf, server-tuning.conf, and a bunch more. These files are set for read-only access for normal users; you must gain root access with the sudo or su command to change them. Edit /etc/apache2/httpd.conf and find this line: Include /etc/apache2/vhosts.d/*.conf Replace it with a line that specifies a .conf file we will create and call vhost.conf: Include /etc/apache2/vhosts.d/vhost.conf SETTING VIRTUAL HOSTING
  20. 20. When you've made the change, save the file. Now, again as root, create the vhost.conf by renaming the vhost.template file in /vhosts.d/: mv vhost.template vhost.conf Now edit the file to set it to allow multiple name-based Web sites on a single IP address. First add in the virtual host directive with NamevirtualHost *. The asterisk is a wild card character that allows any address to be set. Under that directive you can add your first virtual host:
  21. 21. NamevirtualHost * <VirtualHost *> ServerAdmin youremail@yoursite.com DocumentRoot /srv/www/htdocs/directory_of_your_choice/ ServerAlias yourdomain.com *.yourdomain.com <virtualHost> The first part is the opening tag for the defined virutal host block. ServerAdmin lets you display the administrator email address when an error such as a 404 occurs. DocumentRoot is the root directory for the defined site; for example, sites I have hosted in the past all had accounts set up within /srv/www/htdocs/hosted/sitename/. Next is the ServerAlias or ServerName, which controls what names people can use to see and access a site. You could set this to a directory within the main NameVirtualHost or the domain of the site so the server can display the content associated with the domain name. The reason for the two ServerAlias entries above is that servers are often called from more than one ServerName, so you set up a ServerAlias with more than one address listed. The wild card allows for any domain request with anything in front of .yourdomain.com.

×