View previous topic :: View next topic |
Author |
Message |
willeraser Guest
|
Posted: Tue Feb 10, 2004 9:53 pm Post subject: host 2 different websites |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
wspollack -
Joined: 28 Dec 2003 Posts: 108
|
Posted: Wed Feb 11, 2004 2:17 am Post subject: Can 2 sites be in completely different directories? |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Feb 11, 2004 5:23 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
wspollack -
Joined: 28 Dec 2003 Posts: 108
|
Posted: Wed Feb 11, 2004 1:57 pm Post subject: OK, thanks, I'll give it a shot (eom). |
|
|
Thanks. I'll try it in a couple of days.
Bill |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
Posted: Tue Feb 17, 2004 7:01 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Wed Feb 18, 2004 2:19 am Post subject: |
|
|
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 |
![ICQ Number ICQ Number](templates/subSilver/images/lang_english/icon_icq_add.gif) |
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
Posted: Wed Feb 18, 2004 3:26 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
Posted: Wed Feb 18, 2004 3:49 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Feb 18, 2004 6:51 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Sparkyologist -
Joined: 25 Jan 2004 Posts: 5
|
Posted: Wed Feb 18, 2004 4:50 pm Post subject: How about ASP |
|
|
<%@ 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 |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Feb 18, 2004 8:35 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
Posted: Wed Feb 18, 2004 9:58 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Feb 19, 2004 12:08 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Feb 19, 2004 2:25 am Post subject: |
|
|
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 |
![ICQ Number ICQ Number](templates/subSilver/images/lang_english/icon_icq_add.gif) |
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
Posted: Thu Feb 19, 2004 4:13 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Feb 19, 2004 4:52 am Post subject: |
|
|
That's for the CGI one, correct? _________________ Bienvenidos! |
|
Back to top |
![ICQ Number ICQ Number](templates/subSilver/images/lang_english/icon_icq_add.gif) |
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
Posted: Thu Feb 19, 2004 4:56 am Post subject: |
|
|
yes |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Axis -
Joined: 29 Sep 2003 Posts: 336
|
Posted: Thu Feb 19, 2004 5:38 am Post subject: |
|
|
Thanks eznetlinks--
I haven't tried it but thank you for sharing a perl variety!
Regards,
Axis |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Feb 19, 2004 6:58 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Fri Feb 20, 2004 1:15 am Post subject: |
|
|
And the revised PHP one works at masking the full URL! This is one step closer to Virtual Hosting... :D _________________ Bienvenidos! |
|
Back to top |
![ICQ Number ICQ Number](templates/subSilver/images/lang_english/icon_icq_add.gif) |
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
Posted: Sat Oct 23, 2004 1:03 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Sat Oct 23, 2004 2:31 am Post subject: |
|
|
I will be sure to add it to my collection , Thanks Eznetlinks :) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
Posted: Sat Oct 23, 2004 2:56 am Post subject: |
|
|
Anytime TRUSTpunk! Glad to be of service. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
WolfRamiO -
Joined: 30 May 2004 Posts: 121 Location: Viña del Mar, Chile
|
Posted: Sun Nov 14, 2004 10:25 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
cldickerson -
Joined: 08 May 2004 Posts: 23
|
Posted: Tue Nov 16, 2004 1:35 pm Post subject: Good scripts - all |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
zaimor -
Joined: 07 Nov 2004 Posts: 4 Location: Fort Drum New York
|
Posted: Sat Nov 20, 2004 1:49 am Post subject: Along Those Lines... Alternate Ports? |
|
|
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 |
![ICQ Number ICQ Number](templates/subSilver/images/lang_english/icon_icq_add.gif) |
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Sat Nov 20, 2004 2:19 am Post subject: |
|
|
You will have to run 2 Abyss Web Server's on different ports to do this. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Sat Nov 20, 2004 10:53 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
zaimor -
Joined: 07 Nov 2004 Posts: 4 Location: Fort Drum New York
|
Posted: Sun Nov 21, 2004 4:33 pm Post subject: Tried that |
|
|
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 |
![ICQ Number ICQ Number](templates/subSilver/images/lang_english/icon_icq_add.gif) |
![](templates/subSilver/images/spacer.gif) |
RoeKoe -
Joined: 15 Jul 2004 Posts: 2 Location: Wijckel
|
Posted: Wed Dec 01, 2004 11:18 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
eznetlinks -
Joined: 27 Sep 2003 Posts: 144
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
sabrena -
Joined: 03 Jul 2004 Posts: 29 Location: Florida
|
Posted: Mon Dec 06, 2004 5:17 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Mon Dec 06, 2004 11:15 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
sabrena -
Joined: 03 Jul 2004 Posts: 29 Location: Florida
|
Posted: Wed Dec 08, 2004 12:17 am Post subject: |
|
|
went to the site. Looks fairly easy. Which script should I use? Does it matter? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Dec 08, 2004 12:56 am Post subject: |
|
|
I prefer the PHP version because PHP is faster , its up to you what you want. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|