Fedora 29 local LAMP Selinux issues
I setup many VPS etc so I can install LAMP on Fedora. Itś very easy and simple. I already did that earlier on 27 but now I have issues with Selinux.
I want the local LAMP (so no outside access) for developing websites. However, no mather what I try I have not full access rights. I need 'sudo' to write files inside VSCODE and when I f.e. install Joomla I can remove installation folder by Joomla, I need to do that with terminal. Also in Joomla I can't write configuration file.
If I completkly shutdown selinux I have no issues anymore.
Anybody have a real good working guide how to solve this?
Here my notes, with some of the things I have tried. Working on this for days now.
yum list installed | grep -i php
ALWAYS UPDATE FIRST !!!! sudo dnf update & sudo dnf upgrade -y reboot
set hostname hostnamectl set-hostname HOSTNAME
Install lamp + phpmyadmin su -
dnf install httpd mariadb mariadb-server php php-cli php-php-gettext php-mbstring php-mcrypt php-mysqlnd php-pear php-curl php-gd php-xml php-bcmath php-zip phpmyadmin
systemctl start httpd.service systemctl start mariadb.service
activate/install Mysql mysql_secure_installation
mysql -u root
follow form mysql> quit
VirtualHosts & hosts file
sudo nano /etc/hosts
add the domainnames (test1 test of test.dev test2.dev etc)
ADDING SITES (always in /var/www/SITENAME (eerste keer met
terminal)
sudo mkdir -p /var/www/site1
change permission
sudo chcon -R -t httpd_sys_content_t /var/www !!!!
sudo usermod -a -G apache xfce
sudo chown -R $USER:$USER /var/www/site1 sudo chmod -R 755 /var/www
semanage permissive -a httpd_t
!!!!!!!!!!!!!!!!Making symlink ln -s /var/www /home/xfce/DevelopmentSites chcon -R
unconfined_u:object_r:httpd_sys_rw_content_t:s0 /home/xfce/DevelopmentSites sudo sed -i "s/User apache/User $USERNAME/g" /etc/httpd/conf/httpd.conf
semanage fcontext -a -t httpd_sys_rw_content_t
add sites virtualhost sudo nano /etc/httpd/conf/httpd.conf
at end of file add sites <virtualhost *:80=""> DocumentRoot
/var/www/site1 ServerName site1
Other Apache config directives, logs etc. </virtualhost>
COMMANDS
systemctl start httpd.service ## use restart after update systemctl enable httpd.service
systemctl start mariadb.service ## use restart after update systemctl enable mariadb.service
sudo systemctl reload httpd !!!!!
sudo chcon -R -t httpd_sys_content_t /var/www !!!!
https://fedoramagazine.org/troublesho...
https://blog.lysender.com/2015/07/cen... https://unix.stackexchange.com/questi... https://ask.fedoraproject.org/en/ques...
https://ask.fedoraproject.org/en/ques... https://askubuntu.com/questions/17823... https://ask.fedoraproject.org/en/ques...