Creating development environment for Lucee with Oracle Virtualbox, Linux and MySQL
For development with Lucee, I would recommend having VirtualBox setup. Server OS like Ubuntu Server or CentOS running in virtual machine could access external source code (*.cfm files) from Host system (in my case, Windows 10).
Work scenario is that work files are stored on Host (Windows) machine, where they could be edited using handy Windows tools like VS Code, IntelliJ IDEA or CFEclipse. Git Repository can be managed with visual tools like GitKraken or GitHub Desktop or SourceTree. But processing of code by Apache and Lucee will be performed inside VirtualBox Virtual Machine.
Advantages of this approach are that you can have separate server installations on one host machine, isolate problems to virtual machine, and emulate performance of real server (VPS or cloud are usually has less resources that development machines, but limiting VirtualBox to 1 CPU and 2-3GB of RAM is close to real setup).
Right to the business:
/etc/sysconfig/selinux
file, setSELINUX=disabled
ifconfig ifup enp0s8 ifup enp0s3
/etc/sysconfig/network-scripts/ifcfg-enp0s3
make sure thatONBOOT=yes
ntsysv
to enable/disable sshd and firewall daemon.
PS C:\Program Files\Oracle\VirtualBox> .\VBoxManage modifyvm "centos" --natdnshostresolver1 on
yum update
cd /etc/yum.repos.d/ touch MariaDB.repo nano MariaDB.repo
# MariaDB 10.2 CentOS repository list # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
yum install MariaDB-server MariaDB-client sudo systemctl start mariadb.service sudo systemctl enable mariadb.service /usr/bin/mysql_secure_installation
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';
yum
, but to install Oracle Java SDK under Centos 7 more steps are required. As described in article, need to install Java SDK from RPM and then change settings of so called 'alternatives' to select proper JDK.# rpm -ivh jdk-8u152-linux-x64.rpm # java -version OpenJDK Runtime Environment (rhel-2.6.12.0.el7_4-x86_64 u161-b00) OpenJDK 64-Bit Server VM (build 24.161-b00, mixed mode) # /usr/sbin/alternatives --config java There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161-2.6.12.0.el7_4.x86_64/jre/bin/java) 2 /usr/java/jdk1.8.0_152/jre/bin/java Enter to keep the current selection[+], or type selection number: 2 [root@vb_win7_32bit ~]# java -version java version "1.8.0_152" Java(TM) SE Runtime Environment (build 1.8.0_152-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
wget http://cdn.lucee.org/lucee-5.2.4.037-pl0-linux-x64-installer.run # chmod 755 lucee-5.2.4.037-pl0-linux-x64-installer.run
http://devhost/lucee/admin/server.cfm
yum install epel-release yum install dkms
# cd /media/ # mkdir cdrom # mount -t iso9660 /dev/sr0 /media/cdrom # cd /media/cdrom # ./VBoxLinuxAdditions.run
DocumentRoot
directive) from shared folder.vboxsf
group.
sudo usermod -a -G vboxsf apache
httpd.conf
disable these 2 options Sendfile and MMAP:EnableMMAP off EnableSendfile off
That's it for setting up Apache and Lucee Virtualbox development environment. You may want to add ElasticSearch for logs, NodeJS or NoSQL database for modern web-development.