[SOLVED] Virtual Host Configuration with Owncloud.org
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello all. It's been a while since I've had to tangle with Apache as I'm sure it will show here soon enough. 8^)
The configuration:
I was lucky enough to know someone that works at an ISP. I have a server I bought racked at this location. I can take advantage of their battery backup, diesel generator, more reliable power, etc. The only disadvantage is that I'm at the mercy of their response for things like DNS modifications, etc. The staff stay slammed so I can't really complain since it's all free. Anyhow, I have hsvlug.org which has phpBB3 serving out forum layout for our local LUG. It's running CentOS 5.8 32-bit.
The issue:
So I've come across this fantastic solution for syncing my content my way called owncloud (http://owncloud.org) so I can sync contacts, pictures, media, etc. to my own server. As you may have guessed, this means I'll have to figure out a way to setup owncloud with an existing website. I've been reading up on Virtual Hosts and I think I have my head wrapped around it all. I believe perhaps I'm just missing a few lines somewhere before this will work. Traveller is the name of the ISP where my server lives and I've got it currently configured to talk to them for my nameserver needs - ns1.traveller.com and ns2.traveller.com.
Within the VirtualHost section of my /etc/httpd/conf/httpd.conf, I've defined the following:
Code:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html/owncloud
ServerName own.hsvlug.org
ServerAdmin email@email.com
ErrorLog logs/own.hsvlug.org-error_log
CustomLog logs/own.hsvlug.org-access_log common
<Directory /var/www/html/owncloud>
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex /var/www/html/owncloud
</Directory>
</VirtualHost>
What I keep thinking about is that own.hsvlug.org was something I just came up with - not hard-coded anywhere. Shouldn't this entry be in their DNS before it will answer?
Has anyone ever setup owncloud on a web server where there was already an existing site being used?
I think that as long as that server answers hsvlug.org, the own bit doesn't need to be in a DNS entry. This server would get hsvlug.org traffic and if you've got virtual hosts enabled and configured correctly, it will know what to do with own.hsvlug.org. My setup for owncloud is fairly similar. I've got a no-ip.org domain that points at my server, and the virtual hosting figures out the top level stuff. In fact I've got a bunch of top level sites on that server that aren't in a DNS.
Ok. Then apparently I really am missing something because own.hsvlug.org is not answering. What could I be doing wrong? Is there something else required of me before queries are returned properly?
I'm pretty confident a DNS entry has to exist after thinking about this one for a while. I suppose the question now is, what should the DNS entry look like so I can tell my ISP what to do on their DNS server?
Ok, so I've verified that a DNS entry does indeed have to exist before this will work. So, I've had the ISP include the entry for the sub-domain and now it works. However, I'm no longer able to access hsvlug.org as it seems to point to the same location. The DNS entry has the same IP as the parent domain, but I believe my virtual hosts file is incorrect. The way I currently have apache configured is this:
owncloud.conf has the following information:
Quote:
<IfModule mod_alias.c>
Alias /owncloud /var/www/html/owncloud/
</IfModule>
<Directory /var/www/html/owncloud/>
Options None
Order allow,deny
allow from all
</Directory>
<VirtualHost *:80>
ServerAdmin myemail@myemail.com
DocumentRoot /var/www/html/owncloud
ServerName own.hsvlug.org
ErrorLog logs/own.hsvlug.info-error_log
CustomLog logs/own.hsvlug.info-access_log common
</VirtualHost>
The /etc/httpd/conf/httpd.conf does not have the NameVirtualHost section uncommented. Instead, I have a line at the end that says:
Quote:
Include /etc/httpd/conf/owncloud.conf
Does this look right? The goal here is to have hsvlug.org have its own web page and own.hsvlug.org to have its own.
Last edited by loadedmind; 10-04-2012 at 10:11 AM.
What seems to be happening is that when I enable VirtualHost within httpd.conf, the server will only display the login page for owncloud as if that's its DocumentRoot somehow. The goal here is to have hsvlug.org display the default phpBB3 forum that it's supposed to and for own.hsvlug.org to answer to owncloud login so they stay separate. For reference, here's my httpd.conf without comments:
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName Off
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/error/"
<IfModule mod_negotiation.c>
<IfModule mod_include.c>
<Directory "/var/www/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
ForceLanguagePriority Prefer Fallback
</Directory>
NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *:80>
ServerAdmin loadedmind@gmail.com
ServerName own.hsvlug.org
ServerAlias own.hsvlug.org
DocumentRoot /var/www/html/owncloud
ErrorLog logs/own.hsvlug.org-error_log
CustomLog logs/own.hsvlug.org-access_log common
DirectoryIndex index.php
<Directory /var/www/html/owncloud>
AllowOverride None
Options None
Order allow,deny
Allow from all
Options FollowSymLinks
</Directory>
</VirtualHost>
I think I have a problem with my syntax somewhere. Can anyone with a successful virtual host configuration tell me where my issue is? Thanks ahead of time.
Ok, I totally get it now. I was assuming (bad...BAD!) that the first portion of the configuration file was for a parent domain. This totally worked! I sure appreciate it!
Last edited by loadedmind; 10-04-2012 at 04:48 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.