Jump to content

NoIp updater and Apache virtual hosting question


MottS
 Share

Recommended Posts

Hi all

 

I have gd.no-ip.com and agtobs.no-ip.com pointing to my dynamic IP no problem with their IP-updater (little program...). Now, how do I configure Apache so that when one type a certain dns he get redirected to the right directory? Here is what I have so far.

 

gd.no-ip.com is in /var/www/html and everything works well. I added a directory called agtobs in /var/www/html this way

root@localhost vhosts]# ls /var/www/html/

addon-modules/  apache_pb.gif  History/    MDKlinux.jpg  Uptime.png

agtobs/         Buggy/         index.html  msfree.png    WelcomeBonjour.png

Air Cargo/      caffeine.gif   MDKLinux/   Tux.png

I also have

Include conf/vhosts/Vhosts.conf

in /etc/httpd/conf/httpd.conf. How do I set Vhosts.conf now? I've seen Paul writing the following at http://www.mandrakeusers.org/viewtopic.php...=apache+virtual

 NameVirtualHost 202.27.218.97 

<VirtualHost 202.27.218.97> 

        DocumentRoot /var/www/html/loudas.com 

        ServerName loudas.com 

        ServerAlias www.loudas.com 

        CustomLog logs/loudas.com-access_log combined 

</VirtualHost>

But my IP changes! .. so would it work writing

NameVirtualHost agtobs.no-ip.com

<VirtualHost agtobs.no-ip.com>

       DocumentRoot /var/www/html/agtobs

       ServerName agtobs

       ServerAlias agtobs.no-ip.com

       CustomLog logs/agtobs-access_log combined

</VirtualHost>

Otherwise I have no idea..

 

Thx for help

 

MOttS

Link to comment
Share on other sites

I use no-ip too in dialup. I have serveral hostnames and the same IP (which is dynamic). This is what works for me (Vhosts.conf):

 

NameVirtualHost *



<VirtualHost *>

       DocumentRoot /home/httpd/public_html/

       ServerName server1.no-ip.org

       ServerAdmin admin@server1.no-ip.org

</VirtualHost>



<VirtualHost *>

       DocumentRoot /home/someuser/public_html/

       ServerName server2.no-ip.org

       ServerAdmin admin@server2.no-ip.org

</VirtualHost>



<VirtualHost *>

       DocumentRoot /home/anotheruser/html/

       ServerName server3.no-ip.org

       ServerAdmin admin@server3.no-ip.org

</VirtualHost>

 

and so on, make an entry for each one of the virtual servers you have.

 

Ofcourse I have other local servers (non internet published, just for the LAN), and those entries look like:

 

<VirtualHost 192.168.0.13>

       DocumentRoot /path/to/root/

       ServerName lan_server.org

       ServerAdmin myself@mymachine

</VirtualHost>

 

HTH

 

btw, no-ip rocks ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...