Welcome Guest, Not a member yet? Register   Sign In
Move away content from public_html in a git repo on live server
#1

I get the security thing about moving content away from public_html/. 
My workflow is that I push from my local machine to GitHub and to my live server. 
Yes, I can change the structure on my live server (like moving certain content up one level), but I guess I must keep it on my local machine. 
How do I push to my live server after having moved content up one level?
Reply
#2

In your local dev machine you create a public (or public_html) folder. Move everything in there. Push it to GitHub and after running git on your public server you will need to change document_root to your new public folder.

Or scrap git on live server and re-download everything, if you don't want double public_html folders.
Reply
#3

I have a Ubuntu VPS and mirror image /var/www/my-domain.tld/public_html. RSync used to copy from localhost to server, only takes second.

Github used for backups and slow compared too RSync.
Reply
#4

(11-13-2019, 12:14 PM)jreklund Wrote: In your local dev machine you create a public (or public_html) folder. Move everything in there. Push it to GitHub and after running git on your public server you will need to change document_root to your new public folder.

Or scrap git on live server and re-download everything, if you don't want double public_html folders.
OK, so how about if I change my project on my local machine to something like this (and change the folder paths in index.php accordingly):

my_project
 l--public_html/
 l   l--index.php
 l--application/
 l--views/
 l--system/

Finally, I push to my live server one level up (from the folder  public_html).
Reply
#5

Yep, that works.
Reply
#6

(This post was last modified: 11-15-2019, 02:18 AM by muuucho.)

(11-14-2019, 12:36 PM)jreklund Wrote: Yep, that works.
Tack så mycket / Many thanks  Smile

(11-14-2019, 02:24 AM)John_Betong Wrote: I have a Ubuntu VPS and mirror image /var/www/my-domain.tld/public_html. RSync used to copy from localhost to server, only takes second.

Github used for backups and slow compared too RSync.
I am on windows. Thanks anyway.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB