Welcome to the Linux Foundation Forum!

Lab 7.3 A clarification of where to put what.

I am using Ubuntu 18.04.5 . First I did the easy bit, editing /etc/hosts by adding the IP Address I used in Lab 7.2 with a tab to namevhost.example.com directly under the existing IPv4 entries. I put my namevhost.conf file in the /etc/apache2/sites-enabled/ directory. Line 2 reads: DocumentRoot /var/www/html/index.html . Line 8 reads DocumentRoot /namevhost/ index.html . The index.html file went under the /namevhost directory. That took some figuring out but worked in the end. I got an error message chcon: failed to get security context of '/var/www/html/index.html': No data available , from the #chcon-R --reference=/var/www/html/index.html /namevhost command. I guess I might have the Document Root wrong. I took it to be the one I created in Lab 7.1 .

Comments

  • Not working as well as I thought. I am getting "This is my IP vhost" when I should have "This is the namev host".

  • lee42xlee42x Posts: 283

    Hi TreverBell, As far as SELinux goes, set it to permissive mode while we work on the web server;
    "sudo setenforce 0" will temporarly allow SELinux errors to be ignored. You can check SELinux's stats with "sudo getenforce" (disabled or permissive is expected) The web server, make sure the hostname "namevhost.example.com" is the same in /etchosts/ and the namevhost.conf file in /etc/httpd/conf.d/namevhost.conf (assuming Red Hat family file locations. A name mismatch , even in the url can cause issues, I would use "delinks -dump http://namevhost.example.com/index.html" to test it. Notice the full name is used everywhere.

    Yes, we are using the directory "/namevhost" , perhaps not a great production choice but it shows the DocumentRoot really can be anywhere.

    Regards Lee

  • Thanks Lee. Those pointers helped and I got through the 7.x labs, OK.

Sign In or Register to comment.