CentOS not automatically started httpd in Vagrant

1.3k views Asked by At

If I use a symbolic link to httpd.conf at vagrant shared directory, it not automatically started httpd. Where wrong my configuration?

Versions:

  • Host OS: Mac OS X 10.9.2
  • Guest OS: CentOS release 6.4 (Final)
  • VirtualBox 4.3.2
  • Vagrant 1.3.5
  • Apache/2.2.15

For example:

$ vagrant ssh
[vagrant]$ sudo chkconfig httpd on
[vagrant]$ ln -sf /vagrant/httpd.conf /etc/httpd/conf/httpd.conf
[vagrant]$ exit
$ vagrant reload
$ vagrant ssh
[vagrant]$ ps -ef | grep httpd
vagrant   2652  2632  0 16:40 pts/0    00:00:00 grep httpd

Thank you for being patient with my English.

3

There are 3 answers

0
NSR On BEST ANSWER

This was problem related to vagrant folder mount. I edited to wait vagrant sync folder mount to /etc/init.d/httpd.

0
J. Xu On

All files in vagrant sync folder are owned by vagrant:vagrant. Please check this and the permission accordingly. Suggestion is to use provision to

  • copy your httpd.conf to /etc/httpd/conf
  • or chown and chmod accordingly
4
Teddybugs On

start the httpd:

service httpd start

if you want it to auto start when OS boot:

chkconfig --levels 234 httpd on

run a httpd.conf config test to see if there is error:

apachectl configtest

or

httpd -t