Right, so here's what I've got.
Ubuntu Server 8.10 running Apache 2.2, with the modem configured for DDNS (
http://remotejcnet.homeip.net).
Now, I would like to have multiple sites on the one server, so we turn to Virtual Hosts. I have read many tutorials, but I believe the way my Apache was installed causes me some issues. (Thx aptitude)
Apache uses apache2.conf as its main configuration file, and here are the contents of that:
ServerRoot "/etc/apache2"
ServerName jcserv
ServerAdmin MY_EMAIL@yahoo.com
LockFile /var/lock/apache2/accept.lock
PidFile /var/run/apache2.pid
TimeOut 300
KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
DefaultType text/plain
HostNameLookups off
ErrorLog /var/log/apache2/error.log
LogLevel warn
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/ports.conf
Include /etc/apache2/conf.d/
Include /etc/apache2/sites-enabled/
Include /etc/apache2/awstats.conf
Alias /error/include/ "/your/include/path/"
Alias /error/ "/usr/share/apache2/error/"
<Directory "/usr/share/apache2/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en cs de es fr it nl sv pt-br ro
ForceLanguagePriority Prefer Fallback
</Directory>
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.php
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
ErrorDocument 410 /error/HTTP_GONE.html.var
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
DocumentRoot /var/www/remotejcnet.homeip.net
-
- ServerRoot "/etc/apache2"
- ServerName jcserv
- ServerAdmin MY_EMAIL@yahoo.com
-
- LockFile /var/lock/apache2/accept.lock
- PidFile /var/run/apache2.pid
-
- TimeOut 300
- KeepAlive on
- MaxKeepAliveRequests 100
- KeepAliveTimeout 15
-
- <IfModule mpm_prefork_module>
- StartServers 5
- MinSpareServers 5
- MaxSpareServers 10
- MaxClients 150
- MaxRequestsPerChild 0
- </IfModule>
-
- <IfModule mpm_worker_module>
- StartServers 2
- MaxClients 150
- MinSpareThreads 25
- MaxSpareThreads 75
- ThreadsPerChild 25
- MaxRequestsPerChild 0
- </IfModule>
-
- User ${APACHE_RUN_USER}
- Group ${APACHE_RUN_GROUP}
-
- AccessFileName .htaccess
-
- <Files ~ "^\.ht">
- Order allow,deny
- Deny from all
- </Files>
-
- DefaultType text/plain
-
- HostNameLookups off
-
- ErrorLog /var/log/apache2/error.log
- LogLevel warn
- LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
- LogFormat "%h %l %u %t \"%r\" %>s %b" common
- LogFormat "%{Referer}i -> %U" referer
- LogFormat "%{User-agent}i" agent
- CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
-
- Include /etc/apache2/mods-enabled/*.load
- Include /etc/apache2/mods-enabled/*.conf
-
- Include /etc/apache2/ports.conf
- Include /etc/apache2/conf.d/
- Include /etc/apache2/sites-enabled/
- Include /etc/apache2/awstats.conf
-
- Alias /error/include/ "/your/include/path/"
-
- Alias /error/ "/usr/share/apache2/error/"
-
- <Directory "/usr/share/apache2/error">
- AllowOverride None
- Options IncludesNoExec
- AddOutputFilter Includes html
- AddHandler type-map var
- Order allow,deny
- Allow from all
- LanguagePriority en cs de es fr it nl sv pt-br ro
- ForceLanguagePriority Prefer Fallback
- </Directory>
-
- ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
- ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
- ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
- ErrorDocument 404 /error/HTTP_NOT_FOUND.php
- ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
- ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
- ErrorDocument 410 /error/HTTP_GONE.html.var
- ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
- ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
- ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
- ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
- ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
- ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
- ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
- ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
- ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
- ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
-
- DocumentRoot /var/www/remotejcnet.homeip.net
-
-
Right now I have it running with only the default host running, so it works when you go to
http://remotejcnet.homeip.net/, and the code for that is as follows:
<VirtualHost *>
DocumentRoot /var/www/remotejcnet.homeip.net
<Directory "/var/www/remotejcnet.homeip.net">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
-
- <VirtualHost *>
- DocumentRoot /var/www/remotejcnet.homeip.net
- <Directory "/var/www/remotejcnet.homeip.net">
- allow from all
- Options +Indexes
- </Directory>
- </VirtualHost>
-
What I would like to do is add another domain to my DynDns.Org account and have the webserver serve a different page.
Thank you in advance to those that help, or at least try, to get this to work.
