0

I want to serve a specific documentroot on port 8000

I tried creating a .conf file in /etc/httpd/conf.d:

Listen 8000
<VirtualHost *:8000>
    DocumentRoot "/newwebroot"
</VirtualHost>

On nginx this is relatively simple, you just define a server block for the port and webroot, on Apache nothing I tried seems to be working.

I can see httpd listening on port 8000, so that is working, it just shows the main test page from /var/www/html/

Please note, it is supposed to be working using the server IP, not a domain, hence leaving out the ServerName directive.

CentOS / Apache 2.4

2 Answers2

0

As for your conf.d DocumentRoot is /newwebroot not /var/www/newwebroot is that true?

Have you checked that folder owner-permissions? Have you checked Apache's logs? Are there any errors?

Kyrie001
  • 1
  • 3
  • 1
    what you state about the webroot is true, there is an error in the error log though: `client denied by server configuration: /newwebroot/`. I tried changing the owner and group to apache, but no change – Misterr Moron May 14 '18 at 09:03
0

This seems to be working:

Listen 8000
<VirtualHost *:8000>
    DocumentRoot "/newwebroot"
    <Directory /newwebroot>
      Require all granted
    </Directory>
</VirtualHost>

You need to give access to the actual folder apparantly