LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-10-2007, 07:17 PM   #1
eagletalontim
Member
 
Registered: Jan 2006
Posts: 34

Rep: Reputation: 15
Question 2+ sites, 1 ip...is this possible?


I have just installed Linux Suse 10.0 on my computer at my house and fowarded 2 domain names to my ip address. I have tried all i can, but i cannot figure out how to make it to where www.site1.com goes to a certain folder and www.site2.com goes to another folder. basically, i want to run more than one site from my server without them showing the same thing when accessed.

any help would be greatly appreciated!
 
Old 02-10-2007, 07:42 PM   #2
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
This what you are after if using Apache.
http://httpd.apache.org/docs/1.3/vhosts/

Brian
 
Old 02-10-2007, 10:07 PM   #3
eagletalontim
Member
 
Registered: Jan 2006
Posts: 34

Original Poster
Rep: Reputation: 15
ok, i tried everything on there, but it is still not working. both domains are still going to to the default folder. Do i have to have the domains pointing to a Nameserver in order for apache to detect the site? both domains are just fowarded to my ip address. there are no nameservers set.
 
Old 02-10-2007, 10:25 PM   #4
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I think you will need to set up nameservers. Have you looked at www.zoneedit.com?
 
Old 02-11-2007, 01:51 AM   #5
eagletalontim
Member
 
Registered: Jan 2006
Posts: 34

Original Poster
Rep: Reputation: 15
i was trying to find a way around having to use nameservers. is there any way to have several sites on one ip address with no nameservers set?
 
Old 02-11-2007, 02:10 AM   #6
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I don't know enough about the technicalities of apache/browsers, but I would have thought that as soon as you forward you lose the name information.

Why do you want to avoid nameservers? It's easy and zoneedit won't charge for < 5 domains
 
Old 02-11-2007, 08:47 AM   #7
Samoth
Member
 
Registered: Apr 2005
Distribution: Exherbo
Posts: 474
Blog Entries: 1

Rep: Reputation: 32
What would happen if you set up a NAT firewall, have two NICs on the server(each with a different IP) and then set up port forwarding on the NAT firewall. So, one server runs on port :80 and the other one runs on :8080. When you go to :80 on the NAT side, it routes you to the :80 apache server, and when you go to :8080 on the NAT side, it forwards it to the :8080 apache server.
Code:
   |                                |(:8080)
   |(Internet)                      |
---------------------(NAT)----------|           (Both same comp but different NICs.
   |                                |(:80)
   |
 
Old 02-11-2007, 02:33 PM   #8
eagletalontim
Member
 
Registered: Jan 2006
Posts: 34

Original Poster
Rep: Reputation: 15
ok, i found out that on Godaddy, you can set the total dns control host to the ip address of the server. i have already done that on 2 domains. now insead of both domains going directly to the ip address in the address bar, it now shows just the domain. Now, what do i have to do to make the server recognize what domain is what and point them to different folders? I already tried to add virtual hosts with the httpd.conf, but nothing is working. here is my config:

PHP Code:
NameVirtualHost *

<
VirtualHost *>
ServerAlias site1.com *.site1.com
ServerName www
.site1.com
DocumentRoot 
/home/site1/public_html
</VirtualHost>

<
VirtualHost *>
ServerAlias site2.com *.site2.com
ServerName www
.site2.com
DocumentRoot 
/home/site2/public_html
</VirtualHost
Thanks!
 
Old 02-11-2007, 02:38 PM   #9
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
btw, you may have issues trying to access /home directories from apache
 
Old 02-11-2007, 02:45 PM   #10
eagletalontim
Member
 
Registered: Jan 2006
Posts: 34

Original Poster
Rep: Reputation: 15
yes. they always say access denied. is there a way around that?
 
Old 02-11-2007, 05:11 PM   #11
Samoth
Member
 
Registered: Apr 2005
Distribution: Exherbo
Posts: 474
Blog Entries: 1

Rep: Reputation: 32
The most likely reason you are getting "access denied" is because the files have to be ownable by "apache.apache". I wouldn't know how to fix it, just pointing out the reasons ;-)
 
Old 02-11-2007, 11:52 PM   #12
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
Quote:
they always say access denied. is there a way around that?
Have a look at this,

http://www.mjmwired.net/resources/mj...ual-sites.html
http://httpd.apache.org/docs/2.0/howto/public_html.html

--
Prasanta
 
Old 02-15-2007, 12:48 PM   #13
arroquant
LQ Newbie
 
Registered: Dec 2006
Location: indonesia
Distribution: ubuntu feisty fawn, slackware 11/12
Posts: 12

Rep: Reputation: 0
Quote:
Originally Posted by eagletalontim
I have just installed Linux Suse 10.0 on my computer at my house and fowarded 2 domain names to my ip address. I have tried all i can, but i cannot figure out how to make it to where www.site1.com goes to a certain folder and www.site2.com goes to another folder. basically, i want to run more than one site from my server without them showing the same thing when accessed.

any help would be greatly appreciated!
its actually quite easy if you read and follow the instruction given in the apache manual in vhost section.

i've set up apache on 2 machines with mass vhost setting. so i can manage all the vhosts easily.

this is some part from the httpd.conf which set up the dynamic "virtual-host"ing
Code:
# get the server name from the reverse DNS of the IP address
UseCanonicalName DNS

# include the IP address in the logs so they may be split
LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon

# include the IP address in the filenames
VirtualDocumentRootIP /www/hosts/%0/docs
VirtualScriptAliasIP  /www/hosts/%0/cgi-bin
with this, if i want to host a new domain (www.asik.com for example), all i have to do is only creating directory "/www/hosts/www.asik.com/", and put the web files on directory "/www/hosts/www.asik.com/docs/". and then restart/reload the apache daemon.

and the thing after that, of course you have to deal with nameserver you're connected with. so that all request for your page/domain should be redirected to your webserver.



Keyword: "Apache Manual", "mass vhost"

Last edited by arroquant; 02-15-2007 at 01:06 PM.
 
Old 02-15-2007, 01:08 PM   #14
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Fedora 8, Centos 5.1
Posts: 480

Rep: Reputation: 30
Why not set apache user home to say /home/apache, make a directory called htdocs1 and htdocs2, then set it up from your apache conf file. If permissions are borked, try running something like this from console as root/su.

Code:
chown -R apache.apache /home/apache
Also running two servers on two different ports is a really long winded way of solving a simple problem. Using vhost's you can do both sites from one conf file and one server. The only time you would need a second server is if you wanted apache-ssl and didnt want to use mod_ssl.

Last edited by v00d00101; 02-15-2007 at 01:10 PM.
 
  


Reply

Tags
custom, debian, installer


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Client cannot open few https://.. sites i.e. secure sites rajeshghy Linux - General 1 11-02-2006 07:30 AM
Sites sandman545 Linux - Newbie 3 05-26-2005 12:04 AM
Any Other Sites Like Alienware? Nukem General 4 12-19-2004 04:37 PM
Blocking some sites... gani *BSD 2 11-05-2004 10:07 PM
VL sites aus9 VectorLinux 1 11-19-2003 12:13 AM


All times are GMT -5. The time now is 09:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration