問題描述
更新** 屏幕截圖在 atom 中,但是當我使用文件資源管理器導航到目錄并單擊鼠標右鍵時,重命名或創建新文件夾的選項受到限制,我無法單擊它們.
UPDATE** The screenshot is within atom, but when I navigate to the directory using the file explorer, and right click, the option to rename or create a new folder are restricted and I cannot click on them.
我剛剛在新安裝的 UBUNTU 18.04 上完成了 LAMP 堆棧的設置.我一切正常,來自 Apache2 的默認/var/www/html/index.html 頁面在本地主機上提供,沒有端口轉發或任何唯一的域名,我現在只想從我的計算機在我的網絡上運行它.
I just finished setting up the LAMP stack on my fresh UBUNTU 18.04 installation. I have everything working, the default /var/www/html/index.html page from Apache2 is being served on localhost, no port forwarding or any unique domain name, i just wanna run this on my network from my computer for now.
如果有一種簡單的方法可以創建多個網站并輕松選擇要提供的文件夾,那很好,但我現在只想提供一個網站.
If there is a simple way to create multiple websites and easily choose which folder to serve than that's fine, but I want to serve just one website for now.
當我轉到我的/var/www/html 文件夾并嘗試編輯 index.html 文件時,它說權限被拒絕.我需要做什么才能在我構建網站的剩余時間內在此目錄中工作.我在我的系統上以 root 用戶身份登錄.
When I go to my /var/www/html folder and try to edit the index.html file it says permission denied. What do I need to do in order to work inside this directory for the remaining time that I am building the website. I am signed in as the root user on my system.
此外,如果我確實更改了權限以允許我在此目錄中工作,那么如果公眾可以訪問我的服務器,這對嘗試訪問我的服務器的人意味著什么.(現在只在本地主機上).
Also, if I do change permissions to allow me to work in this directory, what does it mean for people trying to access my server if it was available to the public. (RIGHT NOW JUST ON LOCALHOST).
讓我知道您是否需要更多信息或解釋,謝謝!
Lemme know if you need more info or explanation thanks!
推薦答案
sudo chown -R $USER:$USER /var/www
這有效,它將所有者更改為我的用戶而不是 root 用戶.我仍然不明白,因為我的用戶已經擁有 sudo 權限和所有這些權限.這是我在 ubuntu18.04 設置期間創建的用戶,所以應該沒有問題,或者 idk.
this works, it changes the owner to my user instead of root user. I still don't understand because my user already had sudo rights and all those permissions. It was the user I created during the ubuntu18.04 setup, so there shouldn't be an issue, or idk.
這篇關于創建網站時/var/www/html 中的權限被拒絕,并且它是 apache2 服務器的文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!