| View previous topic :: View next topic |
| Author |
Message |
Wrsaith
Joined: 24 Aug 2005
Posts: 19
|
| Posted: Sun Aug 28, 2005 1:23 am Post subject: Virtual Hosts Not working right. Can't find answer anywhere. |
|
|
Ok I'm hosting two sites off my apache server the virtual host I have set up works but when I connect to my original site the one thats not set up in teh virtual host section I only get whats in my virtual host website. Is there something wronge?
Um my httpd.conf is attached for you to look at to see if i have anything wrong. |
|
| Back to top |
|
Twirp
Joined: 07 May 2005
Posts: 14
Location: Md
|
| Posted: Sun Aug 28, 2005 1:36 am Post subject: |
|
|
change:
NameVirtualHost teamvietnam.hopto.org:80
to:
NameVirtualHost *:80
Change:
<VirtualHost teamvietnam.hopto.org:80>
to:
<VirtualHost *:80> |
|
| Back to top |
|
Wrsaith
Joined: 24 Aug 2005
Posts: 19
|
| Posted: Sun Aug 28, 2005 1:46 am Post subject: |
|
|
nope it didn't work. And with it like that I cna't access the apache2triadcp.
It still does the same thing. |
|
| Back to top |
|
bigredcherokee
Joined: 27 Aug 2005
Posts: 13
Location: Shreveport, Louisiana
|
| Posted: Sun Aug 28, 2005 2:45 am Post subject: |
|
|
| same problem I'am having |
|
| Back to top |
|
Wrsaith
Joined: 24 Aug 2005
Posts: 19
|
| Posted: Sun Aug 28, 2005 11:31 pm Post subject: |
|
|
| ok I've found a nifty way to fix my problem. I have though no-ip.com and there dns lookup program thing and option to have my server name look to my server under another port other than port 80. I have each webpage assigned a different port so that it does not load only one of the pages I'm host no matter what address I go to. Its call port redirect under the no-ip settings. I have one site as port 80 and the other one port 81. |
|
| Back to top |
|
Joshua Meadows (DemoRic)
Joined: 29 Dec 2004
Posts: 783
Location: S.E. Kansas
|
| Posted: Mon Aug 29, 2005 1:11 am Post subject: |
|
|
bigredcherokee
You need a virtual host for each sitename see:
http://apache2triad.net/forums/viewtopic.php?t=21
or
http://jaydium.servehttp.com/forum_viewtopic.php?13.32 |
|
| Back to top |
|
soulzllc
Joined: 20 Aug 2005
Posts: 12
Location: CT
|
| Posted: Tue Aug 30, 2005 12:29 am Post subject: |
|
|
Existing:
Code:
<VirtualHost teamvietnam.hopto.org:80>
ServerAdmin wrsaith@gmail.com
DocumentRoot "C:\apache2triad\htdocs\cs"
ServerName teamvietnam.hopto.org
ServerAlias teamvietnam.hopto.org
ErrorLog logs/teamvietnam.hopto.org-error_log
CustomLog logs/teamvietnam.hopto.org-access_log common
</VirtualHost>
Try:
Code:
<VirtualHost 127.0.0.1> #or your real ip
ServerAdmin wrsaith@gmail.com
DocumentRoot htdocs/cs
ServerName teamvietnam.hopto.org
ServerAlias teamvietnam.hopto.org
DirectoryIndex index.htm index.html index.php index.shtml index.asp index.cgi index.php3
ErrorLog C:/apache2triad/logs/teamvietnam.hopto.org-error.log
CustomLog C:/apache2triad/logs/teamvietnam.hopto.org-access.log combined
</VirtualHost>
Also put your IP back into the NameVirtualHost but remove the :80 to define the port..
something else I noticed:
Code:
#server config
ServerName localhost:80
ServerAdmin wrsaith@gmail.com
change
ServerName localhost:80
to
ServerName teamvietnam.hopto.org:80
if you want your site avaliable online. |
|
| Back to top |
|
Wrsaith
Joined: 24 Aug 2005
Posts: 19
|
| Posted: Tue Aug 30, 2005 1:02 am Post subject: |
|
|
| Will thanks anyway but I have another way to do it now with no-ip.coms serverice. They have a port redirect that I'm using keeping my main site on the port 80, and put my other site on port 81. I set apache to listen on both ports and It works fine. For others who have a similar problem this might be a handy and simple way to fix your problem if your dns name hoster has the port redirect option. |
|
| Back to top |
|
soulzllc
Joined: 20 Aug 2005
Posts: 12
Location: CT
|
| Posted: Tue Aug 30, 2005 2:50 am Post subject: |
|
|
Code:
<VirtualHost 127.0.0.1> #or your real ip
ServerAdmin wrsaith@gmail.com
DocumentRoot htdocs/cs
ServerName teamvietnam.hopto.org
ServerAlias teamvietnam.hopto.org
DirectoryIndex index.htm index.html index.php index.shtml index.asp index.cgi index.php3
ErrorLog C:/apache2triad/logs/teamvietnam.hopto.org-error.log
CustomLog C:/apache2triad/logs/teamvietnam.hopto.org-access.log combined
</VirtualHost>
will allow for multiple sites to be hosted via port 80.. |
|
| Back to top |
|
Wrsaith
Joined: 24 Aug 2005
Posts: 19
|
| Posted: Thu Sep 01, 2005 7:51 am Post subject: |
|
|
| Sorry soulzllc your way didn't work in the end after adding a third website to the list of websites I host this is what I've done to get the to run properly. Now if I don't have my main site as a virtualhost as well it won't showup/load in the browser it will just show page not found or it would show up my first virtualhost I had diffined so I gave it a vhost handler as well. Is there any forseeable problems running my server Like this? |
|
| Back to top |
|
Joshua Meadows (DemoRic)
Joined: 29 Dec 2004
Posts: 783
Location: S.E. Kansas
|
| Posted: Thu Sep 01, 2005 10:47 pm Post subject: |
|
|
You might want a localhost section:
Code: #site1.com
<VirtualHost *:80>
ServerAdmin admin@site1.com
documentRoot c:/apache2triad/htdocs/site1
ServerName www.site1.com
ServerAlias site1.com
ErrorLog logs/site1.com-error_log
CustomLog logs/site1.com-access_log common
</VirtualHost>
#site2.com
<VirtualHost *:80>
ServerAdmin admin@site2.com
documentRoot c:/apache2triad/htdocs/site2
ServerName www.site2.com
ServerAlias site2.com
ErrorLog logs/site2.com-error_log
CustomLog logs/site2.com-access_log common
</VirtualHost>
#localhost
<VirtualHost localhost:80>
ServerAdmin admin@localhost
documentRoot c:/apache2triad/htdocs
ServerName localhost
ErrorLog logs/localhost.com-error_log
CustomLog logs/localhost.com-access_log common
</VirtualHost> |
|
| Back to top |
|
Wrsaith
Joined: 24 Aug 2005
Posts: 19
|
| Posted: Sat Sep 03, 2005 11:34 pm Post subject: |
|
|
| why would I need to put a localhost vhost in? All three pages work properly now and wouldn't the localhost not be accessable from the net. sence you'd only be able to access localhost from my machine? |
|
| Back to top |
|
Joshua Meadows (DemoRic)
Joined: 29 Dec 2004
Posts: 783
Location: S.E. Kansas
|
| Posted: Sun Sep 04, 2005 3:16 pm Post subject: |
|
|
You are correct localhost is only accesable from your pc.
It just helps keep logs and such clearer, I find it helpful because I can tighten the security on my websites, and loosen it for localhost.
It's nothing critical, just helpful. |
|
| Back to top |
|
| |