260_Week12 - ConnorEast/Tech-Journal GitHub Wiki
Install MySQL on PHP Server
I did the PHP Shell Lab at home on a new vm. I do not have access to it so I did the following on my CA-Sec-260 Server on Vcenter:
Command 1 --> "sudo apt-get (yum) install -y httpd mariadb-server php php-intl php-mbstring php-xml php-apcu php-curl php-mysqlnd".
Command 2 --> "sudo start httpd"
Command 3 --> "sudo enable httpd"
Command 4 --> "sudo start mariabd"
Command 5 --> "sudo enable mariadb"
Command 6 --> "firewall-cmd --zone=public --permanent --add-port=443/tcp --permanent"
Command 7 --> "firewall-cmd --zone=public --permanent --add-port=443/tcp --permanent"
Command 8 --> "systemctl restart firewalld"
Command 9 --> "cd /var/www/html"
Command 10 --> "touch index.php"
Command 11 --> "vi index.php"
Command 12 --> "systemctl restart httpd"
Deliverable 1: php.info screenshot:
Create MySQL Database
Command 1 --> "mysql -u root -p"
Command 2 --> "SHOW DATABASES"
Command 3 --> "CREATE DATABASE pets"
Command 4 --> "SHOW DATABASES"
Command 5 --> "USE pets"
Command 6 --> ""CREATE TABLE cats ( id INT unsigned NOT NULL AUTO_INCREMENT, name VARCHAR(150) NOT NULL, owner VARCHAR(150) NOT NULL, birth DATE NOT NULL, PRIMARY KEY (ID))"
Command 7 --> "show tables"
command 8 --> "DESCRIBE cats"
Command 9 -->"INSERT INTO cats ( name, owner, birth) VALUES ( 'Siggy', 'Harold', '2018-01-05' ), ( 'Freya', 'Gutenberg', '2017-11-10' ), ( 'Patches', 'Charlie', '2015-05-15' );"
Command 10 --> "SELECT * FROM cats;"