Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Mar 15, 2009 10:37 pm 
Offline
Senior Newbie

Joined: Sun Mar 15, 2009 9:40 pm
Posts: 7
This is my first forray into setting up virtual hosts. I am moving 4 sites from Lunarpages to a linode. I set up a basic html page as a place holder for each of the four sites. One of the sites I simply switched the domain servers to linodes'. One of the others I used the import zone feature from linodes domain manager. The other two I left alone for now. Ok so I initally set up Apache, punched the ip into the browser and got the "IT WORKS!". Great. I then set out to set up some virtual hosts to handle the multiple sites.
- I created directories for each of the sites in /var/www/public_html/domainname/public,private,log,etc...
- I created a basic html file for each site and placed it /var/www/public_html/domainname/public/index.html
- I edited the apache2.conf file and added the lines
Include /etc/apache2/sites-enabled/
ServerName 97.107.133.117
NameVirtualHost *:80
<IFModule mod_ssl.c>
NameVirtualHost *:443
</IFModule>
- I created a vhost file for each domain and placed them /etc/apache2/sites-available/domain1.com
the content of the file was:
# Place any notes or comments you have here
# It will make any customisation easier to understand in the weeks to come

# domain: domain1.com
# public: /home/var/www/public_html/domain1.com/

<VirtualHost *:80>

# Admin email, Server Name (domain name) and any aliases
ServerAdmin webmaster@domain1.com
ServerName 97.107.133.117
ServerAlias www.domain1.com


# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /home/var/www/public_html/domain1.com/public


# Custom log file locations
LogLevel warn
ErrorLog /home/var/www/public_html/domain1.com/log/error.log
CustomLog /home/var/www/public_html/domain1.com/log/access.log combined

</VirtualHost>

-I used the command sudo a2ensite domain1.com for each of the sites. I rebooted Apache after each.

The problem is: I point the browser at the IP 97.107.133.117 and the default html does not show. I am not sure if I set things up right. Any help or comments would be appreciated


Top
   
 Post subject:
PostPosted: Fri Apr 03, 2009 5:28 am 
Offline
Newbie

Joined: Thu Mar 05, 2009 8:36 am
Posts: 2
Im fairly new myself, so i dont know how (if possible) to point a IP to a number of vhosts.
Try setting up DNS, and try it with your config.

I think the problem is that you have the servername set to your IP address, if this is the same for each vhost, apache cant distinguish where to point to.

This is a sample of one of my vhosts.

Code:
<VirtualHost *:80>
    ServerAdmin webmaster@domain.tld
    DocumentRoot "/srv/http/domain.tld"
    ServerName domain.tld
    ServerAlias domain.tld
    ErrorLog "/var/log/httpd/domain.tld.error_log"
    CustomLog "/var/log/httpd/domain.tld.access_log" common
</VirtualHost>


Top
   
 Post subject:
PostPosted: Sun Apr 05, 2009 4:26 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Requests to the numeric IP address should go to the first virtual host for that IP http://httpd.apache.org/docs/2.0/vhosts/name-based.html#compat.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group