Jump to content

[SOLVED] How does Apache know what site to host?


phpfanphp

Recommended Posts

sorry made a big error there the last post was to goto another webserver

    Port 80

    ServerName server.domain.tld

 

    NameVirtualHost 111.22.33.44

 

    <VirtualHost 111.22.33.44>

    DocumentRoot /www/domain

    ServerName www.domain.tld

    ...

    </VirtualHost>

   

    <VirtualHost 111.22.33.44>

    DocumentRoot /www/subdomain

    ServerName www.sub.domain.tld

    ...

    </VirtualHost>

 

link

http://httpd.apache.org/docs/1.3/vhosts/examples.html

 

Link to comment
Share on other sites

 

 

see this please read you got google.

 

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/example1

ServerName www.example1.com

 

# Other directives here

 

 

</VirtualHost>

 

<VirtualHost *:80>

 

DocumentRoot /www/example2

ServerName www.example2.org

 

# Other directives here

 

 

</VirtualHost>

 

Link to comment
Share on other sites

 

do i need to goto the server and copy mine?

 

made it even easer now

 

# Listen for virtual host requests on all IP addresses

NameVirtualHost *:80

 

<VirtualHost *:80>

 

 

// this is where the web files are sitting.

 

DocumentRoot /www/example1

 

//this is your www. name

ServerName  htpp://example1.com

 

# Other directives here

 

 

</VirtualHost>

 

<VirtualHost *:80>

 

// this is where the web files are sitting.

 

DocumentRoot /www/example2

 

//this is your www. Name

 

ServerName http://example2.org

 

# Other directives here

 

 

</VirtualHost>

 

Link to comment
Share on other sites

here u go fully tested configuration for free domain setup.

 

 

you dont add silly programs to goto files use the correct way or no way.

 

all the best redarrow

 

 

in apache config page

 

unmark these

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_http_module modules/mod_proxy_http.so

 

 

add this to your page at the bottom

 

NameVirtualHost *:80

 

#

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

#

<VirtualHost *:80>

ServerName  my_free_domain.com

DocumentRoot "C:\Program Files\Apache Group\Apache2\web_site_1"

</VirtualHost>

 

<VirtualHost *:80>

ServerName   my_free_domain.com

DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\web_site_2"

</VirtualHost>

 

<VirtualHost *:80>

ServerName   my_free_domain.com

DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\web_site_3"

</VirtualHost>

 

<VirtualHost *:80>

ServerName  my_free_domain.com

ProxyPass / http://192.168.0.4:32000/mail/ <<example to another server with port settings

</VirtualHost>

 

 

 

apache is easy and good fun to learn please read the manual or a book, you need to learn as much as possable,

take your time good luck...............

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.