Create User Web Directory on Fedora using Apache Web Server.
Create User Web Directory on Fedora using Apache Web Server
These step by step procedures to create web directory for user in Linux Fedora core using the Apache web server. The step by step procedure below edit the setting of Apache web server configuration file httpd.conf to enable user on Fedora Core have their own web directory and this enable them to have their web pages publish on the internet.
Open and edit the Apache web server configuration file httpd.conf that located in the /etc/httpd/conf/ directory. Inside the directory open httpd.conf with the editor you like.
1. [root@fedora ~]# gedit /etc/httpd/conf/httpd.conf
2. Find in the httpd.conf, the ‘ UserDir public_html ‘ line, uncomment this line as shown on the example below.
#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
#
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disable
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
UserDir public_html
</IfModule>
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>
Save the httpd.conf file and then restart httpd service.
[root@fedora ~]#
service httpd restart
Stopping
httpd: [FAILED]
Starting httpd: [ OK ]
[root@fedora ~]#
To make sure the web server automatically start.
[root@fedora ~]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@fedora ~]#
[root@fedora ~]# chkconfig --level 345 httpd on
[root@fedora ~]#
Verify the configuration changes.
[root@fedora ~]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@fedora ~]#
Setup the user directory for web.
The step by step procedure below show the step to setup user web directory, the root user must perform this setup in order to make the user web directory accessible on the internet.
Log in as root user
[root@fedora ~]# cd /home
[root@fedora home]# pwd
/home
[root@fedora home]#
[root@fedora home]# ls -l
total 96
drwx------ 4 cicakman cicakman 4096 Mar 6 19:37 cicakman
drwx------ 3 clickers clickers 4096 Feb 13 19:11 clickers
drwx------ 4 danial danial 4096 Mar 6 18:48 danial
drwx------ 4 dyla dyla 4096 Mar 6 19:32 dyla
drwx------ 4 faiz faiz 4096 Mar 6 19:25 faiz
drwx------ 4 farid farid 4096 Mar 6 19:24 farid
drwx------ 4 fatin fatin 4096 Mar 6 19:32 fatin
drwx------ 5 fedora fedora 4096 Mar 6 19:47 fedora
drwx------ 4 ichigo ichigo 4096 Mar 6 18:51 ichigo
drwx------ 4 jayni jayni 4096 Mar 6 19:22 jayni
drwx------ 4 kayu kayu 4096 Feb 14 00:51 kayu
drwx------ 5 khai khai 4096 Mar 6 19:44 khai
drwx------ 4 lela lela 4096 Mar 6 19:44 lela
drwx------ 5 maniack maniack 4096 Mar 6 19:31 maniack
drwx------ 4 nadia nadia 4096 Mar 6 19:26 nadia
drwx------ 4 nani nani 4096 Mar 6 19:44 nani
drwx------ 4 safwan safwan 4096 Mar 6 20:28 safwan
drwx------ 4 shah shah 4096 Mar 6 19:25 shah
drwx------ 4 smith smith 4096 Feb 14 23:28 smith
drwx------ 4 tan tan 4096 Mar 6 18:49 tan
drwx------ 3 ucop ucop 4096 Mar 6 17:13 ucop
drwx------ 4 yus08 yus08 4096 Mar 6 19:19 yus08
drwx------ 3 yusuf yusuf 4096 Mar 6 17:10 yusuf
[root@fedora home]#
Execute the chmod command below.
[root@fedora home]# chmod 711 *
[root@fedora home]# ls -l
total 96
drwx--x--x 4 cicakman cicakman 4096 Mar 6 19:37 cicakman
drwx--x--x 3 clickers clickers 4096 Feb 13 19:11 clickers
drwx--x--x 4 danial danial 4096 Mar 6 18:48 danial
drwx--x--x 4 dyla dyla 4096 Mar 6 19:32 dyla
drwx--x--x 4 faiz faiz 4096 Mar 6 19:25 faiz
drwx--x--x 4 farid farid 4096 Mar 6 19:24 farid
drwx--x--x 4 fatin fatin 4096 Mar 6 19:32 fatin
drwx--x--x 5 fedora fedora 4096 Mar 6 19:47 fedora
drwx--x--x 4 ichigo ichigo 4096 Mar 6 18:51 ichigo
drwx--x--x 4 jayni jayni 4096 Mar 6 19:22 jayni
drwx--x--x 4 kayu kayu 4096 Feb 14 00:51 kayu
drwx--x--x 5 khai khai 4096 Mar 6 19:44 khai
drwx--x--x 4 lela lela 4096 Mar 6 19:44 lela
drwx--x--x 5 maniack maniack 4096 Mar 6 19:31 maniack
drwx--x--x 4 nadia nadia 4096 Mar 6 19:26 nadia
drwx--x--x 4 nani nani 4096 Mar 6 19:44 nani
drwx--x--x 4 safwan safwan 4096 Mar 6 20:28 safwan
drwx--x--x 4 shah shah 4096 Mar 6 19:25 shah
drwx--x--x 4 smith smith 4096 Feb 14 23:28 smith
drwx--x--x 4 tan tan 4096 Mar 6 18:49 tan
drwx--x--x 3 ucop ucop 4096 Mar 6 17:13 ucop
drwx--x--x 4 yus08 yus08 4096 Mar 6 19:19 yus08
drwx--x--x 3 yusuf yusuf 4096 Mar 6 17:10 yusuf
[root@fedora home]#
User create web directory.
The procedure below show step to create the web directory by normal user on Fedora Core system.
login as normal user user, in this example we use the user with user name fedora as an example for this step by step procedure.
-
create public_html pirectory
-
chmod 755
Create public html directory.
Execute the cd command to change to home directory.
[fedora@fedora ~]$ cd
[fedora@fedora ~]$
Verify.
[fedora@fedora ~]$ pwd
/home/fedora
[fedora@fedora ~]$
Execute mkdir command to make public_html directory.
[fedora@fedora ~]$ mkdir public_html
[fedora@fedora ~]$
Verify the public html directory creation.
[fedora@fedora ~]$ ls
public_html
[fedora@fedora ~]$
Change directory permission.
Execute ls command to verify the permission of the Public Html directory.
[fedora@fedora ~]$ ls -l
total 4
drwxrwxr-x 2 fedora fedora 4096 Jan 14 15:25 public_html
[fedora@fedora ~]$
If the permission not 755 for public_html directory, execute the chmod command as on example below.
[fedora@fedora ~]$ chmod 755 public_html/
[fedora@fedora ~]$
point browser to http://your_web_server/~username to test new configuration
Now user can make their on web pages and put inside the public_html in order to publish the contents on the internet
Related:
Keywords: user web directory, user web page, user web setting, public html, user public html, public_html, user public_html, web directory, public web directory, create web directory, create public html, create public_html.
- 22106 reads
- Email this page
Recent comments
8 years 44 weeks ago
8 years 48 weeks ago
9 years 8 weeks ago
9 years 15 weeks ago
9 years 25 weeks ago
9 years 28 weeks ago
9 years 35 weeks ago
9 years 43 weeks ago
9 years 47 weeks ago
9 years 51 weeks ago