A better and more secure solution (i get uneasy with the internet having access to an admins home folder!) is to create a webroot folder in /
Terminal time!
cd /
sudo mkdir /webroot
sudo groupadd webdev
sudo usermod -a -G yourusername webdev
sudo chown www-data:webdev /webroot/
Now point apache to your new document root /webroot at the bottom of your apache config. This can be found here: /etc/apache2/apache2.conf
sudo nano /etc/apache2/apache2.conf
CTRL-O to save, CTRL-X to exit in nano if you are not familiar with it.
Simply replace DocumentRoot /var/www/ with /webroot/
Copy your webfiles now to webroot.
sudo /etc/init.d/apache2 reload
Apache should now have restarted with all the configurations loaded.
This has created a directory in root called webroot, owned by apache2, and group owner is the new group webdev, which your user is now appended to member of (this does not replace any groups!). This will allow you to edit the files in the FTP!
This is a very simple solution for a one-website apache server. More work is required if you plan on running multiple sites (creating separate folders for them in webroot for example)
The advantages of this are that if someone does find a vulnerability, they are locked into the webroot folder, and not your home folder! Also if you ever needed to allow any more users to modify the site, you can add their user to the webdev group with sudo usermod -a -G theirusername webdev
Hope this helps!
Kind Regards
相关推荐
英文书籍,排版及页面清晰度不错,对SAP SD的相关知识还是比较全面的,个人建议有一定英语基础的人并且具备SAP基础知识的人去学习。
NAV350 报文解析 Telegram_listing_Telegrams_for_Configuring_and_Operating_the_NAV350_
很详细的ERP Sales and Distribution,收入确认等
Installing and Configuring Openfiler with DRBD and Heartbeat
Configuring SAP R3 FICO The Essential Resource for Configuring the Financial and Controlling Modules
Prepare for Microsoft Exam 70-410 – and help demonstrate your real-world mastery of implementing and configuring core services in Windows Server 2012 R2. Designed for experienced IT professionals ...
Configuring SAP R3 FICO The Essential Resource for Configuring the Financial and Controlling Modules.part3
Syngress - Configuring IPv6 for Cisco IOS(2002) 配置IPv6
4.1.3.5 Packet Tracer - Configuring IPv4 and IPv6 Interfaces.pka
在介绍如何配置和调整HP ProLiant服务器以用于低延迟应用程序时,文档主要涉及了在金融服务业中常见的高性能需求,尤其是在高频交易、市场数据分发和交易所数据处理等方面。其他需要低延迟响应的行业还包括实时信号...
Starting with installing and configuring Apache Spark with various cluster managers, you will learn to set up development environments. Further on, you will be introduced to working with RDDs, ...
Configuring and Troubleshooting TCPIP
根据提供的文件信息,本书《Installing and Configuring Windows Server 2012 Exam Ref 70-410》是一本针对Microsoft认证考试70-410的专业辅导教材。本书由Craig Zacker编写,并由Microsoft Press出版。以下是本书中...
Apache Oozie Essentials starts off with the basics right from installing and configuring Oozie from source code on your Hadoop cluster to managing your complex clusters. You will learn how to create ...
Pro Apache Phoenix covers the nuances of setting up a distributed HBase cluster with Phoenix libraries, running performance benchmarks, configuring parameters for production scenarios, and viewing the...