HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=29)
-   -   Webspace reachable on server's IP (http://www.howtoforge.com/forums/showthread.php?t=38709)

manarak 1st September 2009 14:11

Webspace reachable on server's IP
 
Don't jump to conclusions, read the whole post!

Here is the current state of the server:

Debian 5 + ISPConfig 3
The server hosts domains with websites.
Everything works as in a standard ISPC3 installation (webmail, phpmyadmin, etc.)
Currently, if one enters the server's IP into the URL field of a browser, it displays "it works!"


What I would like to achieve:

I would like to setup a website on the server's IP while keeping the hosted domains functional.

Horfic 1st September 2009 15:16

you check your /etc/hosts file. There should be something in it like

192.168.0.100 server1.example.com server1

This should do the trick when the server1.example.com is the same domain like the one you want to display on the ip address

PS: You can look at the setup instructions http://www.howtoforge.com/perfect-se...-ispconfig3-p3 under network configuration starting with the /etc/hosts

manarak 1st September 2009 19:09

Hi, Thanks, but I'm not sure I understand.

You talk about a domain, I just want to display a website.

for example, when the IP is called from a browser, the file index.php will be displayed as http://128.128.128.128/index.php

Horfic 1st September 2009 19:15

Sorry, my fault. Then you just change the html file with "it works" to something else! You can find this file under /var/www/index.html

Have fun!

manarak 1st September 2009 19:32

ok, is there any way to get it to serve the contents of a var/www/clients/clientXY/webXY/web folder?

astewart 1st September 2009 20:18

Quote:

Originally Posted by manarak (Post 202858)
ok, is there any way to get it to serve the contents of a var/www/clients/clientXY/webXY/web folder?

What you can do is create a symlink of the file that you already have in one of your web directories, eg:

Code:

user@server:/var/www# ln -s /var/www/domain.com/web/index.php ./index.php
Unfortunitely with this method all Style / CSS is gone and modifications would need to be made to the index file to reflect the whole URL path for most objects / links.

Play around with it and see what you can figure out.

manarak 1st September 2009 20:50

any way to make /var/www/clients/clientXY/webXY/web/ the webroot for http://128.128.128.128/ ?

(I'm trying to reproduce something I had on my old server running on Plesk)

astewart 1st September 2009 22:11

It is the main webroot I think.

Like I mentioned, I have a site now reachable at just the IP. There was some customizations that needed to be done to the index.php file(s) but it works fine.

Check out my previous post.

Unless you mean something totally different, I'm unsure then.

manarak 1st September 2009 22:39

well, if t was webroot, then modifications to your index.php should not have been necessary and style/css etc. wouldn't be lost.

also, if an image is put in that same directory, it should be displayed using just src=image.jpg, without adding any paths

astewart 2nd September 2009 02:32

ah, I gotcha now.

For that you will have to change the default web root set in apache I think. I'm unsure what file exactly sets your web root but the problem with this is that once you update ISPCONFIG, it will overwrite your changes.

So you will be better off modifying the proper ISPCONFIG file that sets the web root in apache I guess.

Sorry can't help you there. :(


All times are GMT +2. The time now is 12:57.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.