简体   繁体   English

将 HTML 网站文件上传到 Openshift PHP 5.4

[英]Upload HTML website files to Openshift PHP 5.4

This is my first website (website itself is all done).这是我的第一个网站(网站本身已经完成)。 I'm trying to upload my website files to my Openshift PHP 5.4 domain so when I click my OpenShift domain url, my website appears (pretty simple, right?).我正在尝试将我的网站文件上传到我的 Openshift PHP 5.4 域,因此当我单击我的 OpenShift 域 URL 时,我的网站出现(非常简单,对吧?)。 My Openshift account is set up.我的 Openshift 帐户已设置。 I've connected to it with FileZilla, and set up a private (or public) key.我已经使用 FileZilla 连接到它,并设置了一个私钥(或公钥)。 I've installed Ruby & Git.我已经安装了 Ruby 和 Git。 I followed everything here , and am stuck on this step:我跟着这里的一切,并坚持这一步:

Web Console网络控制台

If you create an application from the web console, you'll need to tell Git to clone the repository.如果您从 Web 控制台创建应用程序,则需要告诉 Git 克隆存储库。 Find the Git URL from the application page, and then run:从应用程序页面找到 Git URL,然后运行:

C:\> git clone <git_url> <directory to create>

I don't know what the "git_url" is supposed to be.我不知道“git_url”应该是什么。 Nor do I know what the "directory to create" is supposed to be.我也不知道“要创建的目录”应该是什么。 I don't know what OpenShift directory to put my website files in (when I connect with FileZilla) so that when I open my OpenShift domain url, I see my website (see below).我不知道将我的网站文件放在哪个OpenShift 目录中(当我连接 FileZilla 时),所以当我打开我的 OpenShift 域 url 时,我会看到我的网站(见下文)。

Again, my goal is to see my website when I open my OpenShift PHP 5.4 url.同样,我的目标是在打开 OpenShift PHP 5.4 url​​ 时看到我的网站。 Where do I go from here?我从这里去哪里?

Your problem is that you don't know what git is about, I recommend that you go read about it: https://git-scm.com/book/en/v1/Getting-Started你的问题是你不知道git是什么,我建议你去阅读一下: https : //git-scm.com/book/en/v1/Getting-Started

If you have your site ready and you've created an OpenShift app, do the following:如果您已准备好站点并创建了 OpenShift 应用程序,请执行以下操作:

1) Grab the git url (you can find it by browsing to https://openshift.redhat.com/app/console/applications , clicking your app, and then copying the long address on the right, under "Source Code"), it should look something like this: ssh://afa231av@app-domain.rhcloud.com/~/git/app.git/ 1) 获取 git url(您可以通过浏览到https://openshift.redhat.com/app/console/applications找到它,单击您的应用程序,然后复制右侧“源代码”下的长地址) ,它应该是这样的: ssh://afa231av@app-domain.rhcloud.com/~/git/app.git/

2) Open up a terminal (or use some git ui tool) and clone (download) your app with 2)打开一个终端(或使用一些 git ui 工具)并克隆(下载)你的应用程序

git clone ssh://afa231av@app-domain.rhcloud.com/~/git/app.git

3) You should have a folder named app , now use the file explorer go inside it and paste in all your website 3)您应该有一个名为app的文件夹,现在使用文件资源管理器进入其中并粘贴您的所有网站

4) Go back to the terminal and do 4)返回终端并执行

cd app (or whatever name your app has)
git add .
git commit -m "Add my website"
git push origin master

Wait for it to finish, and if there are no errors, you're all done.等待它完成,如果没有错误,你就完成了。

git_url: Go to OpenShift Web Console -> Application -> find and click your application, on the right there is Source Code panel with something like ssh://***.rhcloud.com/~/git/php.git/, this will be your git_url git_url:转到 OpenShift Web 控制台 -> 应用程序 -> 找到并单击您的应用程序,右侧有源代码面板,其中包含类似 ssh://***.rhcloud.com/~/git/php.git/ 的内容,这将是你的 git_url

directory_to_create: is just a name of directory that will be created that will contain your git repo on your local file system directory_to_create:只是将创建的目录的名称,该目录将包含本地文件系统上的 git 存储库

When you clone this repo, you should copy your files to it, then commit and push to branch named 'master', and it will be automatically deployed on server.当你克隆这个 repo 时,你应该将你的文件复制到它,然后提交并推送到名为“master”的分支,它会自动部署在服务器上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM