Apache failed to read custom folders under /var/www

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Apache failed to read custom folders under /var/www

MnEmOnIcS
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Apache failed to read custom folders under /var/www

Alvaro Miranda Aguilera
Hello


Can you share a repro project to have a look ?

Thanks
Alvaro

On Tue, Apr 18, 2017 at 6:28 PM, MnEmOnIcS <[hidden email]> 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 [hidden email].
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0eypgbivF%3DBfYEKJA35pAtU7rvU252NF2PxqL4DnKv8_ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Apache failed to read custom folders under /var/www

MnEmOnIcS
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. 


On Wednesday, April 19, 2017 at 7:50:07 AM UTC+7, Alvaro Miranda Aguilera wrote:
Hello


Can you share a repro project to have a look ?

Thanks
Alvaro

On Tue, Apr 18, 2017 at 6:28 PM, MnEmOnIcS <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="LBcJJzIGAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hiroo...@...> 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 - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="LBcJJzIGAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/ca9dfe5e-2501-4aaa-979f-a9a2a575f4e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Apache failed to read custom folders under /var/www

Alvaro Miranda Aguilera
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 <[hidden email]> 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. 


On Wednesday, April 19, 2017 at 7:50:07 AM UTC+7, Alvaro Miranda Aguilera wrote:
Hello


Can you share a repro project to have a look ?

Thanks
Alvaro

On Tue, Apr 18, 2017 at 6:28 PM, MnEmOnIcS <[hidden email]> 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+...@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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/ca9dfe5e-2501-4aaa-979f-a9a2a575f4e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0exz_g0isCe8chXLz7vGMydbsM-FoVxEpZXc0puxtsmoxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

lamp.sh (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Apache failed to read custom folders under /var/www

MnEmOnIcS
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:

1) Install https://atlas.hashicorp.com/centos/boxes/7 
2) Install httpd and httpd-tools
3) configure virtualhost as per instructions here https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7; setup example1.dev, example2.dev and example3.dev as a virtualhost
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?   




On Wednesday, April 19, 2017 at 5:33:32 PM UTC+7, Alvaro Miranda Aguilera wrote:
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:
<a href="https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fchef%2Fbento%2Fblob%2Fmaster%2Fcentos-7.3-x86_64.json&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNFSVr1R8eih2uJVfPM1JdzyThaaPA" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fchef%2Fbento%2Fblob%2Fmaster%2Fcentos-7.3-x86_64.json\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFSVr1R8eih2uJVfPM1JdzyThaaPA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fchef%2Fbento%2Fblob%2Fmaster%2Fcentos-7.3-x86_64.json\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFSVr1R8eih2uJVfPM1JdzyThaaPA&#39;;return true;">https://github.com/chef/bento/blob/master/centos-7.3-x86_64.json

and <a href="http://packer.io" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpacker.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9z5BjHlcVSOqvLDYevZFfvBY5dQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpacker.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9z5BjHlcVSOqvLDYevZFfvBY5dQ&#39;;return true;">packer.io


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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="a6vQXAgmAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hiroo...@...> wrote:
You can find the VagrantFile here <a href="https://github.com/BlimpDigital/abox-lamp" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FBlimpDigital%2Fabox-lamp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEu1EkIs2WNDOKBRYUE31r64d207w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FBlimpDigital%2Fabox-lamp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEu1EkIs2WNDOKBRYUE31r64d207w&#39;;return true;">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. 


On Wednesday, April 19, 2017 at 7:50:07 AM UTC+7, Alvaro Miranda Aguilera wrote:
Hello


Can you share a repro project to have a look ?

Thanks
Alvaro

On Tue, Apr 18, 2017 at 6:28 PM, MnEmOnIcS <[hidden email]> 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 - <a href="https://www.hashicorp.com/community-guidelines.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">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+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/5b801f2d-c7e9-4b71-b2b4-fc665d5f1152%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="a6vQXAgmAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/ca9dfe5e-2501-4aaa-979f-a9a2a575f4e2%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/ca9dfe5e-2501-4aaa-979f-a9a2a575f4e2%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/ca9dfe5e-2501-4aaa-979f-a9a2a575f4e2%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/ca9dfe5e-2501-4aaa-979f-a9a2a575f4e2%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/49d58752-e261-496f-b98b-4755b6b9b8ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Apache failed to read custom folders under /var/www

Alvaro Miranda Aguilera
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 <[hidden email]> 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
3) configure virtualhost as per instructions here https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7; setup example1.dev, example2.dev and example3.dev as a virtualhost
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?   




On Wednesday, April 19, 2017 at 5:33:32 PM UTC+7, Alvaro Miranda Aguilera wrote:
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 <[hidden email]> 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. 


On Wednesday, April 19, 2017 at 7:50:07 AM UTC+7, Alvaro Miranda Aguilera wrote:
Hello


Can you share a repro project to have a look ?

Thanks
Alvaro

On Tue, Apr 18, 2017 at 6:28 PM, MnEmOnIcS <[hidden email]> 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 [hidden email]m.
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

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/ca9dfe5e-2501-4aaa-979f-a9a2a575f4e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/49d58752-e261-496f-b98b-4755b6b9b8ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ex58aFyfmraFEvDA1MaX9PETJNJnscmY%3DZUbAaqKYTPQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Apache failed to read custom folders under /var/www

MnEmOnIcS
Yes, tried vagrant reload as well as issuing 'vagrant halt; vagrant up' with the same result. Both still not allowing Apache to read the virtual host folder. 

On Apr 22, 2017 22:48, "Alvaro Miranda Aguilera" <[hidden email]> wrote:
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 <[hidden email]> 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
3) configure virtualhost as per instructions here https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7; setup example1.dev, example2.dev and example3.dev as a virtualhost
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?   




On Wednesday, April 19, 2017 at 5:33:32 PM UTC+7, Alvaro Miranda Aguilera wrote:
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 <[hidden email]> 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. 


On Wednesday, April 19, 2017 at 7:50:07 AM UTC+7, Alvaro Miranda Aguilera wrote:
Hello


Can you share a repro project to have a look ?

Thanks
Alvaro

On Tue, Apr 18, 2017 at 6:28 PM, MnEmOnIcS <[hidden email]> 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 [hidden email]m.
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

--
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 [hidden email]m.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/ca9dfe5e-2501-4aaa-979f-a9a2a575f4e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
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 [hidden email].



--
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 a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/b4qCSHKNelc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ex58aFyfmraFEvDA1MaX9PETJNJnscmY%3DZUbAaqKYTPQA%40mail.gmail.com.

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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CANf1tZLaE_8wZwQ1XmjUncbumYHRPB917XP423XZT5dYm39LQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.