Re: [vagrant-up] Apache failed to read custom folders under /var/www

34 views
Skip to first unread message
Message has been deleted

Alvaro Miranda Aguilera

unread,
Apr 18, 2017, 8:50:07 PM4/18/17
to vagra...@googlegroups.com
Hello


Can you share a repro project to have a look ?

Thanks
Alvaro

On Tue, Apr 18, 2017 at 6:28 PM, MnEmOnIcS <hiroo...@gmail.com> wrote:
Hello,

Apache is not reading custom folders under /var/www when the machine is booting up. It's throwing this error:

>>>
httpd.service - The Apache HTTP Server
   
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   
Active: failed (Result: exit-code) since Tue 2017-04-18 23:07:19 WIB; 1min 30s ago
     
Docs: man:httpd(8)
           man
:apachectl(8)
 
Process: 1210 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
 
Process: 1018 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 
Main PID: 1018 (code=exited, status=1/FAILURE)


Apr 18 23:07:19 abox-lamp httpd[1018]: (2)No such file or directory: AH02291: Cannot access directory '/var/www/example2.dev/' for error log of vhost defined at /etc/httpd/sites-enabled/e...le2.dev.conf:1
Apr 18 23:07:19 abox-lamp httpd[1018]: (2)No such file or directory: AH02291: Cannot access directory '/var/www/example1.dev/' for error log of vhost defined at /etc/httpd/sites-enabled/e...le1.dev.conf:1
Apr 18 23:07:19 abox-lamp httpd[1018]: (2)No such file or directory: AH02291: Cannot access directory '/var/www/abox.dev/' for error log of vhost defined at /etc/httpd/sites-enabled/abox.dev.conf:1
Apr 18 23:07:19 abox-lamp httpd[1018]: AH00014: Configuration check failed
Apr 18 23:07:19 abox-lamp systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 18 23:07:19 abox-lamp kill[1210]: kill: cannot find process ""
Apr 18 23:07:19 abox-lamp systemd[1]: httpd.service: control process exited, code=exited status=1
Apr 18 23:07:19 abox-lamp systemd[1]: Failed to start The Apache HTTP Server.
Apr 18 23:07:19 abox-lamp systemd[1]: Unit httpd.service entered failed state.
Apr 18 23:07:19 abox-lamp systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

<<<

I'm assuming at this point vagrant has no access to the share folder through virtualbox, not until at a later stage. Although, once I 'vagrant ssh' into the box and start apache again it works fine without throwing any error. 

Any help is appreciate it. 

Thank you. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Message has been deleted

Alvaro Miranda Aguilera

unread,
Apr 19, 2017, 6:33:32 AM4/19/17
to vagra...@googlegroups.com
Hello

I think is some issue on the logic of the script.

some comments.

1. your provisioning script is quite big, install many packages, will be better if you create your own box that includes all those packages.
have a look at:



2. when you do yum update, you will update everything, including kernel, and that will break virtuabox guest additions

option 1, use a box that is already updated
option 2, don't update the kernel

3. your script does rm -fr on /var/www/html

as you are mounting from the host, better put the files and the structure as is, that maybe cause the problems you see.

Based on the output, Vagrant is working fine, seems to be a logic in the provision script that need review.


I commented out the first yum update and the rm -fr /var/www/html

attached the script


 and i got this:

0 kikitux ~/Downloads/abox-lamp (master *) $ vagrant provision

==> default: Running provisioner: shell...

    default: Running: /var/folders/20/wcstfb755nj9w6lqntfkdz840000gn/T/vagrant-shell20170419-1803-hdd8b.sh

==> default: Installing Apache...(httpd httpd-tools)

==> default: ...Done!

==> default:  

==> default: Installing PHP...(php php-bcmath php-cli php-mbstring php-mysql php-soap php-xml php-xmlrpm)

==> default: ...Done!

==> default:  

==> default: Installing GIT...(git)

==> default: ...Done!

==> default:  

==> default: Installing Expect...(expect)

==> default: ...Done!

==> default:  

==> default: Installing MariaDB...(mariadb-server mariadb)

==> default: ...Done!

==> default:  

==> default: Setting up Apache...

==> default: --> Configuring aBox.dev Virtualhost

==> default: .. Done!

==> default: --> Configuring example1.dev Virtualhost

==> default: --> .. Done!

==> default: --> Configuring example2.dev Virtualhost

==> default: --> .. Done!

==> default: ...Done!

==> default:  

==> default: Setting up MariaDB ... 

==> default: ...Done!

==> default:  

==> default: Your aBox LAMP environment is now setup! 

==> default:  

==> default: MySQL Username: root

==> default: MySQL Password: vagrant

==> default:  

==> default: You can copy and paste the following to your hosts file: 

==> default:  

==> default: 192.168.33.10 abox.dev www.abox.dev

==> default: 192.168.33.10 example1.dev www.example1.dev

==> default: 192.168.33.10 example2.dev www.example2.dev

==> default:  

==> default: The 192.168.33.10 is the IP Address in your Vagrantfile.

==> default: If you have opted to choose a different IP Address, please adjust accordingly.

==> default: Enjoy!

0 kikitux ~/Downloads/abox-lamp (master *)




On Wed, Apr 19, 2017 at 11:04 AM, MnEmOnIcS <hiroo...@gmail.com> wrote:
You can find the VagrantFile here https://github.com/BlimpDigital/abox-lamp

It's just a standard centos 7 minimal install with a LAMP script running on top.

/var/www (guest) points to /web folder (host).

I haven't uploaded the Vagrant Boxes anywhere though but i'm assuming a standard centos 7 would just work the same. 
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

lamp.sh
Message has been deleted

Alvaro Miranda Aguilera

unread,
Apr 22, 2017, 11:48:24 AM4/22/17
to vagra...@googlegroups.com
how do you reboot?

As i said

do not update everything, in the meantime comment that out

move lowly, one step at the time.

and the mount points are done by vagrant so the right way is   vagrant reload

Alvaro

On Sat, Apr 22, 2017 at 2:55 PM, MnEmOnIcS <hiroo...@gmail.com> wrote:
Thank you Alvaro, 

I'm not sure if it has anything to do with the scripts because I've tried to replicate just a basic centos/7 box from here (https://atlas.hashicorp.com/centos/boxes/7) with the same results. Here are the steps I've taken to replicate this:

2) Install httpd and httpd-tools
4) enable httpd so it would start the daemon when the vm boots up 
5) reboot the machine
6) Then I vagrant ssh to the box
7) check to see if httpd.service is running, it's actually throwing errors saying that it could not find /var/www/example1.dev/public_html, /var/www/example2.dev/public_html and  /var/www/example3.dev/public_html  folders. 

Funny thing is if I start apache again using 'sudo systemctl start httpd.service' at this point, it works. So the problem is only happening as you boot the machine. Seems like it cannot find those folders. 

Then I did 2 new vm installs. 

1 - adding the folders (/var/www/example1.dev/public_html, etc) from host (because it's shared) and 
2 - adding the folders straight from the guest (ssh into it) 

both still give the same error. 

Then I tried running the vm straight from virtualbox, login as vagrant, seems like the folders are not even sync. So the shared folders are not synchronising properly (maybe?).

>>> 

2. when you do yum update, you will update everything, including kernel, and that will break virtuabox guest additions

option 1, use a box that is already updated
option 2, don't update the kernel
<< 

We need to replicate our production server, so we want to keep our dev environment as close as possible to it. Which is why we have setup our own vagrant box to be distributed amongst all our devs. If we cannot replicate the box, then surely it defeats the purpose of keeping the dev as standardized as possible as our production machines especially if every kernel updates will break the vbguest addition?   





--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
Message has been deleted
0 new messages