I have access to server of our company's website. I access it using Putty.
I want to download all files(index.php, any jpg files for favicons, etc.) used for deployment of the web project. When I told to programmer of website to share the full script(HTML,CSS,PHP, jquery plugins), he said that I can access the entire code from server.
When I enter the server via Putty(private key+ssh), and then I type "ls" I see that there are "index.php" and "mysql" files, the full contents of which I cannot download.
What are the useful resources for list of commands?
Which command should I use to download the project folder containing all files with code and without code?
P.S. I do not know if this information is necessary, but the website was deployed using DigitalOcean.
As you are using Putty, I'll assume you are working on Windows. There is a GUI tool called WinSCP that works similar to Putty (i.e. over SSH and uses private keys and stuff) and can be used to access the remote server's filesystem. It has a pretty simple to understand UI which will be divided into you local filesystem and the server filesystem. Once you're connected and have reached the files you need you can just drag and drop the files into your local filesystem side.
If you would like to explore some command line options, its basically any tool that does scp. I think Putty comes with scp or pscp installed already. You can check by just typing in the command in your cmd/powershell.
You can download pscp.exe from PuTTY website and then:
Open cmd.exe and type:
pscp your_username_here#yourcompany.com:/path/to/file C:\Path\To\The\New File
Related
I want to run a web application on a Windows computer but because of some reasons, I don't want to install a web stack like Xampp on that machine.
The web app is placed in a folder and inside of it, there are Apache, PHP, the database like MySQL or PostgreSQL, and the web source. If we want to access it, there is just a shortcut in the Desktop, and when we click that, the browser is opened and point to an URL with a particular port like localhost:8888. And the web app is opened.
I just want to put that folder in an installer. And the installer just extracts it to system folder and create a shortcut on the desktop.
I ask this because I have ever seen stuff like this. It used PostgreSQL. Simply like what I've just explained above.
If you know how to make it works, you may want to help me. Your answers will be appreciated.
You have three way to provide your web application as a software application
you can create portable server in pen drive server start by your application present on desktop icon.
you can create installer using Microsoft Installer which install all the requirement in one go then point ini file to your source code folder. This will let desktop icon to start xammp and run your application.(only applicable for window)
write python script to install web server using CMD and Terminal. then python script point ini to your source folder . Generate shortcut for server start command and launch browser with url.
we already provide Lab application in pen drive based server
Is it possible to deploy php files on Openshift directly? (That is, not via git).
Most of my php files are single page files and I'm looking for a way to SFTP directly into Openshift.
I am able to login via Filezilla, but when I try to transfer files into directories like app-deployment or app-root etc, the file gets deleted.
Openshift folder structure:
So, how can I upload PHP files directly?
After many trials, I found that its actually possible.
Inside this folder: app-roots/repo/myfile.php
OpenShift has a few blog posts on the topic:
Using FileZilla and SFTP on Windows with OpenShift
Getting started with SFTP and OpenShift (Using Netbeans)
I'm trying to create a new PHP project in a situation where our client gave us only remote desktop connection to to their files.
How does it work usually in Netbeans:
To put it simple when a project is created with external sources we can click in our project on the single file and upload and download it (via ftp).
I'd like to be able to do this also on remote files located in a server which can be reached by our local network but which hasn't ftp installed.
Extra details
Until now we have been able to work normally with this setup by using Dreamweaver which allows to set in the server options an address located in the local network.
I really would like to switch to Netbeans and being able to click on upload and download on the local files to sync with their server but I can't find a way to achieve this.
There seem to be no option when creating a new project that allows this kind of setup. Selecting remote website seem to allow only ftp synch.
On the other hand if i select "Local web site" i can select the files in the local network, but NB doesn't allow me to make a local copy of them.
note 1: the server we're accessing hasn't ftp installed.
note 2: the "copy files from sources folder to another location" isn't really an option for me since I'd like to keep separated my local copy from what's on the server (and this setup I think would just copy the files without giving me any control on them).
note 3: creating a project with existing sources seem to allow only to have remote files reachable via ftp.
It would be useful to have some versioning system (git, mercurial, svn...). Can you mount the network drive in Windows? (see here ). This would at least allow you to easily create project from existing sources (although working via network could be quite slow)
One hacky way I can think of is to:
mount the network drive as described above and map it to some letter, say Z
install local FTP server (e.g. FileZilla)
configure FileZilla FTP server to use the network drive as "ftp home" (aka the folder which FileZilla will use for saving files sent over FTP) - simply use Z:\ path to point to the mounted network drive mapped to letter Z
in NetBeans, create a new PHP project from remote server (where remote server is actually your local FileZilla server)
In theory, this should work.
Here is the fragment from NetBeans site:
To set up a NetBeans project for an existing web application:
Choose File > New Project (Ctrl-Shift-N on Windows/Cmd-Shift-N on OS X).
Choose Java Web > Web Application with Existing Sources. Click Next.
In the Name and Location page of the wizard, follow these steps:
In the Location field, enter the folder that contains the web application's source root folders and web page folders.
Type a project name.
(Optional) Change the location of the project folder.
(Optional) Select the Use Dedicated Folder for Storing Libraries checkbox and specify the location for the libraries folder. See Sharing Project Libraries in NetBeans IDE for more information on this option.
(Optional) Select the Set as Main Project checkbox. When you select this option, keyboard shortcuts for commands such as Clean and Build Main Project (Shift-F11) apply to this project.
Click Next to advance to the Server and Settings page of the wizard.
(Optional) Add the project to an existing enterprise application.
Select a server to which to deploy. If the server that you want does not appear, click Add to register the server in the IDE.
Set the source level to the Java version on which you want the application to run.
(Optional) Adjust the context path. By default, the context path is based on the project name.
Click Next to advance to the Existing Sources and Libraries page of the wizard.
Verify all of the fields on the page, such as the values for the Web Pages Folder and Source Package Folders.
Click Finish.
We need to execute an .exe file in a remote Windows Azure Server.
We call it from PHP with shell_exec. The .exe should create new files in two different folders into the server and generate data entries in a data base and returns a string, but it doesn’t work.
We don’t have any problem executing it in our local server with windows 7 Enterprise and IIS 7. That’s why we thought it could be a permissions problem, and then we have created a .user.ini file with the following content:
safe_mode= off
safe_mode_exec_dir= off
Unfortunately it doesn’t work too.
Any suggestions?
Thanks in advance.
You are most probably working with Windows Azure Web Sites. This is a high-density shared hosting with tightened security. If you need things like shell_exec you shall move to Windows Azure Cloud Service (Web Role), where you have full control over the OS and web server / php settings.
Using Cloud Service you will be able to use shell_exec. However when you move to Cloud Service you have begin thinking of saving files in Azure Blob Storage, as the local storage for cloud service is:
Not persistent
not synchronized across role instances
If you want don't yet know what Role and Role Instance is, or are little confused, please go through this article.
I have a database that exports xmls only locally (to my computer). It will not export to a remote server.
I have a php file (located on remote server) that sends the xml to a webserivce.
Can I have the remote php file use "file_get_contents" function to extract xml data from my local computer?
If so, what is the proper syntax?
Thanks in advance.
I think you should add a file upload page,upload the local xml file to remote server,the do the the next work.
You have a couple of options...
You could run a local web server on your computer and publish the files via that. Your remote PHP script could then read the file.
A potentially better alternative would be to use something like Dropbox. Save the database files in your Dropbox folder. They will be automatically uploaded to the Dropbox cloud storage.
Your remote PHP script could then retrieve them via the Dropbox API or if they are in the "public" folder, directly via URL.
You have to make your file available from your linux machine:
install a webserver on your desktop machine and allow it to expose the file, so the file will be available to an URI like http://ip_of_your_desktop/path_to_files/filename.xml (this was mentioned above also)
if your desktop and server are on the same network, share the folder on your desktop, mount the folder on your linux machine and use file_get_contens to read the file from the mounted location