LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


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

Rep: Reputation: 15
Unhappy multiple sites on linux??


I have linux suse 10.0 and was wondering how to set up multiple domains on my server. i have apache 2 already set up and running. i have no idea how to set up my domain to work without nameservers either. i have it fowarding to my ip address. will that work for other domains too?
 
Old 02-09-2007, 09:57 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Are you using some free domain service? I don't think they will let you do multiple domains unless you bump up to a pay account, but I could be wrong.

To run multiple sites, you will be using the "VirtualHost" function, which is actually pretty easy to work with.

Here is some information about setting it up in SuSE.
 
Old 02-09-2007, 10:08 PM   #3
eagletalontim
Member
 
Registered: Jan 2006
Posts: 34

Original Poster
Rep: Reputation: 15
the server is my own computer at my house. i have full access to everything. it is a brand new linux installation. i am just trying to figure out how to run more than 1 domain on my compter. I have looked up stuff about the virtualhost, but nothing seemed to work for me. i think it has to do with the nameservers....not sure though
 
Old 02-09-2007, 10:18 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Virtual hosts are the way to go. So long as the names servers point www.domain1/com and www.domain2.com to the proper IP address everything should work OK. I've set it up several times. The main thing is that you need to run name based virtual hosting instead of IP based (IP based is where each seperate site has its own IP). Can you post the virtual host section of your config file?
 
Old 02-09-2007, 10:27 PM   #5
eagletalontim
Member
 
Registered: Jan 2006
Posts: 34

Original Poster
Rep: Reputation: 15
here is the profilegens.conf file in my apache vhosts.d directory

PHP Code:
<VirtualHost profilegens.com:80>
    
ServerAdmin webmaster@profilegens.com
    ServerName profilegens
.com

    
# DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    
DocumentRoot /srv/www/vhosts/profilegens.com

    
# if not specified, the global error log is used
    
ErrorLog /var/log/apache2/profilegens.com-error_log
    CustomLog 
/var/log/apache2/profilegens.com-access_log combined

    
# don't loose time with IP address lookups
    
HostnameLookups Off

    
# needed for named virtual hosts
    
UseCanonicalName Off

    
# configures the footer on server-generated documents
    
ServerSignature On


    
# Optionally, include *.conf files from /etc/apache2/conf.d/
    #
    # For example, to allow execution of PHP scripts:
    #
    # Include /etc/apache2/conf.d/mod_php4.conf
    #
    # or, to include all configuration snippets added by packages:
    # Include /etc/apache2/conf.d/*.conf


    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    #
    
ScriptAlias /cgi-bin"/srv/www/vhosts/profilegens.com/cgi-bin/"

    
# "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have one, and where ScriptAlias points to.
    #
    
<Directory "/srv/www/vhosts/profilegens.com/cgi-bin">
    
AllowOverride None
    Options 
+ExecCGI -Includes
    Order allow
,deny
    Allow from all
    
</Directory>


    
# UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received.
    #
    # To disable it, simply remove userdir from the list of modules in APACHE_MODULES
    # in /etc/sysconfig/apache2.
    #
    
<IfModule mod_userdir.c>
    
# Note that the name of the user directory ("public_html") cannot simply be
    # changed here, since it is a compile time setting. The apache package
    # would have to be rebuilt. You could work around by deleting
    # /usr/sbin/suexec, but then all scripts from the directories would be
    # executed with the UID of the webserver.
    
UserDir public_html
    
# The actual configuration of the directory is in
    # /etc/apache2/mod_userdir.conf.
    
Include /etc/apache2/mod_userdir.conf
    
# You can, however, change the ~ if you find it awkward, by mapping e.g.
    # http://www.example.com/users/karl-heinz/ --> /home/karl-heinz/public_html/
    #AliasMatch ^/users/([a-zA-Z0-9-_.]*)/?(.*) /home/$1/public_html/$2
    
</IfModule>


    
#
    # This should be changed to whatever you set DocumentRoot to.
    #
    
<Directory "/srv/www/vhosts/profilegens.com">
    
    
#
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs-2.0/mod/core.html#options
    # for more information.
    #
    
Options Indexes FollowSymLinks
    
    
#
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    
AllowOverride None
    
    
#
    # Controls who can get stuff from this server.
    #
    
Order allow,deny
    Allow from all
    
    
</Directory>

</
VirtualHost
 
Old 02-10-2007, 12:42 AM   #6
eagletalontim
Member
 
Registered: Jan 2006
Posts: 34

Original Poster
Rep: Reputation: 15
bump,.....
 
Old 02-10-2007, 06:53 PM   #7
xjlittle
Member
 
Registered: Aug 2003
Location: Indiana
Distribution: fc6 sles9 & 10 kubuntu ubuntu-server
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
You will need each of your virtual domain names setup in dns for it to work. For a quick test put them in the hosts file of the machine that you are trying to access them from.
 
  


Reply


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
Bind configuration for multiple sub-domains on multiple sites JF1980 Linux - Networking 3 08-31-2006 01:28 PM
Easy way to host multiple sites on one IP BrettPower Linux - Networking 0 03-06-2004 10:49 PM
Multiple Apache Sites, on Multiple IP's, on Same Box?? RickyJ Linux - General 1 06-19-2003 10:55 AM
Multiple Apache Sites, on Multiple IP's, on Same Box?? RickyJ Linux - Software 0 06-19-2003 09:50 AM
Multiple FTP Sites on One server suomynona007 Linux - Networking 1 08-03-2002 01:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration