Usually this tooks exectly 10 minutes.
$ rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/
Apache will not follow the symlinks.
Ok - they are disabled in the httpd.conf, quick check:
$ nano /etc/httpd/config/httpd.conf
and find the <Directory "/var/www/html"> block.
<Directory "/var/www/html">
Options +FollowSymLinks
AllowOverride None Order allow,deny Allow from all
</Directory>Damn, this was not the reason... now it started to took ages.
The solution:
The remedy has to do with reassigning the security contexts used by SELinux (/usr/sbin/setenforce enforcing).
Apache will not work with the context user_home_t or root_t but needs httpd_sys_content_t instead. To find out what contexts are associated with particular folders or symlinks, issue the following command:
$ ls -Z /my/symlink/or/directory
drwxr-xr-x root root root:object_r:root_t /my/symlink/or/directory
Fortunately, we can add this flag very easily (and recursively to subdirectories and files) using the chcon(1) command.
$ chcon -Rt httpd_sys_content_t /my/symlink/or/directory
It seems that even the root of the home directory has to have an appropriate security context (/home has home_root_t so that might do the needful too). Without that, nothing will work even if all is well at the next level down. The switches for chcon command translate as follows:
In additon:
If you have to move mysql files also, they should have the security context
user_u:object_r:mysqld_db_t
or mysql will not load them on startup. You can change it also easily with chcon.
Keine Kommentare:
Kommentar veröffentlichen