Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 10788  / 3 Years ago, sat, august 7, 2021, 6:36:01

I can't get my apache configuration to open my index.html

I edited my /etc/apache2/apache2.conf and added the following at the bottom.



<VirtualHost *:80>
DocumentRoot /media//DATA/directory/to/my/index-file/
ServerName host-test.com
</VirtualHost>


Then I restarted my system. But, when I open localhost I get the:




It works!



This is the default web page for this server.



The web server software is running but no content has been added, yet.




How to get localhost, with a different directory to my index, working in Ubuntu 12.10(amd64)?


More From » 12.10

 Answers
2

If you want to access the data via the name localhost, change the ServerName directive from host-test.com to localhost.



You can also set wildcards for the server name, to deliver the files under several names.



You should consider reading the Apache Documentation section regarding Virtual Hosts.



More important: take a look at the directory /etc/apache2/sites-enabled and /etc/apache2/sites-available. This is where your site configurations should go for easy maintenance, not in the main apache2.conf file. Your VHost definition might even interfere with the default host definition. You can run sudo a2dissite default to disable the demo site.


[#34629] Sunday, August 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wheance

Total Points: 314
Total Questions: 96
Total Answers: 112

Location: Benin
Member since Thu, Aug 12, 2021
3 Years ago
;