Using Vhost with shared IPs
![]()
Vhost was written inhouse to make account setup easy. It's easy to use simply type VHOST (in upper case) from the telnet prompt. The text below will show in your telnet screen. VHOST is setup to make life easy. In most cases you can just hit enter. Our comments are in RED.
Type 'q' or 'exit' or 'bye' to quit at any time.
Type 'r' to restart Vhost and come back here.
Options:
[1] Add a new virtual domain
[2] Edit an existing virtual domain
[3] Edit IP numbers for this machine
(To add a new domain, just hit 'Enter'.)
Option:<1>: press enter
Please enter the domain name, (i.e. some.domain.com)
Domain name: test5.com
You entered: test5.com
Is this correct? <Yes> press enter
Will this be an IP based vhost? (unique IP) <y/N> enter N
The above question wants to know if this site will have a fixed IP or shared IP address. If the site is going to have an SSL cert then the site must have a unique IP address.
Will this domain share it's IP number (name based)? <Yes>: press enter
Is this a Parked domain? <No>: press enter
A parked domain is one that you are parking for a customer. This is hardly used and is not needed. To park a domain you just need a DNS entry.
Use this IP Number? <134.129.129.151>:
VHOST will choose the IP number that is set on your machine to be the shared IP. This is setup for you in your VHOST configuration. If the wrong IP is show, just type in the correct one.
User name? <test5tes>:
Vhost suggests a user name for this user. You can press enter to accept it or type in your own.
Password? <testthb2>:
Vhost suggests a password for the user. You can press enter to accept it, type N and Vhost will select another one, or type in your own.
Install FrontPage extensions? <y/N>
Just as it says, do you want FrontPage 2000 support for this site?
<VirtualHost 208.186.122.218>
ServerAdmin root@localhost
DocumentRoot /home/httpd/html/testtest
User testtest
Group web
ServerName test.com
Etc, Etc,
Vhost now displays the Apache configuration file for this domain. This is done so you can edit it manually if you want. Press Q and then wq to save and exit the vi editor. Note that your editor may be set to Pico and not vi.
Do you want to create an account for testtest? <Y/n>:
Next the above message is displayed. This is telling you that there is no user account for your new domain. Vhost wants to take care of it for you. It will also setup the FTP account. Answer Y.
NOW!
If you have NOT written down the username and password for this
domain, this is the time to do it. They are both printed out below
and I will wait until you write them down and hit enter before I
continue. You can also find this informatin under /vhost/vhost-conf
in a file named test5.com.
Username: test5tes
Password: testthb2
Are you done? <Yes>:
If you are satisfied with the above user ID and password
just press enter.
I can attempt to install/update your system using
data from /vhost/vhosts-conf/test.com,
and the vhost file /vhost/conf/vhosts/test.com
Install now? <Yes>: press enter
Vhost is saying that it has all the information needed to install you new domain.
I'm ready to rewrite httpd.conf.
I have already backed up the existing file in /vhost/conf/backup
in case something goes wrong...
We can do this one of two ways:
1. Confirm each line that I put into the new httpd.conf
2. Just do it.
If you have loaded a configuration but want to comment it out for now,
have a configuration that you want to uncomment, or just like to have
absolute control, you should choose option 1.
If you don't care, choose option 2.
I want to use option <2>: press enter
Testing Apache Configuration.....
Syntax OK
Do you want me to attempt an Apache restart?
If you had error(s)above, you should fix whatever is wrong first...
Restart Apache? <y/N>
Vhost tests your configuration to make sure there are no errors. You can say Y or N to the above question. You can restart Apache later with APACHE stop then APACHE start. The word APACHE must be all in upper case.
Do you want me to install FrontPage Extensions now? <Y/n>
Answer Y to have Vhost install the FP extensions.
Do you want me to restart FTP so it knows about any
new users you may have added? <Y/n>
Vhost wants to restart your FTP service so the user will be able to FTP in when they try. Answer Y to have Vhost restart the FTP server. SAY YES to this. Otherwise your user will end up in the wrong group.
Do you want to quit now? <Y/n>:
At this point Vhost has completed the account setup. You can press Y to exit Vhost. Your domain account on your server is now completely setup.
![]()
How to move domains from one server to another using shared IP.
You may want to move sites from another server. The problem is that when they are on shared IP you can't view them until DNS propagation take place.
Here a little tip that will help. Set up your domain using the instructions above. Your domain will end up on the same IP as many others. Move the files from the old server to the new.
Now, look in your server at the location /etc/httpd/conf/vhosts. Here you will see the domains you have setup. The configuration files fo Named based domains start with "nb". Find the domain you want to view. Look for the section as shown below in red.
<VirtualHost 134.129.129.151> change this IP to a free IP number on your server.
At the telnet prompt type "APACHE stop" then type "APACHE start". Type both of these without the quotes. The apache server will complain and give you a warning about the IP but it will start.
Now with a browser go to the IP number you changed this domain to. View the site, look it over, click the links etc. If all is well, reverse the process and change the IP number back to the shared IP. Now when the DNS changes the site will come up and there will be no problems with how the site looks.