This document provides examples of setting up virtual hosts on Apache HTTP Server to serve multiple websites from a single server. It discusses scenarios such as running multiple name-based websites on a single IP address, using name-based or IP-based virtual hosts on different IP addresses or ports, and mixed configurations using name-based, IP-based, and port-based virtual hosts. The examples show the server configuration needed for each scenario using the VirtualHost and NameVirtualHost directives.
The document discusses configuring the Apache web server. It covers topics like:
- The Apache configuration file httpd.conf and options within it like DocumentRoot
- Using .htaccess files to override httpd.conf settings for specific directories
- Configuring password authentication for directories using htpasswd
- Setting up virtual hosts to serve different websites from the same server using different IP addresses
This document discusses setting up an Apache web server with virtual domains and dynamic CGI pages. It provides instructions for installing and configuring Apache from source, including a sample httpd.conf configuration file. It also describes a simple shell script-based web server for testing purposes.
Apache can function as both a forward and reverse proxy server. To configure it as a proxy, enable the proxy module, turn on proxy requests, and specify which clients can access the proxy. The proxy caches frequently accessed pages to improve performance and reduce bandwidth. It also provides security, access control, and logging of internet traffic on the network.
.htaccess files allow customization of configuration settings for specific directories on an Apache server. They are commonly used for authorization, authentication, customized error responses, and rewriting URLs. The .htaccess file must be placed in the directory it applies to and affects that directory and all subdirectories. It can control access, redirect users, handle errors, and more. Care must be taken to ensure the commands don't cause conflicts or security issues.
Apache is an open source web server software that runs on over half of all internet servers. The document provides instructions on downloading, installing, and configuring Apache on Windows and Linux systems. It also lists and describes 30 different Apache configuration directives that can be used to customize the server setup.
The document discusses various ways to configure .htaccess files to modify Apache server behavior. Some examples covered include:
1. Using ErrorDocument directives to customize error pages for different HTTP status codes like 400, 401, 403, 404, and 500.
2. Authentication and authorization using Auth directives like AuthUserFile and AuthGroupFile to password protect directories.
3. Rewrite rules to redirect requests, rewrite URLs, and route requests through index.php for an MVC framework.
4. Common flags used in rewrite rules like L, QSA, and R to control matching and redirection behavior.
The document provides instructions for starting, stopping, restarting, and reloading the Apache HTTP Server using the /sbin/service command. It describes configuring the server by editing the httpd.conf file and locations for log and error files. It also covers setting up virtual hosts on multiple IPs, authentication, and protecting web directories with passwords. Key configuration directives like Listen, ServerName, DocumentRoot, Directory, and Authentication directives are explained.
This document provides an overview of installing and configuring the Apache web server on Linux. It discusses downloading and unpacking the Apache files, editing the configuration files, starting and stopping the Apache daemon, setting up virtual hosting, and some key configuration options. The primary steps are installing Apache from a download or CD, setting up the website directories and files, configuring options like the server name and ports, and testing the server using a web browser.
The document discusses configuring the Apache web server. It covers topics like:
- The Apache configuration file httpd.conf and options within it like DocumentRoot
- Using .htaccess files to override httpd.conf settings for specific directories
- Configuring password authentication for directories using htpasswd
- Setting up virtual hosts to serve different websites from the same server using different IP addresses
This document discusses setting up an Apache web server with virtual domains and dynamic CGI pages. It provides instructions for installing and configuring Apache from source, including a sample httpd.conf configuration file. It also describes a simple shell script-based web server for testing purposes.
Apache can function as both a forward and reverse proxy server. To configure it as a proxy, enable the proxy module, turn on proxy requests, and specify which clients can access the proxy. The proxy caches frequently accessed pages to improve performance and reduce bandwidth. It also provides security, access control, and logging of internet traffic on the network.
.htaccess files allow customization of configuration settings for specific directories on an Apache server. They are commonly used for authorization, authentication, customized error responses, and rewriting URLs. The .htaccess file must be placed in the directory it applies to and affects that directory and all subdirectories. It can control access, redirect users, handle errors, and more. Care must be taken to ensure the commands don't cause conflicts or security issues.
Apache is an open source web server software that runs on over half of all internet servers. The document provides instructions on downloading, installing, and configuring Apache on Windows and Linux systems. It also lists and describes 30 different Apache configuration directives that can be used to customize the server setup.
The document discusses various ways to configure .htaccess files to modify Apache server behavior. Some examples covered include:
1. Using ErrorDocument directives to customize error pages for different HTTP status codes like 400, 401, 403, 404, and 500.
2. Authentication and authorization using Auth directives like AuthUserFile and AuthGroupFile to password protect directories.
3. Rewrite rules to redirect requests, rewrite URLs, and route requests through index.php for an MVC framework.
4. Common flags used in rewrite rules like L, QSA, and R to control matching and redirection behavior.
The document provides instructions for starting, stopping, restarting, and reloading the Apache HTTP Server using the /sbin/service command. It describes configuring the server by editing the httpd.conf file and locations for log and error files. It also covers setting up virtual hosts on multiple IPs, authentication, and protecting web directories with passwords. Key configuration directives like Listen, ServerName, DocumentRoot, Directory, and Authentication directives are explained.
This document provides an overview of installing and configuring the Apache web server on Linux. It discusses downloading and unpacking the Apache files, editing the configuration files, starting and stopping the Apache daemon, setting up virtual hosting, and some key configuration options. The primary steps are installing Apache from a download or CD, setting up the website directories and files, configuring options like the server name and ports, and testing the server using a web browser.
Apache web server installation/configuration, Virtual Hostingwebhostingguy
The document describes the history and development of the Apache web server. Some key points:
- Apache was originally developed by the Apache group in 1995 as an open source alternative to NCSA httpd. It was called "A PAtCHy server" as it was initially developed through people contributing patch files to NCSA httpd.
- The first official public release was version 0.6.2 in April 1995. Key early features included adaptive pre-fork child processes and a modular/extensible structure and API.
- Apache quickly gained popularity and overtook NCSA httpd as the most widely used web server on the Internet after releasing version 1.0 in December 1995.
This document summarizes an advanced Apache web server training session covering security and performance tuning. The key points discussed include:
1) Methods for securing an Apache server such as restricting access, disabling unneeded server technologies, running as a non-root user, using firewalls and encryption.
2) Configuring password-based authentication for protected directories using modules like mod_auth and storing passwords in text files created by the htpasswd utility.
3) An exercise where attendees set up password protection on their local Apache server website using a .htaccess file and htpasswd.
4) Restricting access to protected directories by IP, hostname or domain using directives in httpd.conf or .
The document discusses Ajax, which uses a combination of technologies like HTML, JavaScript, XML and CSS to retrieve data from a server asynchronously in the background without interfering with the display and behavior of the existing page. It explains what Ajax is, the technologies used, how it works using XMLHttpRequest object, and provides an example of creating an Ajax request and handling responses from the server. It also touches upon drawbacks and browser compatibility issues with Ajax.
This document provides an overview and introduction to installing and administering a web server. It discusses hosting options, hardware requirements, operating system choices, web server software options like Apache and IIS, networking basics, DNS, and more. The course will teach students how to install and configure the Apache web server to deliver dynamic web content on a UNIX system through lectures, demonstrations and hands-on exercises.
This document discusses the steps to install and configure the Apache web server on a Linux system. It includes downloading and extracting the Apache source files, configuring the files with the ./configure command, building and installing Apache with make and make install, customizing the httpd.conf configuration file, and testing the Apache installation by accessing http://localhost in a web browser. Key configuration directives like AccessConfig, AddDefaultCharset, AllowOverride, and DefaultType are also briefly described.
This document summarizes an instructor-led meeting about advanced Apache topics including virtual hosting, setting up name-based and IP-based virtual hosts, enabling server-side includes, and enabling CGI scripts. Key points covered include configuring Apache for virtual hosting using VirtualHost blocks, setting up name-based virtual hosting with NameVirtualHost, and enabling CGI scripts through ScriptAlias directives or directory options.
This document provides a guide to configuring the Apache web server. It begins with basic setup instructions, covering verifying the installation, editing configuration files, creating HTML documents, starting the server, and accessing the website locally and externally. It then covers more advanced topics like using directory, files, and location tags; redirecting URLs; setting up virtual hosts; loading modules; using .htaccess files; and securing the server with encrypted sessions and SSL/TLS certificates. The document is intended to help new Linux and Windows users become proficient with Apache.
Linux Webserver Installation Command and GUI.pptwebhostingguy
The document provides instructions for installing and configuring an Apache web server on Linux. It discusses downloading and unpacking the Apache files, running configuration commands like make and make install, editing the httpd.conf file to configure server settings and start the Apache service, and testing the installation by accessing the server locally. It also covers additional configuration topics like setting up virtual hosts and file permissions.
Site Performance - From Pinto to FerrariJoseph Scott
This document discusses ways to improve website performance from slow "Pinto" levels to faster "Ferrari" levels. It recommends using an opcode cache like APC to speed up PHP, optimizing databases with technologies like Memcached, using caching plugins in WordPress, and considering architectures with load balancing and replication. The goal is to identify bottlenecks and apply techniques that reduce page load times through an understanding of how websites and underlying technologies work.
This document provides a cheat sheet on how to configure the Nginx web server for common use cases such as setting ports and domain names, serving static files, redirects, reverse proxying, TLS/SSL encryption, load balancing, and access logging. It includes configuration examples for listening on ports, setting server names, serving static assets, 301 and 302 redirects, basic and upgraded reverse proxying, HTTPS setup, and load balancing multiple servers.
This document provides instructions for installing and configuring Apache HTTP Server on Linux. It describes downloading and extracting the Apache files, editing the configuration files such as httpd.conf to configure settings like the server name, ports, document root, error logs, and supplemental configuration files. It also explains how to set up virtual hosting by editing httpd.conf to include a vhosts.conf file, then creating that file and adding directives to allow multiple websites on different domains to run on the same IP address.
Redis is an open source, in-memory key-value data store that can be used as a cache or database. It supports various data structures like strings, hashes, lists, sets and sorted sets. Redis has features for transactions, pub/sub messaging and scripting. Data can be sharded across multiple Redis instances for large datasets or high throughput needs. Common use cases include caching, sessions, pub/sub, rate limiting and autocompletion.
The document provides information about the Apache HTTP Server software. It discusses that Apache is notable for playing a key role in the growth of the World Wide Web. It is the most popular web server software, serving over half of all websites. The document then covers Apache's features, uses, performance capabilities, and how to install and configure it in Linux.
The document provides an introduction to Cascading Style Sheets (CSS), covering topics such as what CSS is, basic CSS syntax, CSS selectors including element, class and ID selectors, CSS properties for colors/backgrounds, text formatting, links, padding/margins, and layout. It also discusses CSS validation and the role of the World Wide Web Consortium (W3C) in maintaining web standards.
Apache is a powerful and flexible web server that implements the latest HTTP protocols. It is highly configurable, customizable through modules, provides full source code, and runs on many operating systems. The document then provides details on installing and configuring Apache, including the steps for installation and descriptions of various configuration directives.
This document provides an overview of Apache HTTP Server configuration recipes and new features. It discusses solutions for the CVE-2011-3192 vulnerability, using mod_substitute to rewrite content, setting up name-based virtual hosts with SSL and Server Name Indication (SNI), securing mod_dav deployments, and advantages of the new <If> directive in Apache 2.4 for conditional configuration blocks based on request properties. The document encourages users to implement web application firewall rules with mod_security and provides tips for troubleshooting slow PHP scripts.
This document provides recipes and configuration tips for managing an Apache HTTP server. It discusses upgrading to newer Apache versions, enabling directory styling, using mod_substitute for content filtering, setting up SSL virtual hosts with SNI, securing mod_dav deployments, and using new conditional directives like <If> and conditional logging in Apache 2.4. The document aims to help Apache administrators secure their servers and implement advanced configurations.
The document provides an overview of how to configure and run the Apache HTTP Server on FreeBSD. It discusses installing Apache from ports, editing the main configuration file httpd.conf to configure server settings like the server name, admin email, and document root. It also explains how to start, stop, and restart the server, set up virtual hosts, install additional modules, and use Apache to run dynamic websites built with frameworks like Django, Ruby on Rails, and applications like PHP.
Tutorial ini membahas cara membuat virtual host dan SSL. Langkah awalnya adalah menjalankan CMD sebagai administrator untuk mengubah konfigurasi file. Kemudian menambahkan alamat IP virtual host ke file hosts dan mengatur konfigurasi virtual host di berkas httpd.conf dan sites-enabled. Cara membuat SSL meliputi pembuatan sertifikat CA, sertifikat untuk localhost, menandatangani sertifikat request, meletakkan sertifikat dan kunci ke Apache, serta menginstal sertifikat
This document discusses techniques for discovering hostnames and virtual hosts through DNS enumeration, service fingerprints, application layers, and passive methods. It lists tools that can be used for reconnaissance like DNSenum, DNSrecon, Maltego, Nmap, and TheHarvester. The document provides examples of hostname discovery through DNS records, SSL certificates, HTTP response banners, redirects, and public data sources.
Apache web server installation/configuration, Virtual Hostingwebhostingguy
The document describes the history and development of the Apache web server. Some key points:
- Apache was originally developed by the Apache group in 1995 as an open source alternative to NCSA httpd. It was called "A PAtCHy server" as it was initially developed through people contributing patch files to NCSA httpd.
- The first official public release was version 0.6.2 in April 1995. Key early features included adaptive pre-fork child processes and a modular/extensible structure and API.
- Apache quickly gained popularity and overtook NCSA httpd as the most widely used web server on the Internet after releasing version 1.0 in December 1995.
This document summarizes an advanced Apache web server training session covering security and performance tuning. The key points discussed include:
1) Methods for securing an Apache server such as restricting access, disabling unneeded server technologies, running as a non-root user, using firewalls and encryption.
2) Configuring password-based authentication for protected directories using modules like mod_auth and storing passwords in text files created by the htpasswd utility.
3) An exercise where attendees set up password protection on their local Apache server website using a .htaccess file and htpasswd.
4) Restricting access to protected directories by IP, hostname or domain using directives in httpd.conf or .
The document discusses Ajax, which uses a combination of technologies like HTML, JavaScript, XML and CSS to retrieve data from a server asynchronously in the background without interfering with the display and behavior of the existing page. It explains what Ajax is, the technologies used, how it works using XMLHttpRequest object, and provides an example of creating an Ajax request and handling responses from the server. It also touches upon drawbacks and browser compatibility issues with Ajax.
This document provides an overview and introduction to installing and administering a web server. It discusses hosting options, hardware requirements, operating system choices, web server software options like Apache and IIS, networking basics, DNS, and more. The course will teach students how to install and configure the Apache web server to deliver dynamic web content on a UNIX system through lectures, demonstrations and hands-on exercises.
This document discusses the steps to install and configure the Apache web server on a Linux system. It includes downloading and extracting the Apache source files, configuring the files with the ./configure command, building and installing Apache with make and make install, customizing the httpd.conf configuration file, and testing the Apache installation by accessing http://localhost in a web browser. Key configuration directives like AccessConfig, AddDefaultCharset, AllowOverride, and DefaultType are also briefly described.
This document summarizes an instructor-led meeting about advanced Apache topics including virtual hosting, setting up name-based and IP-based virtual hosts, enabling server-side includes, and enabling CGI scripts. Key points covered include configuring Apache for virtual hosting using VirtualHost blocks, setting up name-based virtual hosting with NameVirtualHost, and enabling CGI scripts through ScriptAlias directives or directory options.
This document provides a guide to configuring the Apache web server. It begins with basic setup instructions, covering verifying the installation, editing configuration files, creating HTML documents, starting the server, and accessing the website locally and externally. It then covers more advanced topics like using directory, files, and location tags; redirecting URLs; setting up virtual hosts; loading modules; using .htaccess files; and securing the server with encrypted sessions and SSL/TLS certificates. The document is intended to help new Linux and Windows users become proficient with Apache.
Linux Webserver Installation Command and GUI.pptwebhostingguy
The document provides instructions for installing and configuring an Apache web server on Linux. It discusses downloading and unpacking the Apache files, running configuration commands like make and make install, editing the httpd.conf file to configure server settings and start the Apache service, and testing the installation by accessing the server locally. It also covers additional configuration topics like setting up virtual hosts and file permissions.
Site Performance - From Pinto to FerrariJoseph Scott
This document discusses ways to improve website performance from slow "Pinto" levels to faster "Ferrari" levels. It recommends using an opcode cache like APC to speed up PHP, optimizing databases with technologies like Memcached, using caching plugins in WordPress, and considering architectures with load balancing and replication. The goal is to identify bottlenecks and apply techniques that reduce page load times through an understanding of how websites and underlying technologies work.
This document provides a cheat sheet on how to configure the Nginx web server for common use cases such as setting ports and domain names, serving static files, redirects, reverse proxying, TLS/SSL encryption, load balancing, and access logging. It includes configuration examples for listening on ports, setting server names, serving static assets, 301 and 302 redirects, basic and upgraded reverse proxying, HTTPS setup, and load balancing multiple servers.
This document provides instructions for installing and configuring Apache HTTP Server on Linux. It describes downloading and extracting the Apache files, editing the configuration files such as httpd.conf to configure settings like the server name, ports, document root, error logs, and supplemental configuration files. It also explains how to set up virtual hosting by editing httpd.conf to include a vhosts.conf file, then creating that file and adding directives to allow multiple websites on different domains to run on the same IP address.
Redis is an open source, in-memory key-value data store that can be used as a cache or database. It supports various data structures like strings, hashes, lists, sets and sorted sets. Redis has features for transactions, pub/sub messaging and scripting. Data can be sharded across multiple Redis instances for large datasets or high throughput needs. Common use cases include caching, sessions, pub/sub, rate limiting and autocompletion.
The document provides information about the Apache HTTP Server software. It discusses that Apache is notable for playing a key role in the growth of the World Wide Web. It is the most popular web server software, serving over half of all websites. The document then covers Apache's features, uses, performance capabilities, and how to install and configure it in Linux.
The document provides an introduction to Cascading Style Sheets (CSS), covering topics such as what CSS is, basic CSS syntax, CSS selectors including element, class and ID selectors, CSS properties for colors/backgrounds, text formatting, links, padding/margins, and layout. It also discusses CSS validation and the role of the World Wide Web Consortium (W3C) in maintaining web standards.
Apache is a powerful and flexible web server that implements the latest HTTP protocols. It is highly configurable, customizable through modules, provides full source code, and runs on many operating systems. The document then provides details on installing and configuring Apache, including the steps for installation and descriptions of various configuration directives.
This document provides an overview of Apache HTTP Server configuration recipes and new features. It discusses solutions for the CVE-2011-3192 vulnerability, using mod_substitute to rewrite content, setting up name-based virtual hosts with SSL and Server Name Indication (SNI), securing mod_dav deployments, and advantages of the new <If> directive in Apache 2.4 for conditional configuration blocks based on request properties. The document encourages users to implement web application firewall rules with mod_security and provides tips for troubleshooting slow PHP scripts.
This document provides recipes and configuration tips for managing an Apache HTTP server. It discusses upgrading to newer Apache versions, enabling directory styling, using mod_substitute for content filtering, setting up SSL virtual hosts with SNI, securing mod_dav deployments, and using new conditional directives like <If> and conditional logging in Apache 2.4. The document aims to help Apache administrators secure their servers and implement advanced configurations.
The document provides an overview of how to configure and run the Apache HTTP Server on FreeBSD. It discusses installing Apache from ports, editing the main configuration file httpd.conf to configure server settings like the server name, admin email, and document root. It also explains how to start, stop, and restart the server, set up virtual hosts, install additional modules, and use Apache to run dynamic websites built with frameworks like Django, Ruby on Rails, and applications like PHP.
Tutorial ini membahas cara membuat virtual host dan SSL. Langkah awalnya adalah menjalankan CMD sebagai administrator untuk mengubah konfigurasi file. Kemudian menambahkan alamat IP virtual host ke file hosts dan mengatur konfigurasi virtual host di berkas httpd.conf dan sites-enabled. Cara membuat SSL meliputi pembuatan sertifikat CA, sertifikat untuk localhost, menandatangani sertifikat request, meletakkan sertifikat dan kunci ke Apache, serta menginstal sertifikat
This document discusses techniques for discovering hostnames and virtual hosts through DNS enumeration, service fingerprints, application layers, and passive methods. It lists tools that can be used for reconnaissance like DNSenum, DNSrecon, Maltego, Nmap, and TheHarvester. The document provides examples of hostname discovery through DNS records, SSL certificates, HTTP response banners, redirects, and public data sources.
This document summarizes the benefits and implementation of virtual server design at DHMC. It discusses how virtual servers provide better hardware utilization, reduced physical infrastructure needs, and cost savings compared to traditional physical servers. Specific servers proposed for virtualization are listed. Backup strategies and the costs savings from virtualizing are also summarized.
The document discusses configuring web servers like Apache and IIS. It explains how web servers work using HTTP, and how to host multiple websites using port numbers, IP addresses, or host names. Virtual directories are also configured to make directories appear below the root even if they are physically located elsewhere.
This document contains the resume of Abhilash Bhaskaran. He has over 3 years of experience as an EMC Networker and Avamar Administrator. He is proficient in technologies like Networker, Avamar, Data Domain, Commvault, and Data Protection Advisor. He is currently working as an Associate Delivery Specialist for EMC Data Storage Systems India, where he provides support and manages the backup infrastructure for banking clients.
Satyanarayan Sahu has over 5 years of experience administering WebSphere Application Server. He has expertise installing, configuring, and deploying applications on WebSphere across AIX, Linux, and Windows environments. He is proficient in automation tools like Urban Code Deployment and scripting with wsadmin, Jython, and shell scripts. Currently he works as a Senior Software Engineer for IBM India, where he supports mission critical applications and handles production issues.
The document discusses the Domain Name System (DNS) which maps domain names to IP addresses. DNS uses a client-server model where clients (resolvers) query name servers to lookup addresses. It describes the hierarchical namespace structure and how names are organized into domains with labels separated by dots. Resource records containing domain, type, class and data are stored in distributed databases to map names and addresses. Caching improves performance by storing recent lookups.
The document discusses configuring web servers like Apache and IIS. It explains how web servers work using HTTP, and how to host multiple websites using port numbers, IP addresses, or host names. Virtual directories are also configured to make directories appear below the root even if they are physically located elsewhere.
The document discusses configuring web servers like Apache and IIS. It explains how web servers work using HTTP, and how to host multiple websites using port numbers, IP addresses, or host names. Virtual directories are also configured to make directories appear below the root even if they are physically located elsewhere.
This document provides information on setting up an Apache web server and Squid proxy server on Linux. It discusses installing and configuring Apache, including the configuration file location and directives. It also covers installing Squid from source or binaries, editing the Squid configuration file to set the cache size and location, enable authentication, and restrict access. Virtual hosting with Apache and example Squid configuration options are also summarized.
The document provides an overview of Apache server configuration and optimization topics including Apache configuration files, core Apache configuration directives, virtual hosts, error handling, and important Apache modules. It describes where configuration files are located, examples of common directives like ServerName and DocumentRoot, how to set up virtual hosts, use ErrorDocument to define custom error pages, and explains modules like mod_rewrite, mod_proxy, and mod_evasive.
This document summarizes an instructor-led discussion on advanced Apache topics including virtual hosting, setting up name-based and IP-based virtual hosts, enabling server-side includes, and enabling CGI (Common Gateway Interface) scripts. Key points covered include configuring Apache for virtual hosting using the VirtualHost directive, enabling CGI scripts through ScriptAlias, Options ExecCGI, and AddHandler directives, and examples of simple CGI scripts.
The document discusses configuration of the Apache HTTP server. It describes how to start, stop and restart the server using the /sbin/service command. It explains how to configure the server by editing the main configuration file httpd.conf located at /etc/httpd/conf/httpd.conf. The document also discusses setting the default document root directory for web pages, setting file permissions, and describes several important configuration directives that can be set in the httpd.conf file to configure the server's listening ports, directories, users and other settings.
Apache is the most popular web server software. It responds to requests from web browsers using TCP ports 80 and 443. To set up Apache, install the httpd package and related packages, open the necessary ports in the firewall, configure the httpd.conf file, and start the httpd service. Apache serves files from the document root directory, which is /var/www/html by default. It can also host multiple virtual websites on one server using virtual hosts.
Virtual Hosts Configuration with Weblogic ServerPawan Kumar
Virtual hosting in Weblogic Server allows mapping host names to the IP address of a server or cluster. This hides the server IP addresses from clients and allows applications to be targeted to a virtual host rather than an individual server. The steps to configure a virtual host include creating a network channel, defining the virtual host in the Weblogic console, targeting applications to the virtual host, and modifying host files to map the virtual host name to the server IP address.
A web server is software that responds to requests from web browsers to serve web pages. It is part of a multi-tier architecture with an information tier (database), middle tier (application logic), and client tier (user interface). The most common protocol for communication between clients and servers is HTTP, with the server responding to GET and POST requests with web pages or other responses. Popular web server software includes Apache, IIS, and Tomcat.
This document provides instructions for configuring a web server. It discusses setting up an Apache web server on port 80, editing the httpd.conf file, creating a DNS entry, editing the index.html file, enabling and restarting the httpd service, and checking the web server. It also covers setting up name-based virtual hosting with multiple domains on one IP, and securing the server with HTTPS on port 443 by installing mod_ssl packages and editing the ssl.conf file.
This document provides an overview of internet engineering and web servers. It begins with an introduction to why companies need web services like hosting applications and websites. It then discusses the history and development of the World Wide Web and how it has grown. The document defines web servers and common features like handling HTTP requests. It covers specifics of HTTP 1.1 servers and the first web server. It also discusses the most popular web servers today like Apache and provides statistics on their usage. Finally, it provides a detailed overview of Apache web server features and functions such as caching, access control, and virtual hosting.
WP Sandbox Presentation WordCamp Toronto 2011Alfred Ayache
This document provides instructions for setting up a local development environment or "sandbox" for testing and developing WordPress websites using XAMPP on Windows and OSX systems. Key steps include downloading and installing XAMPP, which bundles Apache, PHP and MySQL. Once installed, WordPress can be downloaded, unzipped in the XAMPP folder, and accessed at localhost. Virtual hosts allow hosting multiple sites on the same machine for development. Best practices include keeping the sandbox similar to production servers and taking regular backups.
This document contains answers to configuration questions regarding Apache virtual hosting, custom error pages, default pages, access logging, and SSL/HTTPS configuration. It includes configuration snippets and screenshots demonstrating:
1) Setting up name-based virtual hosting with two domains sharing the same content directory and custom error and access logs.
2) Custom 404 error page and screenshots of domain requests returning the default and custom 404 page.
3) Default page configuration and screenshot of IP address request returning the default page.
4) New access log format definition and sample log with the customized fields.
5) SSL/HTTPS configuration using OpenSSL, including generating certificates and configuring Apache to listen on port 443 to serve pages securely.
The document discusses configuring Apache web server to use HTTPS (HTTP Secure) on Linux. It involves installing Apache, creating a virtual host configuration file for HTTPS that listens on port 443, enabling the SSL and HTTPS modules, generating an SSL certificate, and restarting Apache to enable secure communication over port 443 using HTTPS.
The document provides instructions on installing and configuring the Apache web server on Linux. It discusses downloading and unpacking the Apache files, editing the configuration files, starting the httpd daemon, and testing the server. It also covers setting up virtual hosts to serve multiple domains from a single server and some key configuration directives.
The document discusses the need for web servers to provide various web services for a company. It provides an overview of the history and development of the World Wide Web and web servers. It then describes key features and functions of the Apache web server, including caching, logging, mapping URLs to files, access control, server-side includes, and virtual hosting.
Come learn about of the flagship features of CommandBox Pro. CommandBox Multi-site allows you to completely replace your web server with CommandBox, hosting multiple websites all in a single process. Each site has its own web root, rewrites, logs, configuration, and HTTP bindings! This is a major new enhancement to CommandBox servers and finally bring CommandBox on par with other web servers and allows you to simplify your entire tech stack down to a single moving part for deployment.
This document provides an overview and summary of Apache 2.2 configuration including:
1) Apache release statuses and where development is focused;
2) Common configuration directives like Listen, DocumentRoot, and VirtualHosts;
3) Tips for modularizing configuration using Include directives and separating into files.
The document discusses configuration of the Apache 2.2 web server. It covers the status of Apache versions, multi-processing modules, common configuration directives, tips for authentication and authorization, and new features in Apache 2.3.
This document provides an overview and summary of Apache 2.2 configuration including:
1) Apache release statuses and where development is focused;
2) Common configuration directives like Listen, DocumentRoot, and VirtualHosts;
3) Tips for modularizing configuration using Include directives and separating into files.
Similar to Virtual host examples_-_apache_http_server (20)
Tom was tasked with isolating communication between the technical and financial departments on the same floor. He considered using different IP subnets but the manager explained this could allow unauthorized access. The manager suggested using VLANs, which Tom learned:
1) Logically separate networks on a switch using VLAN IDs and allow communication within but not between VLANs.
2) He configured ports for each department into different VLANs, blocking inter-department communication while allowing intra-department communication.
3) He verified the VLAN configuration was working properly using commands to display VLAN mappings and the MAC address table.
The document discusses configuring port aggregation on a network device. It describes establishing a logical port using the interface port-aggregator command before aggregating physical ports to it using the aggregator-group command. It also covers using static or LACP aggregation modes and choosing a load balancing method like src-mac to distribute traffic across the aggregated ports. Supervising and controlling the port aggregation process is also mentioned.
11 mac address table characteristic configurationHARRY CHAN PUTRA
The document discusses installing and managing MAC address tables on a network switch. It describes how to install static MAC addresses, set the aging time for dynamic addresses, show the MAC address table contents, and clear dynamic addresses from the table. Commands are provided for adding and deleting static addresses, setting the aging time from 0 to 1000000 seconds, displaying the dynamic, static, or full address table, and clearing individual dynamic addresses or all addresses on a port or VLAN.
05 interface appended characteristic configurationHARRY CHAN PUTRA
The document discusses configuring port rate limits on a switch to restrict the discharge velocity of ports. It describes using commands like "configure", "interface", and "switchport rate-limit band" in different modes to set a bandwidth limit on ingress or egress traffic for a port. Bandwidths of 1Gbps, 100Mbps, and 10Mbps are given as examples for negotiating port time.
The document provides instructions for installing the BDCOM S2508B hardware switch. It includes:
- An overview of the standard configuration which includes 8 1000Mbps Ethernet RJ45 ports, 2 1000Mbps SFP ports, and 1 console port.
- Safety guidelines for installation including electrostatic discharge prevention and environmental requirements.
- Step-by-step instructions for installing the machine box on a desk or cabinet and connecting the console, SFP, and Ethernet ports.
- Procedures for checking the installation, opening/closing the machine box, upgrading memory, and analyzing hardware faults.
Dr. Peter Welcher presented on MPLS VPNs. The key points covered included:
1) MPLS VPNs allow enterprises to connect sites securely over a shared infrastructure at a lower cost than private networks.
2) MPLS VPNs use BGP and MPLS to separate routing between customers while leveraging the service provider's existing infrastructure.
3) Packets are forwarded through the MPLS network using label switching without examining the IP header, providing security and isolation between customer networks.
The document describes how to configure IP filtering rules on a Vigor 3300 router to control network traffic. Several examples are provided that show how to create rules to allow or block traffic between LAN, WAN, DMZ and VPN interfaces based on IP address, port and protocol. Directions that can be configured include LAN to WAN, WAN to LAN, LAN to DMZ and more. Screenshots of the web configuration interface illustrate the process of enabling IP filtering and adding allow and block rules.
1. The document provides instructions for configuring inband and outband network administration (NA) on a ZXDSL 9210 device. This includes setting IP addresses, routes, VLANs, SNMP settings, and testing the connection.
2. It also describes how to configure basic Ethernet and ADSL user services on the device by adding user ports to VLANs, setting PVIDs, and optionally creating line and alarm profiles.
3. The configuration is saved before testing the network connectivity with ping commands.
The document provides instructions for configuring and commissioning the ZXDSL 9210 network element. It includes steps for logging in, erasing configurations, rebooting, changing MAC addresses, configuring card types, enabling private VLAN mode, adding VLANs and IP addresses, creating ADSL profiles, applying profiles to ports, configuring SNMP, and enabling spanning tree protocol on uplink ports. Special attention is required when using commands that reboot the system or erase configurations.
The document discusses setting up a FreeBSD router to act as a captive portal, wireless router, and firewall. It provides recommended hardware, installation instructions, and steps to configure the wireless card and set up the captive portal. The router allows administering a UNIX system with practical applications while continuing to learn.
This document provides an overview and instructions for setting up the pfSense firewall software on Hacom hardware. It includes sections on introduction, setup and configuration, web administration, backup and restore, firmware updates, and maximum firewall states. The setup and configuration section describes connecting the firewall to the local network and internet, accessing the web-based administration interface, and going through an initial setup wizard to configure basic network and system settings.
PfSense is an open source firewall software that provides features similar to commercial firewalls. It can be installed on Hacom hardware, which typically have Realtek or Intel network interfaces. To set up PfSense, connect a monitor and keyboard during initial boot up to configure the network interfaces. The web administration interface can then be accessed through the LAN IP address. Firmware updates are also described. Technical support is available from Hacom.
The document provides an overview of pfSense, an open source firewall and routing platform based on FreeBSD. It discusses the history and evolution of pfSense, hardware requirements, common deployment scenarios, and key features such as firewall rules, NAT, VPNs, traffic shaping, wireless access points, and high availability using CARP. The document also advertises a live demo of pfSense installation and configuration.
Modul ini memberikan panduan lengkap untuk instalasi Linux Nusantara, meliputi persiapan perangkat keras dan partisi, proses instalasi, dan konfigurasi boot loader.
Modul ini membahas langkah-langkah instalasi distro Linux Nusantara, meliputi persiapan perangkat keras dan partisi hard disk, proses instalasi, dan pengaturan password administrator."
Dokumen ini menjelaskan cara membuat dan mendistribusikan basis data perpustakaan SLIMS menggunakan aplikasi Server2Go untuk dijalankan dari CD atau DVD. Langkah-langkahnya adalah menginstal Server2Go, menyalin basis data dan folder SLIMS, mengkonfigurasi pengaturan database, dan membakar file ke CD/DVD untuk dijalankan pada sistem lain tanpa instalasi.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
1. VirtualHost Examples - Apache HTTP Server Page 1
Apache HTTP Server Version 2.2
VirtualHost Examples
This document attempts to answer the commonly -asked questions about setting up virtual hosts. These scenarios
are those involving multiple web sites running on a single server, via name-based ( name-based.html) or IP-
based ( ip-based.html) virtual hosts.
Running several name-based web sites on a single IP address.
Name-based hosts on more than one IP address.
Serving the same content on different IP addresses (such as an internal and external address).
Running different sites on different ports.
IP-based virtual hosting
Mixed port-based and ip-based virtual hosts
Mixed name-based and IP-based vhosts
Using Virtual_host and mod_proxy together
Using _default_ vhosts
Migrating a name-based vhost to an IP-based vhost
Using the ServerPath directive
Running several name-based web sites on a single IP address.
Your server has a single IP address, and multiple aliases (CNAMES) point to this machine in DNS. You want
to run a web server for www.example.com and www.example.org on this machine.
Note
Creating virtual host configurations on your Apache server does not magically cause DNS entries to be
created for those host names. You must have the names in DNS, resolving to your IP address, or
nobody else will be able to see your web site. You can put entries in your hosts file for local testing,
but that will work only from the machine with those hosts entries.
Server configuration
# Ensure that Apache listens on port 80
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www/example 1
ServerName www.example .com
# Other directives here
</VirtualHost >
<VirtualHost *:80>
DocumentRoot /www/example 2
ServerName www.example .org
# Other directives here
</VirtualHost >
The asterisks match all addresses, so the main server serves no requests. Due to the fact that
www.example.com is first in the configuration file, it has the highest priority and can be seen as the default
http://httpd.apache.org/docs/2.2/vhosts/examples.html 24/12/2007 00:38:16
2. VirtualHost Examples - Apache HTTP Server Page 2
or primary server. That means that if a request is received that does not match one of the specified
ServerName directives, it will be served by this first VirtualHost.
Note
You can, if you wish, replace * with the actual IP address of the system. In that case, the argument to
VirtualHost must match the argument to NameVirtualHost:
NameVirtualHost 172.20.30.40
<VirtualHost 172.20.30.40>
# etc ...
However, it is additionally useful to use * on systems where the IP address is not predictable - for
example if you have a dynamic IP address with your ISP, and you are using some variety of dynamic
DNS solution. Since * matches any IP address, this configuration would work without changes
whenever your IP address changes.
The above configuration is what you will want to use in almost all name-based virtual hosting situations. The
only thing that this configuration will not work for, in fact, is when you are serving different content based on
differing IP addresses or ports.
Name-based hosts on more than one IP address.
Note
Any of the techniques discussed here can be extended to any number of IP addresses.
The server has two IP addresses. On one (172.20.30.40), we will serve the "main" server,
server.domain.com and on the other (172.20.30.50), we will serve two or more virtual hosts.
Server configuration
Listen 80
# This is the "main" server running on 172.20.30.40
ServerName server.domain.com
DocumentRoot /www/mainserver
# This is the other address
NameVirtualHost 172.20.30.50
<VirtualHost 172.20.30.50>
DocumentRoot /www/example 1
ServerName www.example .com
# Other directives here ...
</VirtualHost >
<VirtualHost 172.20.30.50>
DocumentRoot /www/example 2
ServerName www.example .org
# Other directives here ...
</VirtualHost >
Any request to an address other than 172.20.30.50 will be served from the main server. A request to
172.20.30.50 with an unknown hostname, or no Host: header, will be served from
www.example.com.
http://httpd.apache.org/docs/2.2/vhosts/examples.html 24/12/2007 00:38:16
3. VirtualHost Examples - Apache HTTP Server Page 3
Serving the same content on different IP addresses (such as
an internal and external address).
The server machine has two IP addresses (192.168.1.1 and 172.20.30.40). The machine is sitting
between an internal (intranet) network and an external (internet) network. Outside of the network, the name
server.example.com resolves to the external address (172.20.30.40), but inside the network, that
same name resolves to the internal address (192.168.1.1).
The server can be made to respond to internal and external requests with the same content, with just one
VirtualHost section.
Server configuration
NameVirtualHost 192.168.1.1
NameVirtualHost 172.20.30.40
<VirtualHost 192.168.1.1 172.20.30.40>
DocumentRoot /www/server1
ServerName server.example .com
ServerAlias server
</VirtualHost >
Now requests from both networks will be served from the same VirtualHost.
Note:
On the internal network, one can just use the name server rather than the fully qualified host name
server.example.com.
Note also that, in the above example, you can replace the list of IP addresses with *, which will cause
the server to respond the same on all addresses.
Running different sites on different ports.
You have multiple domains going to the same IP and also want to serve multiple ports. By defining the ports in
the "NameVirtualHost" tag, you can allow this to work. If you try using <VirtualHost name:port> without the
NameVirtualHost name:port or you try to use the Listen directive, your configuration will not work.
Server configuration
Listen 80
Listen 8080
NameVirtualHost 172.20.30.40:80
NameVirtualHost 172.20.30.40:8080
<VirtualHost 172.20.30.40:80>
ServerName www.example .com
DocumentRoot /www/domain-80
</VirtualHost >
<VirtualHost 172.20.30.40:8080>
ServerName www.example .com
DocumentRoot /www/domain-8080
</VirtualHost >
<VirtualHost 172.20.30.40:80>
ServerName www.example .org
DocumentRoot /www/otherdomain -80
</VirtualHost >
<VirtualHost 172.20.30.40:8080>
ServerName www.example .org
DocumentRoot /www/otherdomain -8080
http://httpd.apache.org/docs/2.2/vhosts/examples.html 24/12/2007 00:38:16
4. VirtualHost Examples - Apache HTTP Server Page 4
</VirtualHost >
IP-based virtual hosting
The server has two IP addresses (172.20.30.40 and 172.20.30.50) which resolve to the names
www.example.com and www.example.org respectively.
Server configuration
Listen 80
<VirtualHost 172.20.30.40>
DocumentRoot /www/example 1
ServerName www.example .com
</VirtualHost >
<VirtualHost 172.20.30.50>
DocumentRoot /www/example 2
ServerName www.example .org
</VirtualHost >
Requests for any address not specified in one of the <VirtualHost> directives (such as localhost, for
example) will go to the main server, if there is one.
Mixed port-based and ip-based virtual hosts
The server machine has two IP addresses (172.20.30.40 and 172.20.30.50) which resolve to the
names www.example.com and www.example.org respectively. In each case, we want to run hosts on
ports 80 and 8080.
Server configuration
Listen 172.20.30.40:80
Listen 172.20.30.40:8080
Listen 172.20.30.50:80
Listen 172.20.30.50:8080
<VirtualHost 172.20.30.40:80>
DocumentRoot /www/example 1-80
ServerName www.example .com
</VirtualHost >
<VirtualHost 172.20.30.40:8080>
DocumentRoot /www/example 1-8080
ServerName www.example .com
</VirtualHost >
<VirtualHost 172.20.30.50:80>
DocumentRoot /www/example 2-80
ServerName www.example .org
</VirtualHost >
<VirtualHost 172.20.30.50:8080>
DocumentRoot /www/example 2-8080
ServerName www.example .org
</VirtualHost >
Mixed name-based and IP-based vhosts
On some of my addresses, I want to do name-based virtual hosts, and on others, IP-based hosts.
Server configuration
http://httpd.apache.org/docs/2.2/vhosts/examples.html 24/12/2007 00:38:16
5. VirtualHost Examples - Apache HTTP Server Page 5
Listen 80
NameVirtualHost 172.20.30.40
<VirtualHost 172.20.30.40>
DocumentRoot /www/example 1
ServerName www.example .com
</VirtualHost >
<VirtualHost 172.20.30.40>
DocumentRoot /www/example 2
ServerName www.example .org
</VirtualHost >
<VirtualHost 172.20.30.40>
DocumentRoot /www/example 3
ServerName www.example 3.net
</VirtualHost >
# IP-based
<VirtualHost 172.20.30.50>
DocumentRoot /www/example 4
ServerName www.example 4.edu
</VirtualHost >
<VirtualHost 172.20.30.60>
DocumentRoot /www/example 5
ServerName www.example 5.gov
</VirtualHost >
Using Virtual_host and mod_proxy together
The following example allows a front-end machine to proxy a virtual host through to a server running on
another machine. In the example, a virtual host of the same name is configured on a machine at
192.168.111.2. The ProxyPreserveHost On directive is used so that the desired hostname is passed
through, in case we are proxying multiple hostnames to a single machine.
<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://192.168.111.2
ProxyPassReverse / http://192.168.111.2/
ServerName hostname .example .com
</VirtualHost >
Using _default_ vhosts
_default_ vhosts for all ports
Catching every request to any unspecified IP address and port, i.e. , an address/port combination that is not
used for any other virtual host.
Server configuration
<VirtualHost _default _:*>
DocumentRoot /www/default
</VirtualHost >
Using such a default vhost with a wildcard port effectively prevents any request going to the main server.
A default vhost never serves a request that was sent to an address/port that is used for name-based vhosts. If
the request contained an unknown or no Host: header it is always served from the primary name-based vhost
(the vhost for that address/port appearing first in the configuration file).
http://httpd.apache.org/docs/2.2/vhosts/examples.html 24/12/2007 00:38:16
6. VirtualHost Examples - Apache HTTP Server Page 6
You can use AliasMatch or RewriteRule to rewrite any request to a single information page (or script).
_default_ vhosts for different ports
Same as setup 1, but the server listens on several ports and we want to use a second _default_ vhost for
port 80.
Server configuration
<VirtualHost _default _:80>
DocumentRoot /www/default 80
# ...
</VirtualHost >
<VirtualHost _default _:*>
DocumentRoot /www/default
# ...
</VirtualHost >
The default vhost for port 80 (which must appear before any default vhost with a wildcard port) catches all
requests that were sent to an unspecified IP address. The main server is never used to serve a request.
_default_ vhosts for one port
We want to have a default vhost for port 80, but no other default vhosts.
Server configuration
<VirtualHost _default _:80>
DocumentRoot /www/default
...
</VirtualHost >
A request to an unspecified address on port 80 is served from the default vhost. Any other request to an
unspecified address and port is served from the main server.
Migrating a name-based vhost to an IP-based vhost
The name-based vhost with the hostname www.example.org (from our name-based ( #name) example,
setup 2) should get its own IP address. To avoid problems with name servers or proxies who cached the old IP
address for the name-based vhost we want to provide both variants during a migration phase.
The solution is easy, because we can simply add the new IP address (172.20.30.50) to the
VirtualHost directive.
Server configuration
Listen 80
ServerName www.example .com
DocumentRoot /www/example 1
NameVirtualHost 172.20.30.40
<VirtualHost 172.20.30.40 172.20.30.50>
DocumentRoot /www/example 2
ServerName www.example .org
# ...
</VirtualHost >
<VirtualHost 172.20.30.40>
DocumentRoot /www/example 3
ServerName www.example .net
ServerAlias *.example .net
# ...
http://httpd.apache.org/docs/2.2/vhosts/examples.html 24/12/2007 00:38:16
7. VirtualHost Examples - Apache HTTP Server Page 7
</VirtualHost >
The vhost can now be accessed through the new address (as an IP-based vhost) and through the old address (as
a name-based vhost).
Using the ServerPath directive
We have a server with two name-based vhosts. In order to match the correct virtual host a client must send the
correct Host: header. Old HTTP/1.0 clients do not send such a header and Apache has no clue what vhost the
client tried to reach (and serves the request from the primary vhost). To provide as much backward
compatibility as possible we create a primary vhost which returns a single page containing links with an URL
prefix to the name-based virtual hosts.
Server configuration
NameVirtualHost 172.20.30.40
<VirtualHost 172.20.30.40>
# primary vhost
DocumentRoot /www/subdomain
RewriteEngine On
RewriteRule ^/.* /www/subdomain/index.html
# ...
</VirtualHost >
<VirtualHost 172.20.30.40>
DocumentRoot /www/subdomain/sub1
ServerName www.sub1.domain.tld
ServerPath /sub1/
RewriteEngine On
RewriteRule ^(/sub1/.*) /www/subdomain$1
# ...
</VirtualHost >
<VirtualHost 172.20.30.40>
DocumentRoot /www/subdomain/sub2
ServerName www.sub2.domain.tld
ServerPath /sub2/
RewriteEngine On
RewriteRule ^(/sub2/.*) /www/subdomain$1
# ...
</VirtualHost >
Due to the ServerPath directive a request to the URL http://www.sub1.domain.tld/sub1/ is
always served from the sub1-vhost.
A request to the URL http://www.sub1.domain.tld/ is only served from the sub1-vhost if the client
sent a correct Host: header. If no Host: header is sent the client gets the information page from the primary
host.
Please note that there is one oddity: A request to http://www.sub2.domain.tld/sub1/ is also served
from the sub1-vhost if the client sent no Host: header.
The RewriteRule directives are used to make sure that a client which sent a correct Host: header can use
both URL variants, i.e. , with or without URL prefix.
Copyright 2007 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0.
http://httpd.apache.org/docs/2.2/vhosts/examples.html 24/12/2007 00:38:16