Pregunta

I have two folders for a particular web site. There is the main www.mysite.com site which is at home/user/public_html and then I have a sub domain -> dev.mysite.com for the latest under development version of the site at /home/user/dev_html

Maybe because of laziness in the past when moving the new site to the main directory, I have just backed up the current site, downloaded it via ftp, erased the site files and then uploaded the new site. However, ftp is so slow and unreliable that this is a ridiculously slow and error prone way of doing it - especially for big sites.

So I was thinking of just logging in via ssh and then moving all the files out of public_html and then copying the new files from dev_html but then it struck me. Can't I just change the name of the public_html folder to something like public_html_old and then change dev_html to public_html? Will Apache go mental if I do this?

Forgive me if this is a stupid question.

¿Fue útil?

Solución

What you propose is fine. In fact, you can do it in one line from the CLI.

mv public_html public_html_old && mv dev_html public_html

You can also try the following...

Create a symbolic link to the current main site, eg (assuming the current site resides in a v1_html directory)

ln -s v1_html public_html

Then, to switch document roots...

rm public_html && ln -s v2_html public_html

Otros consejos

If you can access the server in SSH, you can use cp command to copy your directory files to public_html or rename the folder as you suggested.

Be sure to stop the Apache service first.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top