Home > Virtual Host > Apache Virtual Host Wrong Document Root

Apache Virtual Host Wrong Document Root

Contents

See How do I write a good answer? –David Foerster Apr 7 '15 at 10:55 1 You only need to put a + or - before the various Options if It also shows the path to the configuration file and line number where this configuration is set. Start building on our Managed Cloud today. Thanks. http://seesbg.com/virtual-host/virtual-host-apache.html

However you can also use IP addresses to differentiate. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the 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 Line [2] reports the default virtual host that the web server ServerAlias for any requests for which no specific hostname is requested.

Apache Virtual Host Wrong Document Root

If you need more information, check the documentation. If the server is serving only one website, it serves the HTML in your /var/www/html directory, starting with index.html. The default error log is at /var/log/httpd/error_log on Red Hat systems and /var/log/apache2/error_log on Debian systems.

See here: http://unix.stackexchange.com/questions/106326/apache-virtual-host-pointing-to-wrong-documentroot/106396#106396 Reply Log In to Comment Have another answer? Following is the Apache configuration that produced this above error: NameVirtualHost \*:80 ServerName vh1.example.com DocumentRoot /var/www/vhosts/vh1 ServerName vh2.example.com DocumentRoot /var/www/vhosts/vh2 Note that the second VirtualHost directive This is completely expected behaviour... Apache Documentroot If I set up vhost config files for both of them, I can get "media.noelforte.com" working, but I can't seem to get "noelforte.com" pointing to the correct document root; it stays

For example, you have a subdomain called blog.domain1.com that is serving a blog. Apache Document Root Not Changing asked 2 years ago viewed 1202 times active 2 years ago Upcoming Events 2016 Community Moderator Election ends Nov 22 Related 0Why can Wordpress suddenly connect to the MySQL database server The httpd -S test command doesn’t warn you about this issue because it’s permissible to configure virtual hosts to use any port, such as 800, without them being part of the Start a coup online without the government intervening How do we know that Kalendae is the first day of a month?

For more information on virtual hosts, use the Apache document Name-base Virtual Hosts Troubleshooting This section shows you how to troubleshoot problems with Apache name-based virtual host configurations. Namevirtualhost TSA broke a lock for which they have a master key. Extract csv from .shp files? Why not just change the DocumentRoot to /Library/WebServer/Documents if that's what you want? –arco444 Oct 28 '14 at 14:35 I'm sorry, I missed out DocumentRoot "/Library/WebServer/Documents/" it's already there

Apache Document Root Not Changing

vBulletin 2000 - 2016, Jelsoft Enterprises Ltd. As a result, Apache treats vh2.example.com as a separate port-based virtual host. Apache Virtual Host Wrong Document Root If you are working with a minimal Apache configuration file, add a NameVirtualHost *:80 directive above the individual virtual host configurations. Apache Virtual Host Not Working UNIX is a registered trademark of The Open Group.

To help you map the preceding output to its configuration file, following is the virtual host configuration that created this error: NameVirtualHost \*:80 ServerName vh1.example.com DocumentRoot /var/www/vhosts/vh1 http://seesbg.com/virtual-host/apache-virtual-host-ubuntu.html Hosts not set up as name-based virtual hosts If running httpd -S reports the following warning: [Wed May 18 15:24:51 2011] [warn] \_default\_ VirtualHost overlap on port 80, the first has ubuntu apache-httpd apache-virtualhost share|improve this question edited Jun 6 at 16:12 Jeff Schaller 10.9k61939 asked Dec 23 '13 at 7:44 Noel Forte 1281212 add a comment| 2 Answers 2 active oldest Adv Reply September 16th, 2013 #2 bkline View Profile View Forum Posts Private Message Visit Homepage Quad Shot of Ubuntu Join Date Mar 2006 Location Arlington VA USA Beans 431 Apache Default Virtual Host

Can an object *immediately* start moving at a high velocity? Are you sure you want to replace the current answer with this one? Why do most microwaves open from the right to the left? have a peek here ServerName vh2.example.com DocumentRoot /var/www/vhosts/vh2 Now that that you’ve seen a basic virtual host configuration looks and how it maps to Apache’s own configuration report, you can use those reports to

Once you define a VirtualHost it will take precedence over default settings. –arco444 Oct 28 '14 at 15:48 add a comment| 1 Answer 1 active oldest votes up vote 2 down The server has two IP addresses. Restart Apache Before you can diagnose an issue, ensure that you have restarted Apache since the last time you made changes to your Apache configuration files: For Red Hat distributions use:

more hot questions question feed about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Science

Community Tutorials Questions Projects Tags Newsletter RSS Distros & One-Click Apps Terms, Privacy, & Copyright Security Report a Bug Get Paid to Write Almost there! server apache2 14.04 virtualhost apache2.4 share|improve this question edited Mar 15 '15 at 15:59 Ashish Gupta 1106 asked Apr 19 '14 at 15:47 Victor Bocharsky 2801311 Related: askubuntu.com/a/362992/8698 –Dan The following example shows the commented directive that caused the error: #NameVirtualHost \*:80 ServerName vh1.example.com DocumentRoot /var/www/vhosts/vh1 ServerName vh2.example.com DocumentRoot /var/www/vhosts/vh2 Element missing from VirtualHost On one (172.20.30.40), we will serve the "main" server, server.example.com and on the other (172.20.30.50), we will serve two or more virtual hosts.

Enabling and checking the access log may also be useful. You have multiple domains going to the same IP and also want to serve multiple ports. If you did create it, verify that there are no mistakes in the DocumentRoot directive. http://seesbg.com/virtual-host/apache-virtual-host-not-working.html This can stops users view all your files in your /images directory, for instance.

This lets you avoid editing your hosts file! Is there an actual army in 1984? If you do experience this error, you will probably see content from the default virtual host (vh1.example.com in this example) when you try to view the site in your web browser. A Simple Number Sequence Mimsy were the Borogoves - why is "mimsy" an adjective?