By craigcosmo
I created a preset droplet call ubuntu LAMP.
I can access to this droplet via ssh. And that’s all. I don’t know what to do with the following steps
Where in the droplet should I upload my PHP app to?
How can I config droplet’s mysql so that my app can connect to mysql?
How can I upload my data to droplet’s mysql ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
In order to get your php app to work you are going to need to follow a number of steps all on your server’s command line.
Upload your application and set ownerships on your files.
Configure Apache to serve your application. See steps 1,2,4,5 from this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04
Create a database.
Import in your existing db into the new database. See the importing section of this tutorial: https://www.digitalocean.com/community/tutorials/how-to-import-and-export-databases-in-mysql-or-mariadb
After you have created a new database and imported your data you should create a new mysql user and give them access to the db. You need to log into the mysql server and run the following command:
GRANT ALL ON database.* TO user@localhost IDENTIFIED BY 'password';
Replace “database” with the name of the db you created. Replace “user” with a new username. Replace “password” with a password.
The location will be localhost and the username and password will be the ones you set in the “GRANT ALL…” command you ran.
Upload your application and set ownerships on your files
upload to where?
Say I connect to server using this command
ssh root@174.138.65.31
Then what should I do next to upload ?
There is no single correct location. You can put it anywhere you like, however, the standard location for a website or web app is under:
/var/www
If your app is called SuperApp then:
/var/www/SuperApp
Would be a good location.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.