Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: vhosts config issue |
|
Author |
|
jfullen
Joined: 16 Mar 2009 Posts: 2
|
Posted: Mon 16 Mar '09 6:13 Post subject: vhosts config issue |
|
|
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 |
|
Back to top |
|
glsmith Moderator

Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 16 Mar '09 17:36 Post subject: |
|
|
Is your first vhost in your config a duplicate of the main server config? |
|
Back to top |
|
jfullen
Joined: 16 Mar 2009 Posts: 2
|
Posted: Mon 16 Mar '09 19:40 Post subject: |
|
|
If you are referring to the default vhost in the sites-available/ folder; then it is different. Apache already had this file.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost> |
|
Back to top |
|
|
|
|
|
|