background preloader

VirtualHost Examples

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 or IP-based virtual hosts. Running several name-based web sites on a single IP address. Your server has multiple hostnames that resolve to a single address, and you want to respond differently for www.example.com and www.example.org. Note Creating virtual host configurations on your Apache server does not magically cause DNS entries to be created for those host names. # Ensure that Apache listens on port 80Listen 80<VirtualHost *:80> DocumentRoot "/www/example1" ServerName www.example.com # Other directives here</VirtualHost><VirtualHost *:80> DocumentRoot "/www/example2" ServerName www.example.org # Other directives here</VirtualHost> The asterisks match all addresses, so the main server serves no requests. You may replace * with a specific IP address on the system. The server has two IP addresses. Related:  ProgrammingStuff

Hosting multiple websites with Apache2 Posted by Steve on Thu 6 Jul 2006 at 22:03 One of the most common Apache2 questions I've seen on Debian mailing lists is from users who wonder how to host multiple websites with a single server. This is very straightforward, especially with the additional tools the Debian package provides. We've previously discussed some of the tools which are included in the Apache2 package , but what we didn't do was show they're used from start to finish. There are many different ways you can configure Apache to host multiple sites, ranging from the simple to the complex. Here we're only going to cover the basics with the use of the NameVirtualHost directive. For example if you have an Apache server running upon the IP address 192.168.1.1 and you wish to host the three sites example.com , example.net , and example.org you'll need to make sure that these names resolve to the IP address of your server. (This might mean that you need example.com and www.example.com to resolve to the same address.

Configurer les virtualhost d'apache2 Par Olivier Lange () Configurer les virtualhost d'apache2 pour permettre a plusieurs URL de pointer sur le meme serveur, et donc de disposer de plusieurs sites disponibles. I. Pré-requisII. Configuration d'apache2.confIII. Une fois que le serveur est installé de base, nous allons créer et configurer nos espaces d'hébergements. Vous désirez pouvoir accéder a vos sites par ip_du_server/~nom_user Vous n'avez qu'une seule IP pour tout vos sites Vous allez configurer BIND (voir tuto un peu plus loin) Dans cette première partie, nous allons modifier 1 fichier: /etc/apache2/apache2.conf, et créer des fichiers dans les répertoires /etc/apache2/sites-available et /etc/apache2/sites-enabled. ON édite le fichier de configuration principal d'apache2 On vérifie les utilisateurs et groupe d'apache (autour de la ligne 100 environ) On modifie les fichiers qu'on désirent par défaut (ligne 210 environ. On sauve les modifs, et on ferme le fichier. On va maintenant créer nos hôtes virtuels. On redémare apache2

Setting a Static IP It is very important to setup a static ip address, if you are going to use port forwarding. When you have port forwarding setup, your router forwards ports to an ip address that you specify. This will probably work when you initially set it up, but after restarting your computer it may get a different ip address. When this happens the ports will no longer be forwarded to your computer's ip address. So the port forwarding configuration will not work. What is an ip address? Dynamic vs Static IPs Most routers assign dynamic IP addresses by default. Setting up a static ip for Windows 7. If you have a printer, before you begin print out this page! Step 2: Type cmd in the Search programs and files box, and press Enter on your keyboard. Step 3: The command prompt may look different on your screen, but it doesn't really matter. Step 4: I want you to write down some of the information in this window. The name server entries are a bit complicated. Step 5: Once again open the start menu.

How To Set Up Apache Virtual Hosts on Debian 7 What the Red Means The lines that the user needs to enter or customize will be in red in this tutorial! The rest should mostly be copy-and-pastable. Virtual Hosts Virtual Hosts are used to run more than one domain off of a single IP address. Set Up The steps in this tutorial require the user to have root privileges. Additionally, you need to have apache already installed and running on your virtual server. sudo apt-get install apache2 Step One— Create a New Directory First, it is necessary to create a directory where we will keep the new website’s information. You will need to designate an actual DNS approved domain (or an IP address) to test that a virtual host is working. sudo mkdir -p /var/www/example.com/public_html *If you want to use an unapproved domain name to test the process, you will find information on how to make it work on your local computer in Step Seven. Step Two—Grant Permissions sudo chown -R $USER:$USER /var/www/example.com/public_html sudo chmod -R 755 /var/www Save & Exit.

Name-based Virtual Host Support This document describes when and how to use name-based virtual hosts. Name-based vs. IP-based Virtual Hosts IP-based virtual hosts use the IP address of the connection to determine the correct virtual host to serve. Therefore you need to have a separate IP address for each host. With name-based virtual hosting, the server relies on the client to report the hostname as part of the HTTP headers. Name-based virtual hosting is usually simpler, since you need only configure your DNS server to map each hostname to the correct IP address and then configure the Apache HTTP Server to recognize the different hostnames. Name-based virtual hosting builds off of the IP-based virtual host selection algorithm, meaning that searches for the proper server name occur only between virtual hosts that have the best IP-based address. How the server selects the proper name-based virtual host It is important to recognize that the first step in name-based virtual host resolution is IP-based resolution.

tutoriel:virtualhosts_avec_apache2 Introduction Le Serveur Web Apache2 est capable de gérer simultanément plusieurs arborescences Web grâce à la notion d'hôtes Virtuels (Virtual Hosts). Nous allons voir les différentes méthodes pour les mettre en place. Il est important de savoir que si vous avez déjà un serveur en activité, ce serveur doit lui aussi être configuré dans les hôtes virtuels ! Dans ce cas, vous voudrez sûrement le mettre en serveur "par défaut", répondant à toutes les requêtes, SAUF celles qui correspondront à vos autres serveurs virtuels. Nous renseignons le fichier /etc/hosts afin d'assurer la résolution de nom (Nom –> Adresse Ip) des hôtes Virtuels que nous allons créer. Si vous désirez tester toutes les méthodes proposées, pensez à effacer la configuration précédente pour ne pas créer des conflits entre les hôtes Virtuels. Hôtes virtuels basés sur le nom Cette méthode est la plus utilisée et la plus conseillée. Attention, il faut également déclarer ces 2 sites dans le fichier /etc/hosts AllowOverride None

IP Subnetting This page will give you a basic understanding of the structure of IP addresses and subnets at Cornell. What Are IP Addresses and How Are They Used? IP (Internet Protocol) addresses are used to identify hosts on the campus network that in turn ties into the Internet, a global network. A networked computer must have an IP address assigned to the computer to be recognized as part of the network. IP addresses are constructed according to a set of specific rules so that hosts on any part of the Internet can communicate with each other. An IP address consists of a 32-bit binary number, which is typically presented as four decimal numbers (one for each 8-bit byte) separated by decimal points. Internet addresses at Cornell have three parts: Network Address Cornell has several addresses for its backbone networks. Subnet Address The subnet address is the address given to your Local Area Network (LAN). Host Address IP Addressing Space How Does Subnetting Work? Together they look like this:

Using Docker to host this WordPress blog | Intercity Blog We use a tool called Docker to host this blog on a DigitalOcean server. Docker allows you to run processes on your server that are included in a pre-built image. It runs these programs in a contained environment, with no danger of harming other processes and files. We used a pre-built WordPress image for Docker to install this blog. Here is how that works: Installing Docker on a Digital Ocean server First, I created a machine at Digital Ocean and installed it with the standard Ubuntu 12.04.3 LTS x64 image. Then, I installed Docker by following the instructions in the Docker documentation at : # install the backported kernel $ sudo apt-get update $ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring # reboot $ sudo reboot $ curl -s | sudo sh This installs the Docker software. Installing and running WordPress from a Docker image

patricio gomez » Blog Archive » Configurando django y apache con mod_wsgi en ubuntu Esta es una receta sencilla de cómo configurar desplegar aplicaciones django en apache usando mod_wsgi, ya que mod_python está desaconsejado y en versiones próximas de django no va a estar soportado. Ahora vamos a hacer dos configuraciones, una simplemente para ver que ande mod_wsgi y la otra para que haga andar nuestro proyecto. Creamos un servidor de prueba Empezamos con la configuración para verificar que esté andando mod_wsgi. Comenzamos instalando mod-wsgi para apahce. patricio@plg:~$ sudo apt-get install libapache2-mod-wsgi Creamos el directorio donde alojar el proyecto de pruebas /home/patricio/dev/django/test/ En ese directorio creamos el archivo app.wsgi con la respuesta http para probar que funciona el mod_wsgi def application(environ, start_response): status = '200 OK' output = 'Hello World!' Editamos el arcivo /etc/hosts para que resuelva nuestra petición agregando estas líneas 127.0.1.1 djangoserver 127.0.1.1 test.djangoserver Ahora creamos un host virtual llamado test-wsgi:

Conception détaillée d'hôtes virtuels sous Apache L'hébergement virtuel (virtual hosting) est le fait de servir plusieurs sites web sur une même instance de serveur. Ainsi, une machine serveur possède un et un seul serveur Apache et elle pourra servir (virtuellement) une infinité de sites qui n'ont aucunement besoin de "se connaître" l'un l'autre. La flexibilité d'Apache fait que chaque site pourra être configuré de manière très différente de son voisin. L'hébergement virtuel est très utilisé chez les hébergeurs proposant des serveurs dits "mutualisés". Mais, comment héberge-t-on plusieurs applications webs sur un seul serveur Apache ? Nous allons détailler le processus de routage des hôtes virtuels d'Apache, de manière claire afin qu'aucune confusion ne puisse être faite. Dans cet article, nous parlons hôtes virtuels et nous supposons que vous savez déjà configurer un serveur Apache de manière fonctionnelle. Apache utilise des sockets TCP pour servir ses requêtes. httpd.conf, directive Listen Sélectionnez Prenons un exemple simple.

How TCP/IP Works When transmitting data, the Transport layer gets data from the Application layer and divides them into several data packets. TCP (Transmission Control Protocol) is the most used protocol on the Transport layer. When receiving data, TCP protocol gets the packets sent by the Internet layer and put them in order, because packets can arrive at the destination out-of-order, and also checks if the contents of the received packet are intact and sends an acknowledge signal to the transmitter, allowing it to know that the packet arrived intact at destination. If no acknowledge signal is received (either because it didn’t arrive the destination or because TCP found out that data was corrupted), the transmitter will re-send the lost packet. While TCP re-orders packets and also uses this acknowledge system we mention, which is desirable when transmitting data, there is another protocol that works on this layer that does not have these two features.

Related: