Centos7.dev LAMP/Drupal8 Stack

  • VM: Linux RH64bit
  • Image:
  • root/psqa | 2w13

Links:

 

LAMP Stack Install


Activate interface

yum list installed | grep php

 


1. Apache

yum -y install httpd
sudo systemctl start httpd [OR]
sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Firewall Allow Apache

sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --reload

 

Checking Service

ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'

OR

curl http://icanhazip.com

Setup Apache Folders

[psqa@centos7dev www]$ sudo mkdir -p /var/www/uc.net/public_html
[psqa@centos7dev www]$ sudo mkdir -p /var/www/gtw.net/public_html
[psqa@centos7dev www]$ sudo mkdir -p /var/www/outlawtesting.com/public_html
[psqa@centos7dev www]$ sudo chown -R $USER:$USER /var/www/uc.net/public_html
[psqa@centos7dev www]$ sudo chown -R $USER:$USER /var/www/gtw.net/public_html
[psqa@centos7dev www]$ sudo chown -R $USER:$USER /var/www/outlawtesting.com/public_html

[psqa@centos7dev www]$ ls -l
total 0
drwxr-xr-x. 2 root root  6 Apr 20 13:11 cgi-bin
drwxr-xr-x. 3 root root 25 Jun 13 16:01 gtw.net
drwxr-xr-x. 2 root root  6 Apr 20 13:11 html
drwxr-xr-x. 3 root root 25 Jun 13 16:01 outlawtesting.com
drwxr-xr-x. 3 root root 25 Jun 13 16:01 uc.net

[psqa@centos7dev var]$ sudo chmod -R 755 /var/www

Create Index Page

nano /var/www/uc.net/public_html/index.htm

[psqa@centos7dev var]$ nano /var/www/uc.net/public_html/index.html
[psqa@centos7dev var]$ nano /var/www/gtw.net/public_html/index.html
[psqa@centos7dev var]$ nano /var/www/outlawtesting.com/public_html/index.html


<html>
  <head>
    <title>OutlawTesting.com</title>
  </head>
  <body>
    <h1>Stubbed Page</h1>
  </body>
</html>

 

/etc/httpd/conf/httpd.conf

ServerRoot "/etc/httpd"
Listen 80
ServerName 192.168.0.103:80

 

Update the html directory for AllowOverride All

<Directory "/var/www/html">
AllowOverride All

 

Section

<Directory "/var/www/html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    #AllowOverride None
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

 

 

Virtual Host Management Files

[psqa@centos7dev var]$ sudo mkdir /etc/httpd/sites-available
[sudo] password for psqa:
Sorry, try again.
[sudo] password for psqa:
[psqa@centos7dev var]$ sudo mkdir /etc/httpd/sites-enabled

 

Update httpd.conf to include 'sites-enabled'

sudo nano /etc/httpd/conf/httpd.conf
IncludeOptional sites-enabled/*.conf

 

Create Virtual Host

sudo nano /etc/httpd/sites-available/uc.net.conf

<VirtualHost *:80>
        ServerName www.uc.net
        ServerAlias uc.net
        DocumentRoot /var/www/uc.net/public_html
        ErrorLog /var/www/uc.net/error.log
        CustomLog /var/www/uc.net/requests.log combined
</VirtualHost>

 

Add to sites-available & sites-enabled

sudo ln -s /etc/httpd/sites-available/uc.net.conf /etc/httpd/sites-enabled/uc.net.conf

 

checking the journal:

journalctl -xe

quit

:q

2. MySQL

  • Install
sudo yum install mariadb-server mariadb

 

  • Start MySQL Server
sudo systemctl start mariadb

 

  • Run MySQL Security Script to lock down the installation
sudo mysql_secure_installation
Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorization.

New password: password
Re-enter new password: password
Password updated successfully!
Reloading privilege tables..
 ... Success!

Press ENTER to accept defaults for the rest of the promtps

 

  • Enable MySQL Service to Start at Boot
sudo systemctl enable mariadb.service

 

 

Set MySQL DB root password = root

[psqa@centos7dev ~]$ sudo mysql
[sudo] password for psqa:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> update user set password=PASSWORD("root") where User='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

MariaDB [mysql]> flush privilidges;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'privilidges' at line 1
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> exit
Bye

Restart MySQL

sudo systemctl stop mariadb
sudo systemctl start mariadb

3. PHP

  • Install php & php-mysql
sudo yum install php php-mysql

 

  • Restart Apache to pick up the additions
sudo systemctl restart httpd.service

 

  • Perform Lookup for the various PHP packages
yum search php-

php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php-cli.x86_64 : Command-line interface for PHP
php-common.x86_64 : Common files for PHP
php-dba.x86_64 : A database abstraction layer module for PHP applications
php-devel.x86_64 : Files needed for building PHP extensions
php-embedded.x86_64 : PHP library for embedding in applications
php-enchant.x86_64 : Enchant spelling extension for PHP applications
php-fpm.x86_64 : PHP FastCGI Process Manager
php-gd.x86_64 : A module for PHP applications for using the gd graphics library

 

Getting Package Information
yum info package_name
yum info php-fpm

. . .
Summary     : PHP FastCGI Process Manager
URL         : http://www.php.net/
License     : PHP and Zend and BSD
Description : PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
            : implementation with some additional features useful for sites of
            : any size, especially busier sites.

 

  • Install a php package
sudo yum install php-fpm

 

  • Installing multiple packages
sudo yum install package1 package2 ...
sudo yum remove package1 package2 ...

 

 

 

 

 


4. Testing PHP on Apache

  • create info.php in:
/var/www/html/
sudo nano /var/www/html/info.php
sudo vi /var/www/html/info.php

 

  • info.php contents
<?php phpinfo(); ?>

sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload

 

  • Test the file processing
http://your_server_IP_address/info.php

 

  • Remove the file
sudo rm /var/www/html/info.php

 

/etc/php.ini: TimeZone & Increase Post & Upload File Sizes to Allow Drupal Modules Installation

date.timezone = "US/Central"
post_max_size = 20M
upload_max_filesize = 20M

 

  • Restart Apache
sudo apachectl restart
systemctl status httpd

5. phpMyAdmin Installation

sudo yum install phpmyadmin

 

  • /etc/httpd/conf.d/phpMyAdmin.conf

sudo nano /etc/httpd/conf.d/phpMyAdmin.conf

  • To allow connection from any IP, not just localhost use:
  • Apache2.4: Require all granted
  • Apache2.2: Allow from All
# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       #Require ip 127.0.0.1
       #Require ip ::1
       
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     
     #Allow from 127.0.0.1
     #Allow from ::1
    
     Allow from All
   </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       #Require ip 127.0.0.1
       #Require ip ::1
       
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     
     #Allow from 127.0.0.1
     #Allow from ::1
    
     Allow from All
   </IfModule>
</Directory>

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

 

phpmyadmin conflicting packages on CentOS7

You can run the following command

yum --skip-broken install (package_name)

It will install all the dependencies and skip conflicting packages.

 

yum --skip-broken install phpmyadmin

 

[psqa@centos7dev ~]$ sudo yum --skip-broken install phpmyadmin
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.dal10.us.leaseweb.net
 * epel: mirror.compevo.com
 * extras: mirror.dal10.us.leaseweb.net
 * ius: dfw.mirror.rackspace.com
 * updates: mirror.dal10.us.leaseweb.net
Resolving Dependencies
--> Running transaction check
---> Package phpMyAdmin.noarch 0:4.4.15.10-3.el7 will be installed
--> Processing Dependency: php-tcpdf-dejavu-sans-fonts for package: phpMyAdmin-4.4.15.10-3.el7.noarch
--> Processing Dependency: php-tcpdf for package: phpMyAdmin-4.4.15.10-3.el7.noarch
--> Processing Dependency: php-php-gettext for package: phpMyAdmin-4.4.15.10-3.el7.noarch
--> Running transaction check
---> Package php-php-gettext.noarch 0:1.0.12-1.el7 will be installed
---> Package php-tcpdf.noarch 0:6.2.25-1.el7 will be installed
--> Processing Dependency: php-tidy for package: php-tcpdf-6.2.25-1.el7.noarch
--> Processing Dependency: php-composer(fedora/autoloader) for package: php-tcpdf-6.2.25-1.el7.noarch
--> Processing Dependency: php-bcmath for package: php-tcpdf-6.2.25-1.el7.noarch
---> Package php-tcpdf-dejavu-sans-fonts.noarch 0:6.2.25-1.el7 will be installed
--> Running transaction check
---> Package php-bcmath.x86_64 0:5.4.16-45.el7 will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.16-45.el7 for package: php-bcmath-5.4.16-45.el7.x86_64
---> Package php-fedora-autoloader.noarch 0:1.0.0-1.el7 will be installed
---> Package php-tidy.x86_64 0:5.4.16-7.el7 will be installed
--> Running transaction check
---> Package php-common.x86_64 0:5.4.16-45.el7 will be installed
--> Processing Conflict: php71u-common-7.1.22-1.ius.centos7.x86_64 conflicts php-common < 7.1.22-1.ius.centos7
--> Processing Conflict: php71u-json-7.1.22-1.ius.centos7.x86_64 conflicts php-json < 7.1.22-1.ius.centos7
base/7/x86_64/filelists_db                                                                                  | 6.9 MB  00:00:01     
epel/x86_64/filelists                                                                                       |  10 MB  00:00:00     
--> Running transaction check
---> Package php-bcmath.x86_64 0:5.4.16-45.el7 will be installed
--> Processing Dependency: php-bcmath for package: php-tcpdf-6.2.25-1.el7.noarch
---> Package php-common.x86_64 0:5.4.16-45.el7 will be installed
---> Package php-fedora-autoloader.noarch 0:1.0.0-1.el7 will be installed
--> Processing Dependency: php-composer(fedora/autoloader) for package: php-tcpdf-6.2.25-1.el7.noarch
---> Package php-tidy.x86_64 0:5.4.16-7.el7 will be installed
--> Processing Dependency: php-tidy for package: php-tcpdf-6.2.25-1.el7.noarch
--> Running transaction check
---> Package php-fedora-autoloader.noarch 0:1.0.0-1.el7 will be installed
--> Processing Dependency: php-composer(fedora/autoloader) for package: php-tcpdf-6.2.25-1.el7.noarch
---> Package php72u-bcmath.x86_64 0:7.2.10-1.ius.centos7 will be installed
--> Processing Dependency: php-common(x86-64) = 7.2.10-1.ius.centos7 for package: php72u-bcmath-7.2.10-1.ius.centos7.x86_64
---> Package php72u-tidy.x86_64 0:7.2.10-1.ius.centos7 will be installed
--> Running transaction check
---> Package php-fedora-autoloader.noarch 0:1.0.0-1.el7 will be installed
--> Processing Dependency: php-composer(fedora/autoloader) for package: php-tcpdf-6.2.25-1.el7.noarch
---> Package php72u-common.x86_64 0:7.2.10-1.ius.centos7 will be installed
--> Processing Conflict: php72u-common-7.2.10-1.ius.centos7.x86_64 conflicts php-common < 7.2.10-1.ius.centos7
--> Processing Conflict: php72u-common-7.2.10-1.ius.centos7.x86_64 conflicts php71u-common
ius/x86_64/filelists_db                                                                                     | 802 kB  00:00:00     

Packages skipped because of dependency problems:
    php-bcmath-5.4.16-45.el7.x86_64 from base
    php-common-5.4.16-45.el7.x86_64 from base
    php-fedora-autoloader-1.0.0-1.el7.noarch from epel
    php-php-gettext-1.0.12-1.el7.noarch from epel
    php-tcpdf-6.2.25-1.el7.noarch from epel
    php-tcpdf-dejavu-sans-fonts-6.2.25-1.el7.noarch from epel
    php-tidy-5.4.16-7.el7.x86_64 from epel
    php72u-bcmath-7.2.10-1.ius.centos7.x86_64 from ius
    php72u-common-7.2.10-1.ius.centos7.x86_64 from ius
    php72u-tidy-7.2.10-1.ius.centos7.x86_64 from ius
    phpMyAdmin-4.4.15.10-3.el7.noarch from epel

 


6. Drupal Installation

tar -xvzf *.tar.gz
  • Move unpacked folder to new dir
mv /dir /dir2
  • Remove dir if necessary ( including files )
rm -r mydir
sudo chcon -v --type=httpd_sys_rw_content_t outlaw
changing security context of ‘outlaw’
  • Create User & DB using 'localhost' ONLY
  • using % causes Drupal to get denied access

 

 

Drupal script encountering error over TimeZone

[root@hp-drplsvr default]# chcon -v --type=httpd_sys_rw_content_t services.yml
changing security context of ‘services.yml’
[root@hp-drplsvr default]# ls -Z services.yml
-rwxrwxrwx. root apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 services.yml
[root@hp-drplsvr default]# reboot

$micro = microtime(true);
$dt = DateTime::createFromFormat('U.u', $micro);
$dt->setTimezone(new DateTimeZone('America/Los_Angeles'));

 

  • /sites/default/settings.php
$databases['default']['default'] = array (
  'database' => 'outlaw',
  'username' => 'outlaw',
  'password' => 'outlaw',
  'prefix' => 'drupal_',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

 

Clean URLs


7. FTP Install

yum install vsftpd ftp -y
sudo yum install vsftpd ftp -y
sudo nano /etc/vsftpd/vsftpd.conf
sudo systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
sudo systemctl start vsftpd
sudo firewall-cmd --permanent --add-service=ftp
sudo firewall-cmd --permanent --add-port=21/tcp
sudo firewall-cmd --reload
sudo useradd ftpuser
sudo systemctl restart vsftpd

 

 


 

 


8. Git Install

sudo yum install git

Loaded plugins: fastestmirror
You need to be root to perform this command.
[psqa@centos7dev src]$ sudo yum install git
[sudo] password for psqa:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                        |  18 kB  00:00:00     
 * base: centos.mirror.lstn.net
 * epel: fedora-epel.mirror.lstn.net
 * extras: repo1.dal.innoscale.net
 * updates: mirror.dal10.us.leaseweb.net
 * webtatic: us-east.repo.webtatic.com
base                                                                                                        | 3.6 kB  00:00:00     
extras                                                                                                      | 3.4 kB  00:00:00     
jenkins                                                                                                     | 2.9 kB  00:00:00     
updates                                                                                                     | 3.4 kB  00:00:00     
webtatic                                                                                                    | 3.6 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-13.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-13.el7 for package: git-1.8.3.1-13.el7.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-13.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-13.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-13.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-13.el7.x86_64
--> Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3.1-13.el7.x86_64
--> Running transaction check
---> Package libgnome-keyring.x86_64 0:3.12.0-1.el7 will be installed
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-13.el7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
---> Package rsync.x86_64 0:3.1.2-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                             Arch                      Version                               Repository               Size
===================================================================================================================================
Installing:
 git                                 x86_64                    1.8.3.1-13.el7                        base                    4.4 M
Installing for dependencies:
 libgnome-keyring                    x86_64                    3.12.0-1.el7                          base                    109 k
 perl-Error                          noarch                    1:0.17020-2.el7                       base                     32 k
 perl-Git                            noarch                    1.8.3.1-13.el7                        base                     54 k
 perl-TermReadKey                    x86_64                    2.30-20.el7                           base                     31 k
 rsync                               x86_64                    3.1.2-4.el7                           base                    403 k

Transaction Summary
===================================================================================================================================
Install  1 Package (+5 Dependent packages)

Total download size: 5.0 M
Installed size: 23 M
Is this ok [y/d/N]: y
Downloading packages:
(1/6): libgnome-keyring-3.12.0-1.el7.x86_64.rpm                                                             | 109 kB  00:00:00     
(2/6): perl-Error-0.17020-2.el7.noarch.rpm                                                                  |  32 kB  00:00:00     
(3/6): perl-Git-1.8.3.1-13.el7.noarch.rpm                                                                   |  54 kB  00:00:00     
(4/6): perl-TermReadKey-2.30-20.el7.x86_64.rpm                                                              |  31 kB  00:00:00     
(5/6): git-1.8.3.1-13.el7.x86_64.rpm                                                                        | 4.4 MB  00:00:00     
(6/6): rsync-3.1.2-4.el7.x86_64.rpm                                                                         | 403 kB  00:00:00     
-----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                              8.5 MB/s | 5.0 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-Error-0.17020-2.el7.noarch                                                                               1/6
  Installing : rsync-3.1.2-4.el7.x86_64                                                                                        2/6
  Installing : perl-TermReadKey-2.30-20.el7.x86_64                                                                             3/6
  Installing : libgnome-keyring-3.12.0-1.el7.x86_64                                                                            4/6
  Installing : perl-Git-1.8.3.1-13.el7.noarch                                                                                  5/6
  Installing : git-1.8.3.1-13.el7.x86_64                                                                                       6/6
  Verifying  : libgnome-keyring-3.12.0-1.el7.x86_64                                                                            1/6
  Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                                                                             2/6
  Verifying  : git-1.8.3.1-13.el7.x86_64                                                                                       3/6
  Verifying  : perl-Git-1.8.3.1-13.el7.noarch                                                                                  4/6
  Verifying  : rsync-3.1.2-4.el7.x86_64                                                                                        5/6
  Verifying  : 1:perl-Error-0.17020-2.el7.noarch                                                                               6/6

Installed:
  git.x86_64 0:1.8.3.1-13.el7                                                                                                      

Dependency Installed:
  libgnome-keyring.x86_64 0:3.12.0-1.el7         perl-Error.noarch 1:0.17020-2.el7         perl-Git.noarch 0:1.8.3.1-13.el7        
  perl-TermReadKey.x86_64 0:2.30-20.el7          rsync.x86_64 0:3.1.2-4.el7               

Complete!

 

Initialize Git Repo in ~

[psqa@centos7dev ~]$ git init
Initialized empty Git repository in /home/psqa/.git/

[psqa@centos7dev ~]$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    .bash_history
#    .bash_logout
#    .bash_profile
#    .bashrc
#    .oracle_jre_usage/
#    JavaSimple/
#    SimpleJava1/
#    master.zip
#    role-strategy.hpi
nothing added to commit but untracked files present (use "git add" to track)

 

 

Add GitHub Plugin

Git Session

[psqa@centos7dev JavaSimple]$ git init
Initialized empty Git repository in /home/psqa/JavaSimple/.git/
[psqa@centos7dev JavaSimple]$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    .classpath
#    .gitignore
#    .project
#    README.md
#    src/
nothing added to commit but untracked files present (use "git add" to track)
[psqa@centos7dev JavaSimple]$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    src/hello/Hello.class
nothing added to commit but untracked files present (use "git add" to track)
[psqa@centos7dev JavaSimple]$ git --help
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty Git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
[psqa@centos7dev JavaSimple]$ get fetch --help
-bash: get: command not found
[psqa@centos7dev JavaSimple]$ git --help
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty Git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
[psqa@centos7dev JavaSimple]$ git pull --help
[psqa@centos7dev JavaSimple]$ git pull https://github.com/unityconstruct/JavaSimple.git
From https://github.com/unityconstruct/JavaSimple
 * branch            HEAD       -> FETCH_HEAD
Already up-to-date.
[psqa@centos7dev JavaSimple]$ ls
bin  README.md  src
[psqa@centos7dev JavaSimple]$ git remote add origin https://github.com/unityconstruct/JavaSimple.git
fatal: remote origin already exists.
[psqa@centos7dev JavaSimple]$ ls
bin  README.md  src
[psqa@centos7dev JavaSimple]$ cd src
[psqa@centos7dev src]$ ls
hello
[psqa@centos7dev src]$ nano trigger.txt
[psqa@centos7dev src]$ git add trigger.txt
[psqa@centos7dev src]$ ls
hello  trigger.txt
[psqa@centos7dev src]$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': ^C
[psqa@centos7dev src]$ touch twigger.txt
[psqa@centos7dev src]$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    new file:   trigger.txt
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    hello/Hello.class
#    twigger.txt
[psqa@centos7dev src]$ get add trigger.txt
-bash: get: command not found
[psqa@centos7dev src]$ ls
hello  trigger.txt  twigger.txt
[psqa@centos7dev src]$ git add twigger.txt
[psqa@centos7dev src]$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    new file:   trigger.txt
#    new file:   twigger.txt
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    hello/Hello.class
[psqa@centos7dev src]$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    new file:   trigger.txt
#    new file:   twigger.txt
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    hello/Hello.class
[psqa@centos7dev src]$ git commit -m "new trigger files for test"
[master 2e9e362] new trigger files for test
 Committer: psqa <psqa@centos7dev.hitronhub.home>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 2 files changed, 1 insertion(+)
 create mode 100644 src/trigger.txt
 create mode 100644 src/twigger.txt
[psqa@centos7dev src]$ git push -u origin master
Username for 'https://github.com': UnityConstruct
Password for 'https://UnityConstruct@github.com':
To https://github.com/unityconstruct/JavaSimple.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/unityconstruct/JavaSimple.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
[psqa@centos7dev src]$ git --help
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty Git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
[psqa@centos7dev src]$ git pull https://github.com/unityconstruct/JavaSimple.git
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 18 (delta 6), reused 12 (delta 0), pack-reused 0
Unpacking objects: 100% (18/18), done.
From https://github.com/unityconstruct/JavaSimple
 * branch            HEAD       -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 src/gitHubTriggerFile.txt | 1 +
 src/hello/Hello.java      | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 src/gitHubTriggerFile.txt
[psqa@centos7dev src]$ git push -u origin master
Username for 'https://github.com': UnityConstruct
Password for 'https://UnityConstruct@github.com':
Counting objects: 12, done.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (8/8), 817 bytes | 0 bytes/s, done.
Total 8 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 1 local object.
To https://github.com/unityconstruct/JavaSimple.git
   c7714f3..c5c472d  master -> master
Branch master set up to track remote branch master from origin.
[psqa@centos7dev src]$

Other Items


PHP 5.6

yum install php56w php56w-opcache
  • You can alternatively install PHP 5.6’s php-fpm SAPI (along with an opcode cache by doing:
yum install php56w-fpm php56w-opcache

Installing PHP7 on Apache ( phpMyAdmin on Centos7 not compatible )

Step 1: Setup the Webtatic YUM repo

  • Precompiled PHP 7.x binaries are available for CentOS 7 from the Webtatic, IUS, or Remi's RPM repositories.
  • Below are instructions on installing PHP 7.x using the Webtatic YUM repo.
  • Setup the Webtatic YUM repo:
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Step 2: Install PHP 7.1 and necessary extensions

  • Install PHP 7.1 and some of the most commonly used extensions:
sudo yum install -y mod_php71w php71w-cli php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-xml
sudo yum remove -y mod_php71w php71w-cli php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-xml
  • Note: The above packages are for general purpose use and may not suit your specific requirements. You should confirm the packages to be installed referring to the Webtatic PHP 7.1 introduction page.
  • Alternatively, if you want to install PHP 7.0, you should refer to Webtatic PHP 7.0 introduction page.

Step 3: configure PHP 7.x

  • After the installation, the PHP 7.x configuration file will be saved as /etc/php.ini. If necessary, you can use the vi text editor to modify it:
sudo cp /etc/php.ini /etc/php.ini.bak
sudo vi /etc/php.ini
  • Remember to restart your web server after modifying the /etc/php.ini file.
  • For Apache:

sudo systemctl restart httpd.service

  • For Nginx:

sudo systemctl restart nginx.service php-fpm.service


Install unzip

sudo yum install unzip
unzip file.zip -d destination_folder

 

 


 

 

 


 

 

 


Logs

Apache Install

>yum -y install httpd

[psqa@centos7dev ~]$ sudo yum -y install httpd
[sudo] password for psqa:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.lstn.net
 * extras: repo1.dal.innoscale.net
 * updates: mirror.dal10.us.leaseweb.net
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-80.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-80.el7.centos for package: httpd-2.4.6-80.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-80.el7.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-80.el7.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-80.el7.centos.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7_4.1 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-80.el7.centos will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================
 Package                 Arch               Version                           Repository        Size
=====================================================================================================
Installing:
 httpd                   x86_64             2.4.6-80.el7.centos               base             2.7 M
Installing for dependencies:
 apr                     x86_64             1.4.8-3.el7_4.1                   base             103 k
 apr-util                x86_64             1.5.2-6.el7                       base              92 k
 httpd-tools             x86_64             2.4.6-80.el7.centos               base              89 k
 mailcap                 noarch             2.1.41-2.el7                      base              31 k

Transaction Summary
=====================================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 3.0 M
Installed size: 10 M
Downloading packages:
(1/5): apr-util-1.5.2-6.el7.x86_64.rpm                                        |  92 kB  00:00:00     
(2/5): apr-1.4.8-3.el7_4.1.x86_64.rpm                                         | 103 kB  00:00:00     
(3/5): httpd-tools-2.4.6-80.el7.centos.x86_64.rpm                             |  89 kB  00:00:00     
(4/5): mailcap-2.1.41-2.el7.noarch.rpm                                        |  31 kB  00:00:00     
(5/5): httpd-2.4.6-80.el7.centos.x86_64.rpm                                   | 2.7 MB  00:00:00     
-----------------------------------------------------------------------------------------------------
Total                                                                6.6 MB/s | 3.0 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : apr-1.4.8-3.el7_4.1.x86_64                                                        1/5
  Installing : apr-util-1.5.2-6.el7.x86_64                                                       2/5
  Installing : httpd-tools-2.4.6-80.el7.centos.x86_64                                            3/5
  Installing : mailcap-2.1.41-2.el7.noarch                                                       4/5
  Installing : httpd-2.4.6-80.el7.centos.x86_64                                                  5/5
  Verifying  : httpd-tools-2.4.6-80.el7.centos.x86_64                                            1/5
  Verifying  : apr-1.4.8-3.el7_4.1.x86_64                                                        2/5
  Verifying  : mailcap-2.1.41-2.el7.noarch                                                       3/5
  Verifying  : httpd-2.4.6-80.el7.centos.x86_64                                                  4/5
  Verifying  : apr-util-1.5.2-6.el7.x86_64                                                       5/5

Installed:
  httpd.x86_64 0:2.4.6-80.el7.centos                                                                 

Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7_4.1                           apr-util.x86_64 0:1.5.2-6.el7              
  httpd-tools.x86_64 0:2.4.6-80.el7.centos               mailcap.noarch 0:2.1.41-2.el7              

Complete!

 

 


Allow Apache Through Firewall

[psqa@centos7dev ~]$ sudo firewall-cmd --permanent --add-port=80/tcp
success

[psqa@centos7dev ~]$ sudo firewall-cmd --reload
success

 


ifconfig

[psqa@centos7dev ~]$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.103  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::9eeb:3642:3c1b:de06  prefixlen 64  scopeid 0x20<link>
        inet6 fd00:8494:8c33:f7a2:cbfb:64bc:4049:35e2  prefixlen 64  scopeid 0x0<global>
        ether 08:00:27:6f:78:92  txqueuelen 1000  (Ethernet)
        RX packets 179873  bytes 266769397 (254.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 23508  bytes 2337732 (2.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 8  bytes 560 (560.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 560 (560.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 


Install Nano

[psqa@centos7dev var]$ yum install nano
Loaded plugins: fastestmirror
You need to be root to perform this command.
[psqa@centos7dev var]$ sudo yum install nano
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.lstn.net
 * extras: repo1.dal.innoscale.net
 * updates: mirror.dal10.us.leaseweb.net
Resolving Dependencies
--> Running transaction check
---> Package nano.x86_64 0:2.3.1-10.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                     Arch                          Version                               Repository                   Size
===================================================================================================================================
Installing:
 nano                        x86_64                        2.3.1-10.el7                          base                        440 k

Transaction Summary
===================================================================================================================================
Install  1 Package

Total download size: 440 k
Installed size: 1.6 M
Is this ok [y/d/N]: y
Downloading packages:
nano-2.3.1-10.el7.x86_64.rpm                                                                                | 440 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : nano-2.3.1-10.el7.x86_64                                                                                        1/1
  Verifying  : nano-2.3.1-10.el7.x86_64                                                                                        1/1

Installed:
  nano.x86_64 0:2.3.1-10.el7                                                                                                       

Complete!

 

 

 


Install Uzip

[psqa@centos7dev themes]$ sudo yum install unzip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.lstn.net
 * epel: mirror.compevo.com
 * extras: repo1.dal.innoscale.net
 * updates: mirror.dal10.us.leaseweb.net
 * webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package unzip.x86_64 0:6.0-19.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                      Arch                          Version                              Repository                   Size
===================================================================================================================================
Installing:
 unzip                        x86_64                        6.0-19.el7                           base                        170 k

Transaction Summary
===================================================================================================================================
Install  1 Package

Total download size: 170 k
Installed size: 365 k
Is this ok [y/d/N]: y
Downloading packages:
unzip-6.0-19.el7.x86_64.rpm                                                                                 | 170 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : unzip-6.0-19.el7.x86_64                                                                                         1/1
  Verifying  : unzip-6.0-19.el7.x86_64                                                                                         1/1

Installed:
  unzip.x86_64 0:6.0-19.el7