How to Make a Public HTML Folder in Ubuntu

How can I make a public HTML folder in Ubuntu?

Assuming you've already installed apache, do the following:

sudo a2enmod userdir
sudo service apache2 reload

The first command enables the userdir apache mod, which does exactly what you want. The second reloads apache configurations so that it starts using the new configuration.

To install apache2:

sudo apt-get install apache2

Of course, you'll also need to make sure that the permissions on your public_html folder allow the www-data user to see the files in there -- 755 usually works well. To do this:

mkdir ~/public_html
chmod -R 755 ~/public_html

This will recursively (-R) go through your public_html and set the permissions to 755 (owner rwx, and both group and other r-x, r-x).

Exposing a directory/location to the web

you can use Alias:

Alias /dir1 /home/eggdrop/logs/dir1/
<Directory /home/eggdrop/logs/dir1/>
Require all granted
</Directory>

This line you can put into /etc/apache2/sites-available/default.conf , inside VirtualHost block.

Check your permission, if www-data user can read your logs directory.

How to create public_html folder?

In FileZilla, right-click in the remote pane and select Create Directory. Name it 'public_html'.

Secondly, drag your files from the local panel on the local pane to the remote pane to upload files to your public_html folder.

Create absolute link to home directory in public_html folder

You can't there part of the Browsers systems

http:// or https:// mean it's a fully qualified URL

/ means from the root of the domain

../ or pages/ relative to the current path of the URL

What i do is setup more subdomains

setup ~username.testserver/ and use each user as a domain. if you have an actual domain you can use the * as an A Record so that you dont have this problem

symlink from public_html_source to public_html

First remove the /home2/username/public_html folder (after backing it up).

rm -R /home2/username/public_html

Then apply

ln -s /home2/username/public_html_source/backend_code /home2/username/public_html


Related Topics



Leave a reply



Submit