Dino Geek, try to help you

How to use the mod_userdir module in Apache?


The mod\_userdir module in Apache enables users to access their sites by entering a tilde (~) followed by their username in the URL. This allows users to have their own web space on the server without having to go through the main website. Here is how to use it:

1. First, ensure that the mod\_userdir module is installed and enabled in Apache. If not, install it by using the following command in the terminal:

For Ubuntu/Debian/System: \`\`\` sudo a2enmod userdir \`\`\` For CentOS/RHEL: \`\`\` sudo yum install mod\_userdir \`\`\`

1. The next step is to configure the mod\_userdir. Open the Apache configuration file in a text editor. The location of this file may vary depending on your system, but it is usually /etc/httpd/conf/httpd.conf or /etc/apache2/apache2.conf.

1. Look for the section that contains ‘UserDir public_html’ (without quotes). This means that Apache looks for user directories in the ‘public_html’ directory of each user’s home directory. If this line is commented (starts with #), uncomment it by removing the # at the beginning of the line.

1. You can also change ‘public\_html’ to another directory if you prefer. For example, if you want Apache to look for user directories in the ‘websites’ directory of each user’s home directory, change the line to ‘UserDir websites’.

1. You also need to give Apache the necessary permissions to access the user directories. Look for a section that starts with ‘’. The settings in this section apply to all user directories. Ensure that ‘Options Indexes FollowSymLinks’ is configured, and the ‘AllowOverride’ directive is set to ‘None’ (without quotes).

1. Save the changes and exit the text editor.

1. Finally, restart Apache for the changes to take effect. The command to do this may vary depending on your system, but it is usually either systemctl restart httpd or systemctl restart apache2.

Now, each user on the system can create a ‘public\_html’ directory (or ‘websites’ directory if you changed it) in their home directory and place their HTML files inside. The files can be accessed by entering ‘http://[server-address]/~[username]’ in a web browser.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use