Thanks for the tip, i looked up the sed command and came up with this 
little beast:

sudo rm -rf /var/www
sudo ln -fs /home /var/www
sudo sed -i 's@var/www/html@home@' /etc/httpd/conf/httpd.conf

Just left with "Could not chdir to home directory /home/vagrant: No such 
file or directory" error but it is not causing any issues so not a worry

On Friday, 25 April 2014 10:21:19 UTC+1, Alvaro Miranda Aguilera wrote:
>
> hello,
>
> for the first issue, it's permissions, by default the permissions won't be 
> very user friendly..
>
> in the host, create one dir per user, and mount that as the /home/<user>
>
> if the user is already created check the documentation and use the user 
> group
>
> if the user is not created, use gid/uid like this:
>
> config.vm.synced_folder "12cR1", "/media/sf_12cR1", :mount_options => 
> ["dmode=775","fmode=775","uid=54320","gid=54321"]
>
> For the 2nd problem, What will be quicker for you? mount say  host www as 
> /var/www ?
>
> other way, is you can use sed, and modify DocumentRoot in 
> /etc/httpd/httpd.conf and then do a restart. you can execute this with a 
> shell script from Vagrantfile
>
>
> Let me know if you have questions, or need something a bit more detailed.
>
> Alvaro.
>
>
> On Fri, Apr 25, 2014 at 8:35 PM, Goodbytes <for...@gmail.com <javascript:>
> > wrote:
>
>> Hi,
>>
>> I'm having trouble working out how to correctly set the working path. I 
>> use CentOS to mimic my production web server, i use cPanel which throws 
>> everything in /home
>>
>> So in my vagrant file i've added the line:
>>
>> config.vm.synced_folder ".", "/home"
>>
>> Which sets the current (host) directory to the /home on guest directory. 
>> This sort of works, if i cd into /home and touch a file it shows up on the 
>> guest.
>>
>> However, every time i run vagrant up i receive the following error:
>>
>> Could not chdir to home directory /home/vagrant: No such file or directory
>>
>> Why is it trying to go to /home/vagrant ?
>>
>> Also, apache standard document root is /var/www/html/ - what is the 
>> quickest way to change this, am i required to edit httpd.conf every time i 
>> fire up a new instance?
>>
>> Id love to be able to automate the process so that upon firing up the vm 
>> i am sat in the home directory and it's already configured to serve pages 
>> from there instead of /var/www/html/ is this at all possible? and now do i 
>> get rid of the /home/vagrant error? While it's not causing any major 
>> problems it's clear something is not setup correctly.
>>
>> thanks
>>
>> -- 
>> 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 <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to