0

I recently added httpd to start during the start up by doing this:

cd /etc/rc.d/rc5.d/
ln -s  /etc/init.d/httpd S80httpd

Although httpd starts on boot, seems like my DocumentRoot that was set in httpd.conf located in /etc/httpd/conf/httpd.conf does not take effect and Fedora Test Page gets loaded.

When I used to start httpd manually by httpd -k start, everything was working fine.

I perhaps have not correctly understood the <number> part of s<number>script / k<number>script naming convention for the RC scripts.

Although, I know that it's for representing the order in which the script will be executed during the run of runlevel control script.

I picked up S80httpd from How to auto start Apache during boot time.

What is exactly happening?

I am using Fedora 15 and Apache/2.2.21.

ThinkingMonkey
  • 476
  • 1
  • 9
  • 18
  • Assuming that you aren't accidentally running two different installs, I would poke around the `/etc/rc.d/rc5.d/S80httpd` script to see if it mentions other config files then the ones you intend for it to use. Why are you linking that start up script? Did the package not install one for you? – Tim Jan 12 '12 at 18:05
  • @Tim no the package hadn't installed one. Looking into `S80httpd` script now. – ThinkingMonkey Jan 12 '12 at 18:06
  • @Tim the script says his `config: /etc/httpd/conf/httpd.conf`. I definitely am not running two different installs. – ThinkingMonkey Jan 12 '12 at 18:08
  • That doesn't sound right, guess I will step back because I haven't used fedora in a few months, something may be wildly different then I remember. – Tim Jan 12 '12 at 18:09
  • Is `/etc/httpd/conf/httpd.conf` the correct config file where you have defined your doc root? Can you also post the entire stanza that has your docroot definition? – Tim Jan 12 '12 at 18:10
  • @Tim just a minute. And yes its is the correct config file. – ThinkingMonkey Jan 12 '12 at 18:11
  • @Tim `DocumentRoot "/ThinkingMonkey/mysite/site"` `DocumentRoot "/ThinkingMonkey/mysite/xhprof/xhprof_html"` both of the DocumentRoots have their virtualHost columns definied. – ThinkingMonkey Jan 12 '12 at 18:14
  • Is there an `Include` line in httpd.conf anywhere? – Tim Jan 12 '12 at 18:17
  • @Tim Cannot find an `Include` line. But the same configuration was working with manual start. – ThinkingMonkey Jan 12 '12 at 18:21
  • SELinux is set to enforcing – ThinkingMonkey Jan 12 '12 at 20:24

1 Answers1

1

Centos has a /etc/httpd/conf.d/welcome.conf which will load the generic welcome page. Check to see if that file exists on your fedora system. If so, move it out of the way, stop whichever instance of apache you have, and start apache via service httpd start, or /etc/init.d/apache start, etc.

becomingwisest
  • 3,328
  • 20
  • 18
  • There is a `welcome.conf`. But, since it starts properly when doing a manual start, It should also work with auto-start. The point is to start httpd during start not manually. as you can see by my question. Peace. – ThinkingMonkey Jan 12 '12 at 18:38
  • The manual start may not be reading your apache config the same way. See http://fedoraproject.org/wiki/Server_Test_Page I'm assuming you are seeing the testpage they show at http://fedoraproject.org/wiki/Server_Test_Page#Test_Page_Screenshot Are you seeing a different test page? – becomingwisest Jan 12 '12 at 18:42
  • Yup, I am seeing the server page show at http://fedoraproject.org/wiki/File:ServerTestPage_httpd_test_page.png. – ThinkingMonkey Jan 12 '12 at 18:47
  • So it is the /etc/httpd/conf.d/welcome.conf file. You can follow my directions, or Fedora's @ http://fedoraproject.org/wiki/Server_Test_Page#How_can_I_make_this_page_go_away.3F which is to place an index.html file in the Docroot, or to comment out the file. – becomingwisest Jan 12 '12 at 18:49
  • there is an index.php at the `DocumentRoot`. Will move the `welcome.conf` to another directory as my httpd.conf has `Include conf.d/*.conf` – ThinkingMonkey Jan 12 '12 at 18:57
  • If that works as you want, please accept the answer. – becomingwisest Jan 12 '12 at 19:00
  • Did that, still does not work. Now I get `Forbidden You don't have permission to access / on this server. ` I will up-vote for now. – ThinkingMonkey Jan 12 '12 at 19:12
  • Can you update the question with your /etc/httpd/conf/httpd.conf file? Did you yum install php? – becomingwisest Jan 12 '12 at 20:00
  • Yes I did a yum install. Have added the info. Need any more info? – ThinkingMonkey Jan 12 '12 at 20:22
  • What is the result of running getenforce? – becomingwisest Jan 12 '12 at 20:23
  • SELinux is set to enforcing – ThinkingMonkey Jan 12 '12 at 20:25
  • Dirty fix, disable SELinux via setenforce 0, and modifying /etc/sysconfig/selinux to set SELINUX=disabled. Or move the site into /var/www/html, and make sure the files have the proper selinux info for each file. Or look at how to set this info for the current doc roots. – becomingwisest Jan 12 '12 at 20:33