Can't ftp to azure webapp - php

I've created simple webapp + mysql database on azure and i've set ftp username/pass. I'm following this article:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-mysql-deploy-use-ftp/
Everything is fine up to the ftp part, i just can't connect to that ftp. I tried using the username/pass i set in Deployment Credentials. I tried using the username/pass i see in the PublishSettings file, but nothing is working.
I tried via linux ftp cmd and filezila and played with active/passive.
When i telnet ip 21 i'm getting timeout too.
Could someone please explain how to connect to that azure ftp?
Thanks

One common problem is that you need to have the username look like YourSiteName\YourUserName and not just YourUserName.
If you look under 'FTP/Deployment username' in the Azure portal, it gives the correct name with the site name prefix.

According to the offical documents, the section Deploy by copying files to Azure manually of the doc Deploy your app to Azure App Service introduce the steps of deploying the WebApp via FTP.
The key point of deploying via FTP on Azure is the FTP connection information, you can follow the steps 5 to 7 of the section Get MySQL and FTP connection information of the doc Create a PHP-MySQL web app in Azure App Service and deploy using FTP to find them from the .publishsettings file got on the Azure new portal, please see the picture below.

The method shown in the tutorial you link to is how I do it when I need to lookup my azure credentials - by downloading the Publish Profile and pulling the information out of there.
Here's how I do it:
using FileZilla (https://filezilla-project.org/) I plug the publishurl in the host field, leave the port blank, select FTP - File Transfer Protocol, use explicit FTP over TLS if available, Logon Type: Normal, enter userName in the user field, userPWD in the password field.
Click Connect and the FTP connection is made (after I click the security msg).
So it's a plain old FTP connection. There's nothing special going on.
If this isn't working for you I would suggest the problem isn't with your credentials, check the webapp has been started in azure, check you can ftp with another site\server.
Good luck. Hope this helps.

Related

How to upload a PHP file on Azure

Right now I have a localhost database using WAMP server.
I connect and insert data to this DB by making a POST request to the file's PHP link (e.g localhost/sensor_data/connect_To_DB_And_Insert_Data.php).
I want to do the exact same thing with Azure SQL so my database won't be local anymore but on a remote server.
I have already created a database but I don't know how to upload a PHP file that can be accessed online using a link. There are so many documentations that I'm kind of lost and I didn't find an answer to this yet.
So my question is, how do I upload a PHP file on Azure, that it can be accessed by a link, so I can insert data to the database by making a post request to that link ?
Firstly, you just need to change the connection string in your PHP code. Then your PHP application will be able to connect to Azure SQL. In this way, you do not need to create any Azure host server (Web app or VM).
You can get the connection string on Azure portal:
Attention, as Azure SQL has enabled firewall. So, if you want to connect to it from your local server, you need to add your IP to the allowed IP list
However, as #UkraineInTheMembrane suggested in the comment, you can also to use Azure Web App or VM to host your PHP application.
With Azure Web App, here is a get-started tutorial for PHP: Create a PHP web app in Azure , in this tutorial, git is used to manage your code.
There are also many other approaches to upload your code to azure web app: https://learn.microsoft.com/en-us/azure/app-service/deploy-zip

How to publish a website built by HTML and PHP?

I built a website (localhost) using PHP and HTML through XAMPP. Now, I want to publish it online (webhost), available to everyone. What should I do? Thanks in advance!
First you need a host to upload your files. For this purchase hosting space from godaddy, bluehost or someother provider. You need to purchase a domain too. After domain and hosting space, if you have purchase linux hosting, then 90% chance is that you will get a cpanel. So log into your cpanel then navigate to 'public_html'. Inside this, using some ftp client like filezilla, or cpanel's build in upload feature, upload all your files. If your website needs a database, then you need to create a database, add database user and password using database wizard tools in cpanel.
When you will purchase a hosting, these things will be very clear once you login and expore a little.
Moving a website to another host consists of the following steps:
Moving the website's files.
Moving the website's database(s) (if any).
Configuring your application to work at the new host.
Pointing your domain's DNS to the new host.
A more detailed breakdown of these steps can be found below:
Transferring the files to the new host
The most convenient way to transfer your website's files to your new web hosting account is via FTP. You should connect to your hosting account and download the files locally to your computer. Then you have to upload them to your new hosting account's main folder (usually public_html, www or httpdocs).
More information on how to use FTP can be found in our FTP tutorial.
Transferring the website's databases
You have to export the database content from your old hosting account (usually into an SQL file), create a new database at your new hosting company and import the information in it. For detailed information on how to import/export databases via phpMyAdmin you can refer to this tutorial.
Application setup on the new host
This really depends from the website application that you are using. For step-by-step instructions on how to reconfigure some of the most popular applications
Check this out https://www.heroku.com/. The website will update as you push your code to the git. It's free, easy to use and good for small project.

Deploying Codeigniter App on Amazon AWS

I recently enrolled to basic version of Amazon AWS. I was able to create a new instance and get it running state in the console. Can anyone please guide how to upload a sample php file and redirect to GoDaddy domain.
Read a lot of their online help but couldn't figure out the procedure.
Please follow the following steps. This is for Ubuntu 14.04
Setup an Web server with database and PHP
Refer: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04
Install PhpMyAdmin for setting up database
Refer: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04
Upload your database through PhpMyAdmin dashboard.
Connect to sever using SFTP clients like FileZilla or WinSCP.
Goto your webroot directory (By default /var/www/html) and upload the code.
Change the database username, password & database name in the database configuration file of your app code.
Login to Godaddy domain section and create an A record for the domain and set value as the public ip of your AWS Instance.
It will take some time to reflect in DNS. Meanwhile you can test the working of application by going to the public ip of AWS Instance.

Git autodeploy on Windows 2003 with WAMP

I work for a company that for some reason uses a Windows 2003 server with WAMP for its live product (please don't ask me why). Currently we have to push updates locally to github, manually connect to this production server with Remote Desktop Connection and pull.
We want to automate this proccess.
I have tried github webhooks with no success -> Couldn't find a way to create SSH keys for the system account (NT AUTHORITY/SYSTEM), which is the one used by apache on that server solution. The project is currently cloned via HTTPS, so we could also try saving credentials globally so that git won't prompt the local system account for password when trying to pull via PHP, but that seems like the worst possible solution security-wise.
Any ideas?
-- UPDATE --
We've decided not to worry about security implications right now. I then followed all the steps to save credentials for a new read-only user, but no success. I can see a .git-credentials file with the correct user/pass/url in:
C:\WINDOWS\system32\config\systemprofile
All commands work (via browser) except for pull, fetch, etc.
Any more ideas?
-- UPDATE 2 --
I've now changed the wampapache service to run as an administrator account instead, which also has credentials stored on its "root" folder (~). It's the same account I can push/pull via cmd without user/pass prompts. But when I try via browser... No luck.
I'm now officially out of ideas.
I have finally found a solution!
Simply editting the git config file to add user:password to the url parameter under [remote "origin"] has done the job.
url = https://user:pass#github.com/organization/project.git

phpDesigner 8 how to FTP files to remote server

I've never had so much difficulty trying to figure out something that should be so simple! I used the FTP Manager to set up a new connection. That's fine, and I see the connection in the FTP/SFTP panel. But then what?? From my Project Panel, I right click the files > Export To > FTP Folder. Then I get the FTP Properties window asking for login credentials - every single time. It just doesn't store the profile from the FTP Manager. Furthermore, I don't even see where to associate my local directories to the remote one. ???
I've searched online for over an hour now. Apparently, the built in FTP tool is buggy, but there is little else information.

Categories