Hey everyone. Long story short i installed Centos web panel. Its amazing so far. This is my second time installing it as i messed something up the first time, first time i was able to change the apache template in each directory itself and it would change. Now i cant...I followed http://forum.centos-webpanel.com/apache/default-page-displayed-for-all-domains/ didnt work.

First time around i followed http://www.servermom.org/basic-configuration-centos-web-panel/2009/ and http://www.servermom.org/activate-varnish-cache-server-cwp/2021/ and it worked. I went through it again. Didnt work this time. In my logs though it says:

File does not exist: /var/www/html/search
Directory index forbidden by Options directive: /var/www/html/
File does not exist: /var/www/html/search
File does not exist: /var/www/html/albums
Directory index forbidden by Options directive: /var/www/html/

I looked, it doesnt exist. Im lost on what to do here.

Apache port is 82
Varnish is 80

http://www.whatismyip.com/server-headers-check/ ----For one of my domains

HTTP/1.1 200 OK
Date: Sat, 21 Feb 2015 06:30:07 GMT
Server: Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_antiloris/0.4
Last-Modified: Fri, 20 Feb 2015 22:17:45 GMT
ETag: "1822837-123e-50f8c6bfb8ed6"
Accept-Ranges: bytes
Content-Length: 4670
Connection: close
Content-Type: text/html; charset=UTF-8

Dani AI

Generated

— the most common causes for “Apache page shows up for all domains” when you have Varnish in front of Apache are: Apache’s name‑based vhosts aren’t matching because they’re defined on the wrong port (or NameVirtualHost wasn’t enabled for the backend port), Varnish is forwarding a Host header that Apache doesn’t recognise (so Apache falls back to the first/default vhost), or SELinux/permissions block Apache from reading the real DocumentRoot. ’s suggestion to check the filesystem is the right first step; after that focus on vhost/port and proxy headers. See Apache’s name‑based vhost rules for how the server picks the default vhost. (https://httpd.apache.org/docs/2.2/vhosts/name-based.html). (httpd.apache.org)

Quick, focused checks (run these on the server and inspect the output):

sudo apachectl -S
curl -I -H "Host: yourdomain.tld" http://127.0.0.1:82/
curl -I http://yourdomain.tld/           # goes through Varnish on :80
sudo ss -ltnp | grep :82
sudo grep -R "<VirtualHost" /etc/httpd

What to look for: apachectl -S shows which vhost Apache thinks is primary and which port each vhost is bound to; if your sites are declared for *:80 but Apache is serving on :82, they won’t match. The curl that targets 127.0.0.1:82 checks Apache directly and shows whether Apache would serve the correct vhost given the Host header. See the vhost and apachectl documentation. (https://httpd.apache.org/docs/current/vhosts/index.html). (httpd.apache.org)

Varnish specifics: inspect your VCL (usually /etc/varnish/default.vcl) and the backend stanza. By default Varnish forwards the client Host header to the backend, but a backend .host_header or VCL logic can override it — that will make Apache see a different Host and fall back to the default site. If you need a quick proof/fix you can set the backend to use the correct port and host header, e.g.:

backend default {
  .host = "127.0.0.1";
  .port = "82";
  .host_header = "yourdomain.tld";
}

Check the Varnish docs for .host_header and host forwarding behavior. (https://varnish-cache.org/docs/; see VCL backends). (varnish-cache.org)

If your sites live under /home/USER/public_html on CentOS, SELinux can silently block Apache. Verify httpd booleans and file contexts, and restore the proper label if needed:

getsebool httpd_enable_homedirs
getsebool httpd_read_user_content
ls -Z /home/USERNAME/public_html
sudo restorecon -Rv /home/USERNAME/public_html

If SELinux is enforcing and home-dir booleans aren’t set, Apache may not serve files even when they exist. See the RHEL/CentOS SELinux docs about httpd booleans and file contexts. (docs.redhat.com)

Summary: use apachectl -S + direct curl to :82 to confirm Apache’s view, then check Varnish VCL (host header / backend port), and finally SELinux/file permissions. One of those three is almost always the root cause. (httpd.apache.org)

Are you able to SSH and login as root?

Try to go into the html directory. #cd /var/www/html

from there just run #ls -al (this will show what files exist)

Also I would check - /home/USERNAME/public_html/ and run #ls -al to see if index.html exists. If you have root access change USERNAME to root or you can always #cd /home/ then #ls -al and see what users exist.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.