logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: 404 error on DocumentRoot doesn't return index.html
Author
apachenubking



Joined: 25 Jan 2018
Posts: 1

PostPosted: Fri 26 Jan '18 6:39    Post subject: 404 error on DocumentRoot doesn't return index.html Reply with quote

Hi,

My issue is that I cannot access files (index.html) stored in /var/www via the browser that is on my server through the browser. So, when I do the following:
www.somename.com, I get a valid page, but when I do the following: www.somename.com/index.html, I get a 404 page.

My 000-default.conf file is the following:

NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin aaa@gmail.com
DocumentRoot /var/www
ServerName www.somename.com
ProxyRequests Off
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

</VirtualHost>

Please let me know if you need more information to help me resolve my issue. I have been stumped for several days now.

Cheers,
Back to top
mraddi



Joined: 27 Jun 2016
Posts: 152
Location: Schömberg, Baden-Württemberg, Germany

PostPosted: Wed 31 Jan '18 0:48    Post subject: Reply with quote

Hello,

I guess you already have checked that there is a /var/www/index.html when trying to access www.somename.com/index.html ? Smile

Question Who/what is creating/serving the data when you access www.somename.com ? Apache running on port 80 or is it only acting as a reverse proxy for some other webserver (tomcat?) running on the same box on port 8080?

Exclamation Have a look at the line
Code:
ProxyPass / http://127.0.0.1:8080/

With this config you tell your apache to fetch every ressource (including the index.html) from the server running on port 8080.

So please ensure that either your port-8080-service has access to the index.html or forward only the needed ressources to the port-8080-service and let apache handle the rest (read the static files from the harddrive).

Additional: to clean up your config I would remove the "ProxyRequests"-line and the "<Proxy> ... </Proxy>"-stuff as it is needed for using apache as a forward proxy.
Back to top


Reply to topic   Topic: 404 error on DocumentRoot doesn't return index.html View previous topic :: View next topic
Post new topic   Forum Index -> Apache