beyzad Posted December 18, 2012 Share Posted December 18, 2012 Hi there. I have 6 A records on a domain that points to my server. And my server has only 1 IP. There is no control panel installed and it is a poor apache web server. So how can i assign a folder for each A record? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/272144-assign-folders-for-virtualhosts/ Share on other sites More sharing options...
requinix Posted December 18, 2012 Share Posted December 18, 2012 What do you have available? Direct access to the Apache configs? Some other configuration software? A webmaster/sysadmin? Quote Link to comment https://forums.phpfreaks.com/topic/272144-assign-folders-for-virtualhosts/#findComment-1400127 Share on other sites More sharing options...
beyzad Posted December 18, 2012 Author Share Posted December 18, 2012 The server is right behind me Quote Link to comment https://forums.phpfreaks.com/topic/272144-assign-folders-for-virtualhosts/#findComment-1400149 Share on other sites More sharing options...
trq Posted December 18, 2012 Share Posted December 18, 2012 http://httpd.apache.org/docs/2.2/vhosts/ Quote Link to comment https://forums.phpfreaks.com/topic/272144-assign-folders-for-virtualhosts/#findComment-1400171 Share on other sites More sharing options...
beyzad Posted December 19, 2012 Author Share Posted December 19, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/272144-assign-folders-for-virtualhosts/#findComment-1400240 Share on other sites More sharing options...
trq Posted December 19, 2012 Share Posted December 19, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/272144-assign-folders-for-virtualhosts/#findComment-1400282 Share on other sites More sharing options...
beyzad Posted December 19, 2012 Author Share Posted December 19, 2012 Thank you sir. Works perfect. Quote Link to comment https://forums.phpfreaks.com/topic/272144-assign-folders-for-virtualhosts/#findComment-1400303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.