Question

How to modify the Source Code of a deployed website?

Connected Tutorial
This question is a follow-up to this tutorial:

I took over my deployed website which was programmed by an engineer that unfortunately, I cannot reach anymore.

I have access to the droplet IP and password, I managed to enter the back-end, but I am having trouble with the front-end. I would like to modify the Source Code, and update some data (img, link, add the blog section for better SEO and insert the google analytics code). All of the information I could find was involving wordpress :(

so my main question is …

How to access/download/modify the Source Code to paste the google analytics code?


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Houston @bobbyiliev,

We got it ¡ :)

Thank you very much (I owe you some tacos)

So this is how it was solved

cd /var/www/network/html/resources/views/layouts

then to enter and edit I wrote

nano main.blade.php

There I paste the Google Analytics code into the header section because apparently is the best way to do it and then wait to see my access in the control panel but unfortunately, it didn´t … for some time until I changed my web browser and then it worked

Muchas Gracias

Yo @bobbyiliev ,

I think we are very close to do it.

I wrote

ls /var/www

and got html ibc network social

so I tried

ls /var/www/network

which is the page im Trying to update and got html

So I tried

ls /var/www/network/html

and got app artisan bootstrap composer.json composer.lock config database package.json phpunit.xml public readme.md resources routes server.php storage tests vendor webpack.mix.js

Then I tried

 nano network.html

but it was empty and then I didn´t now what else to do :(

So I tried

ls /etc/nginx/sites-enabled/

and got

ibctoluca.com networkcoworking.com social.networkcoworking.com

Hope this is useful and thanks a lot for the support.

Bobby Iliev
Site Moderator
Site Moderator badge
February 12, 2021

Hi there @iuyeteos,

It would generally depend on the type of website that you have. But by default your files could be stored at /var/www/html so you could use the cd command to go to that directory:

cd /var/www/html

Then using the ls command you could see the contents of the directory:

ls -l 

Once you find the file that you want to edit, you can do so with a text editor like nano:

nano name_of_file.html

Let me know how it goes. Regards, Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel