What is the public_html folder?
The public_html folder is the root directory on web servers where HTML, CSS, JavaScript, and other static files that make up a website are stored and served. It is the folder that sits at the top of the file structure and is accessible on the internet via a domain name or IP address.
Inside the public_html folder, the files that make up the website are located — including images, videos, stylesheets, scripts, and more. It is also worth noting that some web applications, such as CMS platforms like WordPress, Joomla, or Drupal, also store their files in the public_html folder.
It is important to keep in mind that the public_html folder is public and any user can access the files contained within it, so you must pay attention to the security and protection of data hosted there. In summary, the public_html folder is fundamental for storing the files that make up a website and making them accessible via the internet.
How do you modify files in the public_html folder?
To modify files in the public_html folder, you need access to your hosting account and a file management programme, such as FileZilla. Once you are in the file manager, locate the files inside the public_html folder and select the one you want to modify. Keep in mind that some files may have restricted write permissions, so you may need to change the permissions before making modifications. To do this, simply right-click on the file, select «File Permissions», and set the permissions to «read and write» for the appropriate user. Once changes are made, save and close the files so that the updates are reflected on the website. Take care when modifying files in the public_html folder, as any error can affect how the website functions. It is always recommended to make a backup before making any changes.
What permissions are needed for the public_html directory?
To access and manage the public_html directory, certain server permissions are required. First, read permissions are needed to view the contents of the folder, and second, write permissions are needed to add, modify, or delete files within it.
It is also important to ensure that permissions are configured correctly to avoid security issues. In general, the recommended permissions are:
– Read (r): 4
– Write (w): 2
– Execute (x): 1
As a general rule, files should have permissions 644 and directories 755.
How can you protect the public_html folder from unauthorised access?
The public_html folder is one of the most important parts of a website, as it stores all the content displayed to the public. It is therefore essential to protect it to prevent unauthorised access and ensure the security of your data.
There are several measures you can take to protect the public_html folder, including:
1. Change access permissions: It is essential to make sure the folder's access permissions are correct. In general, permissions should be 755 for the folder and 644 for files. This allows authorised users to read and write files while preventing unauthorised users from accessing them.
2. Use strong passwords: Make sure your passwords are strong enough and change them regularly. Avoid using obvious or easy-to-guess passwords.
3. Update your software: Keep the software on your website up to date — including your CMS, plugins, and extensions.
Which control panels use public_html?
The public_html directory is primarily used by hosting control panels such as cPanel, Plesk, and DirectAdmin, among others. At Bacan you have access to cPanel and DirectAdmin depending on the hosting plan you have contracted.
These panels allow users with admin access to manage and publish content on their websites simply and efficiently. Additionally, these control panels typically include security tools that help protect the public_html folder and ensure data integrity. It is important to choose a reliable and secure control panel to avoid security issues on your website.
Which domain is installed in the public_html folder?
The public_html folder is where the primary domain of a website is installed. That is, when you purchase your web hosting, a public_html folder is assigned that corresponds to the domain you used when signing up for the hosting service. Keep in mind that subfolders can be created within public_html to host additional domains or subdomains.
What is the relationship between the public_html folder and www?
The public_html folder and the www subdomain are closely related, as both are used to access the website. When you type a website name in a browser, the server looks for the public_html folder of the corresponding domain and loads the files and content stored in it. The www subdomain is a convention used to identify the public_html folder of the main domain. In other words, a website URL can start with «www» or not, but in both cases you are accessing the same public_html folder. In any case, it is important to ensure that both the public_html folder and the www subdomain are correctly configured for the website to function properly.
How do I install a new domain name in public_html?
On all our hosting plans, you can add domains to your hosting account. To install a new domain in the public_html folder, you need to access the control panel, where you can add the domain and place it in the folder of your choice — that folder will then serve as the root for the domain you just installed.
Remember that the new domain must be registered and configured to point to our servers by setting Bacan's DNS records. If you have doubts or run into issues during the process of installing the new domain in public_html, you can contact our technical support team.
There is a www directory in the root of my hosting that shows the same content as public_html — what does this mean?
The presence of a www directory in the hosting root that shows the same content as public_html may be due to a particular server configuration. This setup is common on cPanel servers. In some cases, www is used as an alias for public_html — they are two different names pointing to the same folder. This allows users to access the website by typing the URL with or without www at the beginning.
Which folder should I upload my website files to?
Your website files should be uploaded to the public_html folder on the hosting server. You can do this via an FTP client or through the file manager in the hosting control panel. Make sure you upload the files to the correct folder, as uploading to a different folder may make your website inaccessible or cause errors. It is also recommended to keep the files and folders inside public_html clearly and neatly organised to make management and future updates easier. If you have problems or questions about how to upload files to public_html, contact the hosting technical support for help and guidance.