Home > Virtual Host > Apache Document Root Not Working

Apache Document Root Not Working


I understand precedence here but the site is being called directly locally so I'm confused why Apache isn't directing traffic to the right place. Example: NameVirtualHost *:80 # This would be correct. ServerName some.domain.com # Options and stuff defined here. # This is wrong. # Options and stuff defined here, It works fine if I replace index.html by index.php. Example: # Can happen when using multiple config files. # In one config file: Listen 80 # In another config file: Listen 80 # Like above, can happen when using multiple http://emhsoft.net/virtual-host/apache-virtual-host-document-root-not-working.php

Seemed like the easiest solution. The AllowOverride All stanza would allow the reading of that file, which is an Apache dynamic configuration file for that directory. –Christopher Jun 3 '14 at 11:08 Thanks Christopher. Example: ScriptAlias /cgi-bin/ /var/www/cgi-bin/ AllowOverride None Options Indexes ExecCGI DirectoryIndex index.cgi # Other options defined. Script aliased directories do not allow directory listings specified with Options Indexes -- this Look at the bottom of your httpd.conf file for examples.

Apache Namevirtualhost

Armistice Day Challenge Lab colleague uses cracked software. It's contents override the configuration directives in /etc/apache2/sites-enabled/000-default. No matching NameVirtualHost some.domain.com line. # Options and stuff defined here. # This would be correct. ServerName some.domain.com # Options and stuff defined here. Why is Adv Reply September 17th, 2013 #4 sefs View Profile View Forum Posts Private Message Iced Almond Soy Ubuntu, No Foam Join Date Apr 2006 BeansHidden!

It's wrong on a couple levels. You previously marked this answer as accepted. Forum Host Your Site Server Configuration, Apache & URL Rewriting Apache Config - Document Root not taking The SitePoint Forums have moved. _default_ Virtualhost Overlap On Port 80, The First Has Precedence umlaute not rendered correctly What episode of Star Trek is this creature on?

IP-based virtual hosting Mixed port-based and ip-based virtual hosts Mixed name-based and IP-based vhosts Using Virtual_host and mod_proxy together Using _default_ vhosts Migrating a name-based vhost to an IP-based vhost Using How do I deal with my current employer not respecting my decision to leave? This site is not affiliated with Linus Torvalds or The Open Group in any way. https://httpd.apache.org/docs/2.4/vhosts/examples.html Yes, I'm sure.

For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any Apache Virtual Host Example Why were pre-election polls and forecast models so wrong about Donald Trump? Log In to Answer Copyright © 2016 DigitalOcean™ Inc. That resolved my problem.

Apache Virtual Host Not Working

What might cause a situation like this, and why then did it initially work properly? http://www.sitepoint.com/forums/showthread.php?364435-Apache-Config-Document-Root-not-taking share|improve this answer answered Jun 3 '14 at 11:39 Christopher 5,3491329 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign Apache Namevirtualhost When I say httpd -S it says: $ sudo /usr/sbin/httpd -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: _default_:443 aa.local (/etc/httpd/conf.d/ssl.conf:81) *:* aa.local (/etc/httpd/conf/httpd.conf:974) *:80 is a NameVirtualHost default server testing.aa.local Namevirtualhost Has No Effect This seems to happen when one is using multiple virtual host configuration files and doesn't understand that you only need to define a particular NameVirtualHost line once.

Quine Anagrams! (Cops' Thread) How do we know that Kalendae is the first day of a month? this contact form If someone could explain why noelforte.com was running as default-000 as seen here: port 80 namevhost noelforte.com (/etc/apache2/sites-enabled/000-default:1) that would help shed some light on what may have been misconfigured. Ask Ubuntu works best with JavaScript enabled current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. The time now is 05:15 PM. Apache Virtual Host Wrong Document Root

This means your users will get a certificate mismatch warning when trying to access some.domain2.com. Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Modules | Directives | FAQ | Glossary | Sitemap current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. have a peek here LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from ::1/128 I have also added

Apache will ignore the second directive and use the first defined NameVirtualHost line, though. Apache Default Virtual Host Note Any of the techniques discussed here can be extended to any number of IP addresses. share|improve this answer answered Dec 23 '13 at 19:27 Noel Forte 1281212 I had the same issue, for me it was because the ServerName was set the same as

Join them; it only takes a minute: Sign up virtual hosts DocumentRoot not being changed up vote 5 down vote favorite 2 Don't think my virtualhost is working correctly.

Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK) Client and (unpaid) WHB Ambassador mod_rewrite Tutorial Article (setup, config, test & write mod_rewrite regex w/sample code) and Code Generator Apr 8, Multiple SSL name based virtual hosts on the same interface. How do I deal with my current employer not respecting my decision to leave? Apache Virtual Host Directory Listen Listen Listen Listen DocumentRoot "/www/example1-80" ServerName www.example.com DocumentRoot "/www/example1-8080" ServerName www.example.com DocumentRoot "/www/example2-80" ServerName www.example.org

Mixed port-based and ip-based virtual hosts The server machine has two IP addresses ( and which resolve to the names www.example.com and www.example.org respectively. Can series converge even if the general term does not have limit? The example below illustrates that the name-matching takes place after the best matching IP address and port combination is determined. Check This Out Join Date Sep 2007 Location USA Beans 329 DistroUbuntu 13.10 Saucy Salamander Re: Apache Name-Based Virtual Host Not Pointing Originally Posted by nerdtron Here's my 3 domain setup and the contents

How do you simplify a log with an exponent in the base? regards Mellowhost - Affordable Cpanel and WHM Reseller Hosting R1Soft, RVSitebuilder, RVSkin, Softaculous, Fantastico Learn Hosting Apr 6, 2006,23:42 #9 Hero Doug View Profile View Forum Posts SitePoint Addict Join Date Make sure you crtl+f5 when refreshing in the browser too. Log In Sign Up Report a Bug Use this form to report bugs related to the Community Report a bug: Search: Httpd Wiki Login CommonMisconfigurations FrontPageRecentChangesFindPageHelpContentsCommonMisconfigurations Immutable PageCommentsInfoAttachments More Actions: Raw

Running different sites on different ports. Such virtual hosts will only be used for HTTP requests received on connection to the specified IP address.