Example
This is what I did to install CakePHP on a fresh installed minimal CentOS 7
- Installed a CentOS-7-x86_64-Minimal-1611.iso in VirtualBox, two network interfaces: first NAT, second Host-Only
- set ONBOOT=yes in /etc/sysconfig/network-scripts/ifcfg-enp0s3
- reboot
- yum update
- yum install net-tools (to get ifconfig and netstat)
- yum install wget
- yum install yum-utils
- wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm
- wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
- yum-config-manager --enable remi-php71
- yum install php
- systemctl enable httpd
- systemctl start httpd
- firewall-cmd --permanent --zone=public --add-service=http
- firewall-cmd --permanent --zone=public --add-service=https
- firewall-cmd --reload
- yum install httpd mariadb-server mariadb php phpmyadmin
- systemctl start mariadb
- systemctl enable mariadb
- systemctl restart httpd
- yum install php-mbstring php-intl
- mysql_secure_installation
- curl -s https://getcomposer.org/installer | php
- cd /var/www/html/
- php composer.phar create-project --prefer-dist cakephp/app MyApp
- chown apache: -R MyApp/
- Create Database:
# mysql -u root -p
Enter password:
mysql> CREATE DATABASE mydb;
mysql> GRANT ALL ON mydb.* to 'myuser'@'localhost' IDENTIFIED BY '_password_';
mysql> FLUSH PRIVILEGES;
mysql> quit
- Create file /etc/httpd/conf.d/my_app.conf with content:
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName cakephp.myapp.net
DocumentRoot /var/www/html/MyApp
<Directory /var/www/html/MyApp>
Allowoverride All
</Directory>
</VirtualHost>
-
cd /var/www/html/secure_logging; chcon -Rv --type=httpd_user_content_rw_t tmp
-
touch /.autorelabel; reboot
-
On my host I edit /etc/hosts and enter the line (192.168.56.101 is the host-only-ip-address of my VM)
192.168.56.101 cakephp.myapp.net