0

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.

NSR
  • 819
  • 7
  • 20
  • Possible duplicate of [Apache doesn't start after Vagrant reload](http://stackoverflow.com/questions/22718785/apache-doesnt-start-after-vagrant-reload) – kenorb Mar 22 '16 at 16:41

3 Answers3

0

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
Teddybugs
  • 1,232
  • 1
  • 12
  • 37
  • Thank you for your comments. If I use no symbolic link "httpd.conf", the httpd is automatically started. I want to use symbolic link. Do you know that method? – NSR Mar 18 '14 at 08:28
  • do you have error when you run httpd -t with symbolic link? – Teddybugs Mar 18 '14 at 08:38
  • That result is "Syntax OK" and "service httpd start" is no problem. but it not automatically started httpd after vagrant up. – NSR Mar 18 '14 at 08:53
  • if you run: "chkconfig --levels 234 httpd on" this should allow the httpd to start during centos VM boot.. – Teddybugs Mar 18 '14 at 08:56
0

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

kenorb
  • 155,785
  • 88
  • 678
  • 743
NSR
  • 819
  • 7
  • 20
0

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
J. Xu
  • 11
  • 3