Forum Moderators: phranque
I installed midgard on the web server and it setup a virtual host for me. The problem is, it isn't working. When I connect to my domain name from my computer on the local network, it opens the default web page that comes with Apache instead of midgard. Offsite, my fiends PC goes to the same webpage. When I connect to the local host name "stewie" using LYNX on the web server itself, it opens the midgard page (which is good)! But anywhere else (from the internet or via the local network), it does not(which is bad). If I change the ServerName in the virtual hosts file from stewie to anything else, Lynx will not go to the appropriate web page.
I think midgard doesn't set the virtual hosts up in any standard way. It doesn't create them in /etc/apache2/sites-enabled. It added the following to the end of apache2.conf:
#Include midgard's configuration
Include /etc/midgard/apache/httpd.conf
Contents of that file are:
LoadModule midgard_module /usr/lib/apache2/modules/midgard-apache2.so
Include /etc/midgard/apache/vhosts/[^\.#]*
One of those files in that directory has the following (stewie.domain.tld is not the real domain):
# This configuration is created by midgard_setup
<VirtualHost *:80>
# DIRECTIVES #
ServerName stewie
AddDefaultCharset utf-8
RLimitCPU 20 60
RLimitMem 67108864 134217728
DocumentRoot /var/lib/midgard/vhosts/stewie/80
ServerAlias stewie.domain.tld *.stewie.domain.tld
# MIDGARD settings
MidgardEngine on
MidgardBlobDir /var/lib/midgard/blobs/midgard
#MidgardRootfile /usr/lib/apache2/modules/midgard-root-nommp.php
MidgardRootFile /usr/lib/apache2/modules/midgard-root.php
MidgardPageCacheDir /var/cache/midgard/midgard
MidgardDefaultRealm Midgard
MidgardDatabase midgard midgard midgard
# PHP settings
php_admin_flag file_uploads On
php_flag magic_quotes_gpc Off
php_value memory_limit 50M
php_value post_max_size 50M
php_value upload_max_filesize 50M
# Uncomment if you want to redirect all midcom-admin requests to
# secured host. Keep in mind that mod_rewrite module is mandatory
# and should be loaded in Apache configuration.
# More docs about configuration may be found at:
# [midgard-project.org...]
eb
# --- SSL rewrite Start ---
#RewriteEngine On
#RewriteCond %{REQUEST_URI} !^/midcom-admin.*
#RewriteCond %{REQUEST_URI} !^/midcom-static.*
#RewriteCond %{REQUEST_URI} !\.(gif¦jpg¦css¦ico)$
#RewriteRule /(.*)$ [stewie...]
#RewriteEngine On
#RewriteCond %{REQUEST_URI} ^/midcom-admin.*
#RewriteRule /(.*)$ [stewie...]
# --- SSL rewrite End ---
# DIRECTORIES #
<Directory /var/lib/midgard/vhosts/stewie/80>
Options +SymLinksIfOwnerMatch
Allow from all
</Directory>
<Directory /var/cache/midgard/midgard>
Allow from all
</Directory>
<Directory /var/lib/midgard/vhosts/stewie/80/midcom-static>
Options -Indexes
<FilesMatch "\.(php)$">
Deny from all
</FilesMatch>
</Directory>
<Directory /var/lib/midgard/vhosts/stewie/80/midcom-static/midcom.helper.dataman
ager2/fckeditor>
Options -Indexes
<FilesMatch "\.(php)$">
Allow from all
</FilesMatch>
</Directory>
# LOCATIONS #
<Location /midcom-static/>
MidgardEngine Off
</Location>
</VirtualHost>
Do I have to enter anything into the Linux Hosts file? I have been playing with the virtual hosts names all afternoon and can't find out why it isn't working.