Get the "Apache HTTP Server Test Page powered by CentOS" page instead of my page now

2,054 views
Skip to first unread message

Nick Pilch

unread,
Jun 12, 2014, 8:28:21 PM6/12/14
to learnchef-funda...@googlegroups.com
I am getting the Apache HTTP Server Test Page powered by CentOS page instead of my page after completing the steps in Module 4. All previous steps have been successful. I am using CentOS 6.5 on my own VM in AWS. Everything else was working pretty fine (except I had to alter the IPTables to allow access to apache from outside the server because of CentOS 6.5). Any hints?

Nathen Harvey

unread,
Jun 12, 2014, 10:17:31 PM6/12/14
to learnchef-funda...@googlegroups.com
Nick,

I would definitely need to see more about your machine and chef set-up to be able to troubleshoot but here are some questions that might lead to the proper answer.

1.  Does your run list include the vhosts recipe?  knife node show module4 or check in the web interface.
2.  Have you uploaded the data bags properly?  knife data bag show vhosts or check in the web interface.
3.  Is your cookbooks/apache/recipes/vhosts.rb file correct?  Compare it with https://gist.github.com/9134977
4.  Is your cookbooks/apache/templates/default/custom-vhosts.erb file correct?  Compare it with https://gist.github.com/2866454

Hope that helps get you on the path to a solution!

Let us know.

Thanks,
Nathen

Nick Pilch

unread,
Jun 13, 2014, 2:36:47 AM6/13/14
to learnchef-funda...@googlegroups.com
Thanks much. Beside using a different machine, I am using hosted chef and chef client bootstrapping exactly like the webinars.

AWS AMI is http://thecloudmarket.com/image/ami-1a013c5f--centos-6-5-ga-03-3-f4325b48-37b0-405a-9847-236c64622e3e-ami-6be4dc02-2. Generated files look right:

The files seem to be generated correctly. Moving bears.conf and clowns.conf aside, when I access the website I get (from view source):

<h1>Hello, Webinar!</h1>

<p>My name is ip-172-31-2-241></p>

<p>We love </p>
<p>Served from 172.31.2.241:</p>

bears.conf looks like this:

 
<VirtualHost *:80>
  ServerAdmin webmaster@localhost
 
  DocumentRoot /srv/apache/bears
  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>
  <Directory /srv/apache/bears>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
  </Directory>
</VirtualHost>

clowns.conf looks like this:

  Listen 81
 
<VirtualHost *:81>
  ServerAdmin webmaster@localhost
 
  DocumentRoot /srv/apache/clowns
  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>
  <Directory /srv/apache/clowns>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
  </Directory>
</VirtualHost>

/srv/apache/bears/index.html is:

<h1>Hello, Webinar!</h1>

<p>My name is ip-172-31-2-241></p>

<p>We love bears</p>
<p>Served from 172.31.2.241:80</p>

/srv/apache/clowns/index.html is:

<h1>Hello, Webinar!</h1>

<p>My name is ip-172-31-2-241></p>

<p>We love clowns</p>
<p>Served from 172.31.2.241:81</p>

Nathen Harvey

unread,
Jun 24, 2014, 12:51:33 PM6/24/14
to learnchef-funda...@googlegroups.com
I suspect the default httpd configuration may still be on that server.  Is there a file at /etc/httpd/conf.d/welcome.conf?  If so, you'll need to remove that file and restart or reload apache.  

Probably best to do that with an addition to your recipe but I'll leave that up to you.

-Nathen

Nick Pilch

unread,
Jul 24, 2014, 3:55:14 PM7/24/14
to learnchef-funda...@googlegroups.com
Thanks much. Sorry I'm just catching back up with the tutorials. If I remove welcome.conf, then I get:

[npilch@ip-172-31-2-241 conf.d]$ curl localhost
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at localhost Port 80</address>
</body></html>
[npilch@ip-172-31-2-241 conf.d]$ 

welcome.conf looks like this:

<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

Dennis Tait

unread,
Oct 8, 2014, 12:27:05 PM10/8/14
to learnchef-funda...@googlegroups.com
I have the same problem with Centos 6.5 once I comment out the directives in /etc/httpd/conf.d/welcome.conf I get the following error.

Can you help?

Forbidden

You don't have permission to access / on this server.


Apache/2.2.15 (CentOS) Server at 192.168.1.100 Port 80

I am taking the module4 course one on hosted Chef and Cloudshare and the other on my private Chef and private VM, so far everything has worked on bot servers except that my private VM is showing the Centos welcome page!! When I comment out the directives in in /etc/httpd/conf.d/welcome.conf I get the permission error!!

Thanks in advance for your help.
Dennis

Dennis Tait

unread,
Oct 8, 2014, 7:08:11 PM10/8/14
to learnchef-funda...@googlegroups.com
Ok, I've found the problem, it was selinux, disable selinux permanantly to solve the issue.

Change “SELINUX=enforcing” to “SELINUX=disabled”:

# vi /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted – Targeted processes are protected,
# mls – Multi Level Security protection.
SELINUXTYPE=targeted


Save the file and RESTART the system. Without restart of system SELINUX mode will not be changed permanently.
Reply all
Reply to author
Forward
0 new messages