Score:0

How to change default document root to sudo user document root in Ubuntu 21.10

br flag

I am new to Ubuntu. By following some tutorials I was able to set up a NodeJs and express server as root user. And everything worked as expected, I was able to bring my .ejs file in browser.

After that, going through some security tips online I realized that its better to use a sudo user and disable root login.

So I set up a fresh server with sudo user. So now my NodeJs server is located at home/user1 (when looked from root). But whenever I go to browser it displays default homepage located at /var/www/html.

How can I make my files being accessed from sudo user location? Help would be appriciated.

Thanks in advance.

vanadium avatar
cn flag
What do you mean with "sudo user location"? `/var/www/html` looks like a perfectly normal location where web pages for a server live. Clarify what you precisely want.
Dev Chauhan avatar
br flag
@vanadium, I only see default home page even if I run command `npm start` to start server (which starts alright). So I presume home page is coming from superuser controlled files not from server which is setup under sudo user.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.