host 2 different websites

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
willeraser
Guest





PostPosted: Tue Feb 10, 2004 9:53 pm    Post subject: host 2 different websites Reply with quote

hi

i have 2 websites that i would like to host on my computer. How can i host more than 1 website with this software ( with 2 different addresses)
Back to top
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Tue Feb 10, 2004 11:32 pm    Post subject: Reply with quote

with ::Virtual Host Creator:: (Requires PHP)

http://www.multiple-sites.tk
Back to top View user's profile Send private message Visit poster's website
wspollack
-


Joined: 28 Dec 2003
Posts: 108

PostPosted: Wed Feb 11, 2004 2:17 am    Post subject: Can 2 sites be in completely different directories? Reply with quote

With the php created, can the two sites be stored in completely different directories, or must one be in a subdirectory of the other? (And I admit I obviously don't really understand php.)

Thanks,

Bill
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Feb 11, 2004 5:23 am    Post subject: Reply with quote

well it all depends , you can use an aliases also
and it will still work the same way , I use a dir
outside my abyss directory named vhosts and
put all my extra sites their 8)

P.S. Why do you think I created that form ! :D
Back to top View user's profile Send private message Visit poster's website
wspollack
-


Joined: 28 Dec 2003
Posts: 108

PostPosted: Wed Feb 11, 2004 1:57 pm    Post subject: OK, thanks, I'll give it a shot (eom). Reply with quote

Thanks. I'll try it in a couple of days.

Bill
Back to top View user's profile Send private message Visit poster's website
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Tue Feb 17, 2004 7:01 pm    Post subject: Reply with quote

If for some reason php isn't used the following javascript does the same thing.

<script language="javascript">
var host = location.hostname
if (host == "www.yourdomain.com")
{
location.replace("/yourdir")
}
if (host == "www.yourdomain2.com")
{
location.replace("/yourdir2")
}
</script>

good luck :D
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Wed Feb 18, 2004 2:19 am    Post subject: Reply with quote

I've been working with that "Multiple Sites Creator" and I noticed something interesting:

Say I have www.site.com.
I want to make a new site @ site2.site.com
I used ZoneEdit so both point to my IP address
Since both of them end up at the same index page, I use the Multiple Site Creator to forward both URLs to their appropriate location.

When people go to Site 1, they get forwarded to in.html, which is the main site.
However when people go to Site 2, they get forwarded into the /site2 directory. When people go the URL "site2.site.com," their browser reads "site2.site.com/site2." Although this sounds exactly like what virtual hosts would do, is there a way so the browser would just simply read "site2.site.com" like it were the real URL?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Wed Feb 18, 2004 3:26 am    Post subject: Reply with quote

If you want browser to read http://www.site1.com and http://www.site2.com
use php include()

example:

<?php
if ($name == "www.site1.com")
{
include 'in.html';
}
elseif ($name == "site1.com")
{
include 'in.html';
}
elseif ($name == "www.site2.com")
{
include '/site2 directory/indexfile.html';
}
elseif ($name == "site2.com")
{
include '/site2 directory/indexfile.html';
}
else
{
echo "DOMAIN NOT ON THIS SERVER";
}
?>

Check Relative Links When using This Method!
GOOD LUCK :D
Back to top View user's profile Send private message Visit poster's website
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Wed Feb 18, 2004 3:49 am    Post subject: Reply with quote

you will need this for the first line after <?php

should look like this
<?php
$name = $_SERVER["SERVER_NAME"];
if ($name == etc.......
SORRY :roll:
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Feb 18, 2004 6:51 am    Post subject: Reply with quote

Download the latest version of abyss and put the path as
/site1/ and not /site1 and it will work , holy crap , some
one create a javascript version , wow ! :D

Edit: The javascript version won't let you show just
www.your-sites.com , only the php version , its best
to just use my form generator http://multiple-sites.tk
Back to top View user's profile Send private message Visit poster's website
Sparkyologist
-


Joined: 25 Jan 2004
Posts: 5

PostPosted: Wed Feb 18, 2004 4:50 pm    Post subject: How about ASP Reply with quote

<%@ Language=VBScript %>
<% Response.Buffer=True


'Active Server Pages script filename:index.asp
'White Technologies
'

Dim strname

strname=Request.ServerVariables("SERVER_NAME")

Select Case (Lcase(Trim(strname)))

Case "site.site1.com"
Response.Redirect "site1root/home.htm"

Case "site.site2.com"
Response.Redirect "site2root/home.htm"
End Select
%>
Back to top View user's profile Send private message Visit poster's website AIM Address
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Feb 18, 2004 8:35 pm    Post subject: Reply with quote

Oh thats nice , now a ASP version , can someone please write my
cgi or perl version that I asked for , maybe you know one in html
I have asked many times in this forum if someone can write a pl
or cgi version of this script , so I can create more than one ver.
of ::Virtual Host Creator:: http://www.multiple-sites.tk :D
Back to top View user's profile Send private message Visit poster's website
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Wed Feb 18, 2004 9:58 pm    Post subject: Reply with quote

here ya go

#!perl
$domain = "$ENV{'SERVER_NAME'}";
use CGI qw(:cgi);
if ($domain == "domain1.com")
{
print redirect( -URL => "main.html" )
}
elsif ($domain == "domain2.com")
{
print redirect( -URL => "index.html" )
}
else
{
print "Content-type: text/html\n\n";
print "<h1>DOMAIN NOT ON THIS SERVER</h1>\n";
}

:D

oops change "==" to "eq"
example;if ($domain eq "domain1.com")


Last edited by eznetlinks on Mon Feb 23, 2004 5:06 pm; edited 1 time in total
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Feb 19, 2004 12:08 am    Post subject: Reply with quote

Thank you so much , you rule ! :D

I will do some coding today and start creating
my perl version of ::Virtual Host Creator::

P.S. Instead of showing , domain not in list , can you make
it where it directs you to the real main index page of your site

Edit: Can you make it where this script handles more than 1
domain , it does not work with 2 , it goes to the same page
as the first one that I entered , please help :(
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Feb 19, 2004 2:25 am    Post subject: Reply with quote

Wow eznetlinks, you seem to know your stuff.

Thank you for all of the options, I hope to get one working!
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Thu Feb 19, 2004 4:13 am    Post subject: Reply with quote

in the above script replace the == with eq
example:

if ($domain eq "www.eznetlinks.com")
{
print redirect( -URL => "main.html" )
}

the script will work now

instead of printing DOMAIN NOT ON THIS SERVER
just add another:
print redirect( -URL => "whatever.file" )

in your else statement

:D
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Feb 19, 2004 4:52 am    Post subject: Reply with quote

That's for the CGI one, correct?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Thu Feb 19, 2004 4:56 am    Post subject: Reply with quote

yes
Back to top View user's profile Send private message Visit poster's website
Axis
-


Joined: 29 Sep 2003
Posts: 336

PostPosted: Thu Feb 19, 2004 5:38 am    Post subject: Reply with quote

Thanks eznetlinks--

I haven't tried it but thank you for sharing a perl variety!

Regards,
Axis
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Feb 19, 2004 6:58 am    Post subject: Reply with quote

It works ! Dude , I am deffinently adding credits to you , now the cgi
lovers can enjoy my easy to use form :D , the form might be in PHP
though since im not good with perl coding , You rule !
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Fri Feb 20, 2004 1:15 am    Post subject: Reply with quote

And the revised PHP one works at masking the full URL! This is one step closer to Virtual Hosting... :D
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Sat Oct 23, 2004 1:03 am    Post subject: Reply with quote

Been sittin on this one for a while, was hoping abyss would have v host by now. This is a pascal version. This script can be compiled into an .exe file.

index.pas

Code:


program Redirect;
uses dos;
begin
if getenv('HTTP_HOST')='localhost' then
begin
    writeln ('Location: default.html');
    writeln;
    end
else if getenv('HTTP_HOST')='127.0.0.1' then
begin
    writeln ('Location: main.html');
    writeln;
    end
else
 begin
 writeln('Location: index.html');
 writeln;
 end;
end.



http://www.freepascal.org/
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Oct 23, 2004 2:31 am    Post subject: Reply with quote

I will be sure to add it to my collection , Thanks Eznetlinks :)
Back to top View user's profile Send private message Visit poster's website
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Sat Oct 23, 2004 2:56 am    Post subject: Reply with quote

Anytime TRUSTpunk! Glad to be of service.
Back to top View user's profile Send private message Visit poster's website
WolfRamiO
-


Joined: 30 May 2004
Posts: 121
Location: Viña del Mar, Chile

PostPosted: Sun Nov 14, 2004 10:25 pm    Post subject: Reply with quote

This scripts rules, can anyone make a control panel? (i like to do it, but i know zero of coding) when you got like 12 sites its a little dificult to administrate the domains...
Back to top View user's profile Send private message Visit poster's website
cldickerson
-


Joined: 08 May 2004
Posts: 23

PostPosted: Tue Nov 16, 2004 1:35 pm    Post subject: Good scripts - all Reply with quote

Good scripts - all! But they have one problem in common. If a visitor enters a page name into his browser (www.YourSite/page1.html), the scripts won't redirect to the proper directory. Try this, instead:

Insert the following Javascript into the header (between <HEAD> and </HEAD>) of your main (index.htm) page. Just below the <TITLE> line is a good place.

<SCRIPT LANGUAGE="JavaScript">
var refarray = new Array();
refarray['DomainOne.com'] = "DirectoryOne";
refarray['DomainTwo.com'] = "DirectoryTwo";
refarray['DomainThree.com'] = "DirectoryThree";
refarray['DomainFour.com'] = "DirectoryFour";
for (var i in refarray) {
if (document.URL.indexOf(i) != -1) window.location.replace(refarray[i]);
}
</script>


As long as the line entered into the visitors browser contains the domain name - he will be redirected to the proper directory...

Claude
Back to top View user's profile Send private message
zaimor
-


Joined: 07 Nov 2004
Posts: 4
Location: Fort Drum New York

PostPosted: Sat Nov 20, 2004 1:49 am    Post subject: Along Those Lines... Alternate Ports? Reply with quote

Hmm... this falls right along these lines so rather than post something new thought i'd post here. I'm looking to do the same thing, except, the variable in my case is going to be the port. I have issues with port 80, occasionally, but I HATE having an address with that ugly :64000 on the end of it. On my internet backup ( http://www.xanga.com/zaimor ) in the top right, you see links to port 80 and port 64000. What I want to do is keep -Both- port 80 and 64000 open and running the webserver, so that when port 80 has issues, I dont have to manually change abyss to port 64000... both ports will always be available so the user can just click the most convinent one. Any suggestions?

In my router I have 80 going to this IP, 9999 going to this IP for the console of the port 80 server, and then I have 64000-64001 for the port/console of the alternate. At the moment, http://be.mine.nu:64000 is up. http://be.mine.nu is what I want to use as well.
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Nov 20, 2004 2:19 am    Post subject: Reply with quote

You will have to run 2 Abyss Web Server's on different ports to do this.
Back to top View user's profile Send private message Visit poster's website
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Sat Nov 20, 2004 10:53 am    Post subject: Reply with quote

Not necessarily - you could leave Abyss running on just one port, but open both ports on your router and just have them forwarded to the single port that Abyss is running on, so both 80 and 64000 on the router are forwarded to 80 on your actual server PC...
Back to top View user's profile Send private message
zaimor
-


Joined: 07 Nov 2004
Posts: 4
Location: Fort Drum New York

PostPosted: Sun Nov 21, 2004 4:33 pm    Post subject: Tried that Reply with quote

Tried that... however the -reason- i need to do this, is that port forwarding from 80 doesnt seem to work with Abyss. On another forum someone suggested that Abyss has issues with this and that there was a different version, so I E-Mailed Aprelium support, but they told me that they had no known issues and that it was my ISP blocking port 80... unless they just block it once in awhile for the hell of it, that's not the case. Thanks for the input though :)
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
RoeKoe
-


Joined: 15 Jul 2004
Posts: 2
Location: Wijckel

PostPosted: Wed Dec 01, 2004 11:18 am    Post subject: Reply with quote

Hello,

i want to host 2 websites with 2 difirent domainnames.. both are html sites.. wat script should i use ? i am a real noob in with this

thanks in advance
Back to top View user's profile Send private message
eznetlinks
-


Joined: 27 Sep 2003
Posts: 144

PostPosted: Wed Dec 01, 2004 7:34 pm    Post subject: Reply with quote

use php, python or perl. You will need to add the interpreter to your server.
http://www.aprelium.com/abyssws/php.html
http://www.aprelium.com/abyssws/perl.html

then use virtual host creator
http://www.multiple-sites.tk/
Back to top View user's profile Send private message Visit poster's website
sabrena
-


Joined: 03 Jul 2004
Posts: 29
Location: Florida

PostPosted: Mon Dec 06, 2004 5:17 pm    Post subject: Reply with quote

Ok, I have posted before regarding hosting 2 sites. I don't know how to code or what to do with the code everyone puts out there. Is there and easy way for people like me. Ihave tried several times to go to this site but is never available. http://www.multiple-sites.tk/

If I just decided to download another abyss all i would have to do is port forward to the new port right? Or am I making more work for myself.
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon Dec 06, 2004 11:15 pm    Post subject: Reply with quote

sabrena wrote:
Ok, I have posted before regarding hosting 2 sites. I don't know how to code or what to do with the code everyone puts out there. Is there and easy way for people like me. Ihave tried several times to go to this site but is never available. http://www.multiple-sites.tk/

If I just decided to download another abyss all i would have to do is port forward to the new port right? Or am I making more work for myself.


Have you tried vhosting.cjb.net , I to have had trouble some times with the
dot.tk Redirection service , try the cjb.net domain , the website is up 24/7.

Note: The only time my websites go offline is when their is a power outage
in my area but I do have a backup to try and keep it up as long as I can...
Back to top View user's profile Send private message Visit poster's website
sabrena
-


Joined: 03 Jul 2004
Posts: 29
Location: Florida

PostPosted: Wed Dec 08, 2004 12:17 am    Post subject: Reply with quote

went to the site. Looks fairly easy. Which script should I use? Does it matter?
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Dec 08, 2004 12:56 am    Post subject: Reply with quote

I prefer the PHP version because PHP is faster , its up to you what you want.
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group