How to modify the Source Code of a deployed website?

Posted February 11, 2021 2.1k views
Getting StartedHTMLBuilding on DigitalOcean

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?

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.

Submit an Answer
3 answers
Show answer This answer has been marked as resolved by iuyeteos.

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.

  • Hi @bobbyiliev ,

    Thanks a lot for your advice, unfortunately, it didn´t function.
    This is what I did :
    First I enter

    cd /var/www/html

    Then (I tried with a minus L and a minus one “1” just in case )

    ls -l

    and the system replied with “command not found”
    so I tried


    and the system replied with “index.nginx-debian.html”
    so I entered

    nano index.nginx-debian.html

    And this is what I got :(

    <!DOCTYPE html>
    <title>Welcome to nginx!</title>
    body {
    width: 35em;
    margin: 0 auto;
    font-family: Tahoma, Verdana, Arial, sans-serif;
    <h1>Welcome to nginx!</h1>
    <p>If you see this page, the nginx web server is successfully installed and
    working. Further configuration is required.</p>

    <p>For online documentation and support please refer to
    <a href=“”></a>.<br/>
    Commercial support is available at
    <a href=“”></a>.</p>

    <p><em>Thank you for using nginx.</em></p>

    As you may realize I am completely new to the webdevelopment… any other ideas I could try?

    Thanks in advance

    • Hi there,

      It looks like that you are using Nginx, which is a good start.

      Now what I could suggest is running ls in the /var/www directory:

      ls /var/www

      If this is a standard setup, in there you should have the www directory and another directory where your website files are stored at.

      If this is the case, using the cd command again, you can enter into that directory and use the ls command to check the content of the folder.

      If there are no other files I could suggest checking the available configuration files at:

      ls /etc/nginx/sites-enabled/

      Let me know how it goes.

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

So I tried

ls /var/www/network/html

and got
app artisan bootstrap composer.json composer.lock config database package.json phpunit.xml public 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

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

  • Hi there,

    It looks like that your website is based on the Laravel Framework.

    This means that your HTML files (or the blade views as called in Laravel), are stored in the resources/views folder.

    In there you will find all of the HTML files.

    If the person who built the website, used the standard practices, there should be a folder called resources/views/layouts and in that folder, there should be a file called something like app.blade.php or main.blade.php or something similar. In that file, you can add your Google analytics code.

    When editing the file, make sure that you cautious as if you make a syntax error, it could cause a problem with the site.

    Let me know how it goes!