setting up permissions for Virtual Host on Centos 7
0
votes
1
answer
1199
views
I am following a book's chapter on setting up Virtual Hosts. The process is:
1.create a file
/etc/httpd/conf.d/example.com.conf
2.set its content to
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/html/example/
And finally
3.execute apachectl configtest
and apachectl graceful
This appears to be working. But more commonly, DocumentRoot
is located in /home/exampleuser/public_html
. This path is problematic to apache group so I modified permissions to
drwxr-x--- 3 exampleuser apache 4096 Feb 8 09:50 exampleuser
drwxr-xr-x 2 exampleuser apache 4096 Feb 8 09:55 public_html
where exampleuser
is the user that to which the the directory belongs and was created with useradd exampleuser
command.
I also added this code in /etc/httpd/conf/httpd.conf
and reloaded httpd.service.
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
The book doesn't state what is the correct permission configuration so I am wondering if I have done it correctly? Is there a security issue if I leave the permissions as they are now?
httpd error_log file
[Wed Feb 08 10:25:55.453239 2017] [mpm_prefork:notice] [pid 4848] AH00171: Graceful restart requested, doing restart
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using example.com. Set the 'ServerName' directive globally to suppress this message
[Wed Feb 08 10:25:55.732490 2017] [auth_digest:notice] [pid 4848] AH01757: generating secret for digest authentication ...
[Wed Feb 08 10:25:55.733391 2017] [lbmethod_heartbeat:notice] [pid 4848] AH02282: No slotmem from mod_heartmonitor
[Wed Feb 08 10:25:55.736501 2017] [:warn] [pid 4848] NSSSessionCacheTimeout is deprecated. Ignoring.
[Wed Feb 08 10:25:55.745349 2017] [mpm_prefork:notice] [pid 4848] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_auth_kerb/5.4 mod_fcgid/2.3.9 mod_nss/1.0.14 NSS/3.21 Basic ECC configured -- resuming normal operations
[Wed Feb 08 10:25:55.745375 2017] [core:notice] [pid 4848] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
Asked by sanjihan
(415 rep)
Feb 8, 2017, 10:02 AM
Last activity: Feb 8, 2017, 11:07 AM
Last activity: Feb 8, 2017, 11:07 AM