Server IP Question

Not really sure if it’s an Interworx question or a SERVER question, since i’m still kind of new at all this.

But whenever a Siteworx account is created on a shared IP on my server, if i point the browser to the server’s ip (e.g. http://63.246.x.x) it shows the LAST Siteworx account which was created/the last new customer’s page.

I know i’ve been told to change the default webpage location in a conf somewhere, but when i tried that in the past, it still didn’t work. Do servers running Interworx use a different file for the default server html location than a typical Redhat 9 server would use? I want it the IP to always either point to a test page (as it did initially) or to my company’s website.

In fact when it is a shared IP with some vhost on it if you try to acces on this shared ip it will shows the first Vhost

If you try to access to an other IP it will show a default Interworx test page
http://65.110.36.144

This default page is set in /etc/httpd/conf/httpd.conf

<Directory “/var/www/html”>

In /var/www/html there is the default interworx test page

You may change these pages or change the default document root here.

Not sure if it is possible to show a default page with an IP that has some Vhost. But if there is a positive answer I’ll be really interesting by this. Indeed, there some pbms with the rules of the first vhost. For example when you try to access to an accoutn by using the user_dir and the shortcut http://ip/~account

Pascal

I acutally “created” a new Vhost file under the /etc/httpd/conf.d section.

I changed the name of the namevirtualhost.conf to 0_namevirtualhost.conf. Then I added a default Vhost for the IP I have all my shared host on. If you type the IP in FireFox it will just redirected back to my main company website. I had to put the “0_” in front of the name so that would be first script to be imported from the conf.d files when generating the apache config file.


NameVirtualHost x.x.x.x:80

#Default Name Virtual Host
<VirtualHost x.x.x.x:80>
 ServerName *
 Redirect permanent / http://mycompanywebsite.com/
</VirtualHost>

Also, after you save the script dont forget to restart Apache (I like to use apachectl -k graceful). Downside to this is this you can’t use the ~username feature (userdir).

Hope this helps :smiley:

sure it helps :slight_smile:
lol I knew it takes the first vhost but never think to create one that redirect to my website :slight_smile:

But not sure to understand what you mean by

Downside to this is this you can’t use the ~username feature (userdir).

Also, there is only to create the file, enter the good ip, save it and restart apache isn’t it ?

I mean I have a namevirtualhost.conf like this one

NameVirtualHost xx.xx.xx.xx1:80
NameVirtualHost xx.xx.xx.xx2:80
NameVirtualHost xx.xx.xx.xx3:80

So I only have to rename it and replace thes lines by

NameVirtualHost x.x.x.1:80
NameVirtualHost x.x.x.2:80
NameVirtualHost x.x.x.3:80

#Default Name Virtual Host
<VirtualHost x.x.x.1:80>
ServerName *
Redirect permanent / http://mycompanywebsite.com/
</VirtualHost>

#Default Name Virtual Host
<VirtualHost x.x.x.2:80>
ServerName *
Redirect permanent / http://mycompanywebsite.com/
</VirtualHost>

#Default Name Virtual Host
<VirtualHost x.x.x.3:80>
ServerName *
Redirect permanent / http://mycompanywebsite.com/
</VirtualHost>

Is it right ?

Pascal

Downside to this is this you can’t use the ~username feature (userdir).
Meaning this will disable being able to get to a website by the IP. So if you do what I said with IP x.x.x.x you won’t be able to x.x.x.x/~username to that site anymore because the IP x.x.x.x will be redirected.

Although I have only done this for 1 NameVirtualHost the code you have should work the same.

Ok thanks I’ll give it a try and let you know

Thanks

seems to work fine indeed.

I’ve had some warning when I’ve restarted apache but that works (but it is because I have kept the default namevirtualhost.conf file to not have some pbms with interworx)

Thanks

Pascal

Pascal,

To avoid the warning you could just make a seperate file for the default host. I just tired it and it works. This is probably the better way of doing it.

  1. Leave namevirtualhost.conf unchanged (Original from Iworx)
  2. Remove the 0_namevirutalhost.conf if you already crated it.
  3. Create another config file with the 0_, I called mine 0_defaulthost.conf

Put the additional code that in the new 0_defaulthost.conf.

Summary:

namevirtualhost.conf

 NameVirtualHost x.x.x.1:80
NameVirtualHost x.x.x.2:80
NameVirtualHost x.x.x.3:80

0_defaulthost.conf

 #Default Name Virtual Host for .1
<VirtualHost x.x.x.1:80>
ServerName *
Redirect permanent / http://mycompanywebsite.com/
</VirtualHost>

#Default Name Virtual Host for .2
<VirtualHost x.x.x.2:80>
ServerName *
Redirect permanent / http://mycompanywebsite.com/
</VirtualHost>

#Default Name Virtual Host for .3
<VirtualHost x.x.x.3:80>
ServerName *
Redirect permanent / http://mycompanywebsite.com/
</VirtualHost>

0_namevirutalhost - no longer exist under this setup

Justec - Interworx and Sago should have you on staff :wink: You are awesome! Thanks for the replies. Glad my question seemed to help someone else out too!

I got another question for you! =) First off, i went through that procedure halfway and it got me thinking - If i want to run IRC on both my .1 and .2 IPs, is that how i differentiate between them? Sago gives us 2 IPs, but i just realized that my namevirtualhost.conf only had 1 IP listed in it. I have yet to use the second IP for anything. I run everything on the main (shared) IP.

Any thoughts of that? Say someone wanted SSL - I would have to get them their own (dedicated) IP, right? And I guess i’d have to set it up in the namevirtualhost.conf file?

Last question! Speaking of SSL, to set up ProFTPD with SSL, i got through half the procedure up until that step you initially ‘forgot’ … the one involving configuring certificates and stuff. Can you elaborate a bit on that? I’m kinda jumping across topics here, sorry =) Just figured you could answer all my concerns at once =)

Thanks again! :smiley:

EDIT: I went through the entire procedure and the IP pointing to my site works beautifully now =) Thanks!

Glad I could help :cool:

You could have 2 IPs as NameVirtualHost if you wanted, but since the new internet isn’t “out” yet we have to stick with the old IP system and their aren’t too many IPs left. So I would just use one IP for shared hosting and save your others for when you really need them (ie. SSL).

Correct, you would need to give some a dedicated IP to have SSL because of the way SSL works. One thing to point out here is that you dont have to do this manually since you have InterWorx. When you create a new SiteWorx account you just set it up on either your shared IP or one of your unused IPs as dedicated.

Im going to answer this question in the original thread:
http://interworx.info/forums/newreply.php?do=newreply&noquote=1&p=2509

No problem, glad to here it’s working.