layout | group | subgroup | title | menu_title | menu_order | version | github_link | redirect_from |
---|---|---|---|---|---|---|---|---|
default |
install_pre |
Prerequisites |
SELinux and iptables |
SELinux and iptables |
200 |
2.0 |
install-gde/prereq/security.md |
/guides/v1.0/install-gde/prereq/security.html |
Magento has no recommendation about using SELinux; you can use it for enhanced security if you wish. If you use SELinux, you must configure it properly or the Magento application will function unpredictably. If you choose to use SELinux, consult a resource like the CentOS wiki to set up rules to enable communication.
If you choose to enable SELinux, you might have issues running the installer unless you change the security context of some directories as follows:
chcon -R --type httpd_sys_rw_content_t <your Magento install dir>/app/etc
chcon -R --type httpd_sys_rw_content_t <your Magento install dir>/var
chcon -R --type httpd_sys_rw_content_t <your Magento install dir>/pub/media
chcon -R --type httpd_sys_rw_content_t <your Magento install dir>/pub/static
The preceding commands work only with the Apache web server. Because of the variety of configurations and security requirements, we don't guarantee these commands work in all situations. For more information, see:
If Apache and the database server are on the same host, you can skip this section and continue with Opening Ports In Your Firewall.
To enable Apache to initiate a connection to another host with SELinux enabled:
-
To determine if SELinux is enabled, use the following command:
getenforce
Enforcing
displays to confirm that SELinux is running. -
Enter one of the following commands:
CentOS:
setsebool -P httpd_can_network_connect=1
Ubuntu:
setsebool -P apache2_can_network_connect=1
- Ubuntu: Ubuntu documentation page.
- CentOS: CentOS how-to and CentOS reference page.
- Apache
- PHP 5.5, 5.6, or 7.0—Ubuntu
- PHP 5.5, 5.6, or 7.0—CentOS
- MySQL
- Installing optional software
- [How to get the Magento software]({{ page.baseurl }}install-gde/bk-install-guide.html)