TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask YC: How do you upload to your web server?

29 点作者 sangguine将近 17 年前
Hi. I was wondering how you upload your code from localhost to the web server. Right now, for my project, I upload the entire directory from localhost to my web hosting server and replace the existing files with the newly uploaded files. It was ok in the beginning because the files were small. Now that I have a bunch of libraries, it takes quiet a long time to upload all 600 files every time I upload.<p>I recently learned about rsync to upload only changes. I was wondering if you use this or other tools to upload.

24 条评论

subwindow将近 17 年前
Git or SVN using Capistrano.<p>If you're deploying code, you <i>really</i> should be using Capistrano. Even if it is not a Rails project. It is a world of difference.
评论 #197306 未加载
评论 #197704 未加载
评论 #197240 未加载
评论 #197236 未加载
评论 #197295 未加载
breck将近 17 年前
After I'm done editing my pages, I save them to a 5.25" floppy and mail it via USPS to GoDaddy in Arizona with the instructions to place on my webserver.
评论 #197754 未加载
wehriam将近 17 年前
I use Fabric - <a href="http://pypi.python.org/pypi/Fabric/" rel="nofollow">http://pypi.python.org/pypi/Fabric/</a> - with a series of build scripts. I can create and update several different types of EC2 servers (database, app, etc) with a single commands.<p>The update command does something like this:<p>* Check out all pertinent application files from the repository.<p>* Add any production specific files, for example build number or database setups<p>* Combine, compress, and number all Javascript and CSS files (combined.384.css can be cached forever, on update it becomes combined.385.css)<p>* Tar and gzip the production files<p>* Find all EC2 servers that need to be updated<p>* Upload the gzipped files<p>* Stop apache<p>* Remove old files on the server(s)<p>* Unzip the new files<p>* Start apache
strick将近 17 年前
This is one way to do it on Windows.<p>Use WinKey to map win-P to project.bat.<p>project.bat: rsync -Crltvz -e ssh /cygdrive/c/personal/project/ me@mydomain.com:/bigfiles/project<p>then I can just hit win-P to force the rsync. Runs in a couple seconds even with hundreds of files.<p>But my favorite if I don't need version control is to use &#60;a href="<a href="http://www.sftpdrive.com/" rel="nofollow">http://www.sftpdrive.com/</a>"&#62;sftpdrive&#60;/a&#62; to mount the remote server as a local disk. It is $39, but is probably my favorite windows software. I've done the Samba thing and like this much better.
评论 #197327 未加载
jobeirne将近 17 年前
I use sshfs (sudo apt-get install sshfs) and mount my web server to a local directory. From there, you can do a variety of things.
bigtoga将近 17 年前
Man - I'm low class apparently as I'm apparently the only one who uses Filezilla or just a plain FTP client. I support about 30 domains and this route helps me. I do have some internally-written apps that will upload files to a lot of different domains at once.
评论 #197844 未加载
mark-t将近 17 年前
For my personal site, I use rsync, and I keep the command in a makefile so I don't have to remember it (I also use the makefile to generate the static pages from templates). It looks like this:<p><pre><code> sync: rsync -az --progress ./ user@host:public_html/ .PHONY: sync </code></pre> But for anything significant, I use a VCS, currently svn or git.
评论 #197687 未加载
iamnirav将近 17 年前
Perhaps a bit noobish, but I use the web development software Coda (panic.com/coda) and it tracks changes for me; when I publish, it only uploads changed files since my last publishing.
hs将近 17 年前
i use mercurial, assuming your base directory is /www/pages (lighttpd), initially:<p>server: $ mkdir /www/pages/project $ cd /www/pages/project $ hg init<p>localhost: $ cd /path/to/your/project $ hg init $ hg add * $ hg commit -m "message" $ hg push ssh://usr:pwd@123.123.123.123//www/pages/project<p>afterward it's just the localhost (ignore "$ hg init")
评论 #197848 未加载
评论 #197142 未加载
marrone将近 17 年前
This is what I have set up. A Git repository on the server. I push all my code to the repo via ssh.<p>On the server there are Dev, Staging, and Production environments. Dev and Staging are bare checkouts from the git repo. I have deploy shell scripts that automate deploying to both (checking out from source control and running database migrations). The process should be that code is deployed to Dev, then Staging and finally to Production.<p>The Production environment is NOT a checkout from source control. It is an exact mirror of the Staging environment. And the deploy script to production does the following:<p>- tags source control with the new release number<p>- creates a tar.gz backup of the production directories<p>- does a database backup dump<p>- then uses rsync to copy files from the staging web directories to the production directories.<p>- lastly runs migration scripts on the prod database
gcv将近 17 年前
I took a page from Rails and Capistrano deployment, and like the idea of versioning releases and using symbolic links. In essence, you update the latest code out of your source control system into /myapp/source, then you run a build and installation script which installs the latest copy of your code to /myapp/release-2008-05-22-114500 (timestamp), then makes a symbolic link from /myapp/current to the right version of the code. That way, if you release something broken, you can trivially roll back to a previous version. (It obviously doesn't always work for things like database schema changes.)
orib将近 17 年前
I actually have a commit hook in git that will update a copy of my website when I commit something with the right message. It's kind of crude, but it manages the busywork for me quite nicely.
a-priori将近 17 年前
My webserver runs Puppet and periodically pulls both the code and its own configuration from my Git repository (which I'm currently hosting on Github, but I may someday self-host).<p>Yes, I'm going against the grain by using Puppet instead of Capistrano. All the Rails people are probably going to crucify me, but I personally think this setup works quite well.
3KWA将近 17 年前
We use BZR for version control when we have a rep we arehappy to deploy<p>bzr push to a REP on the server login over ssh on the server bzr export REP run the test suite on the server (last check) cp relevant files to PROD restart the server (FastCGI)<p>everything automated and sequential one failure -&#62; process stops completely (never happened so far)
radu_floricica将近 17 年前
A separate SVN checkout (with Tortoise), then WinSCP. Surprisingly, you can use WinSCP very well with scripting. Could also make a backup in the same script but didn't yet. The same setup for getting down the database from the production to the development machines.<p>It's not very professional, but for our needs it's perfect.
epi0Bauqu将近 17 年前
Are you using a repository to store your code? If so, you can check it out from the server and then copy it over.
评论 #197093 未加载
yan将近 17 年前
As others said, set up a repository for your code using a source control system, any one will do. Have a release branch and when updating it, make sure the server grabs it. The updating process can be automated using a check-in hook of some sorts.
sgoraya将近 17 年前
I've been using Tortoise SVN - really easy to use,<p><a href="http://tortoisesvn.tigris.org/" rel="nofollow">http://tortoisesvn.tigris.org/</a>
brooksbp将近 17 年前
Been using SCP... it's a great tool for copying files between machines... but it's a shitty tool for prod deployment... capistrano ftw!
maxklein将近 17 年前
Use SVN and setup a postcommit thingy that copies the new files to your public directory whenever you do an update.
评论 #197210 未加载
lunatech将近 17 年前
I am hugely surprised no one suggested creating packages (rpm, deb etc.) and then deploying it on prod boxes
pistoriusp将近 17 年前
&#62; svn commit<p>&#62; svn update
jeremiah将近 17 年前
Upload? localhost? pfff. I hack right on the production server!
dualogy将近 17 年前
tar, scp, ssh, (un)tar (whaddya mean it's not a process? it's got all of four steps in it! ^^)