Jump to content

Assign Folders For Virtualhosts


beyzad

Recommended Posts

Thanks you sir.

 

Here is the conf i tried to do. but my problem is all A records are pointer to a same ip.

 

Additional info is the OS is windows 7

 

<VirtualHost 127.0.0.2>
DocumentRoot "H:/alavian/dl"
ServerName dl.yasdownload.com
</VirtualHost>
<VirtualHost 127.0.0.3>
DocumentRoot "H:/alavian/dl1"
ServerName dl1.yasdownload.com
</VirtualHost>
<VirtualHost 127.0.0.4>
DocumentRoot "H:/alavian/dl2"
ServerName dl2.yasdownload.com
</VirtualHost>
<VirtualHost 127.0.0.5>
DocumentRoot "H:/alavian/dl3"
ServerName dl3.yasdownload.com
</VirtualHost>
<VirtualHost 127.0.0.6>
DocumentRoot "H:/alavian/dl4"
ServerName dl4.yasdownload.com
</VirtualHost>
<VirtualHost 127.0.0.7>
DocumentRoot "H:/alavian/dl5"
ServerName dl5.yasdownload.com
</VirtualHost>

 

I also tried to write to host file. but IDK how to convert requested server name to local IP.

 

Thanks.

Link to comment
Share on other sites

Here is the conf i tried to do. but my problem is all A records are pointer to a same ip.

 

Then why are you using all these other ip addresses that don't actually exist?

 

A minimal vhost config:

 

<VirtualHost *:80>
   ServerName somedomain.com
   DocumentRoot "/var/www/somedomain.com/htdocs"
</VirtualHost>
<VirtualHost *:80>
   ServerName somedomain1.com
   DocumentRoot "/var/www/somedomain1.com/htdocs"
</VirtualHost>
<VirtualHost *:80>
   ServerName somedomain2.com
   DocumentRoot "/var/www/somedomain2.com/htdocs"
</VirtualHost>

 

You also need to set:

 

NameVirtualHost *:80

 

Somewhere before your vhost config is included.

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.