Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save safdar-tp/b7d282f25c86d029853451acf2a98904 to your computer and use it in GitHub Desktop.
Save safdar-tp/b7d282f25c86d029853451acf2a98904 to your computer and use it in GitHub Desktop.

Revisions

  1. @marciopaiva marciopaiva revised this gist Sep 17, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion centos7_ambiente_desenvolvimento.md
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,3 @@

    Montando uma VM para o desenvolvimento de aplicações em PHP, utilizado o CentOS 7

    (EM DESENVOLVIMENTO)
  2. @marciopaiva marciopaiva revised this gist Sep 16, 2014. 2 changed files with 2 additions and 1 deletion.
    2 changes: 1 addition & 1 deletion centos7_passo_03.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ LoadModule deflate_module modules/mod_deflate.so
    LoadModule dir_module modules/mod_dir.so
    #LoadModule dumpio_module modules/mod_dumpio.so
    #LoadModule echo_module modules/mod_echo.so
    #LoadModule env_module modules/mod_env.so
    LoadModule env_module modules/mod_env.so
    LoadModule expires_module modules/mod_expires.so
    #LoadModule ext_filter_module modules/mod_ext_filter.so
    #LoadModule filter_module modules/mod_filter.so
    1 change: 1 addition & 0 deletions centos7_passo_04.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,7 @@ upload_max_filesize = 10M
    post_max_size = 20M
    realpath_cache_size = 64k
    realpath_cache_ttl = 3600
    max_execution_time = 120
    ~~~

    ~~~sh
  3. @marciopaiva marciopaiva revised this gist Sep 15, 2014. 1 changed file with 237 additions and 0 deletions.
    237 changes: 237 additions & 0 deletions centos7_passo_08.md
    Original file line number Diff line number Diff line change
    @@ -120,3 +120,240 @@ events.mechanism = epoll
    ; See /etc/php-fpm.d/*.conf
    ~~~

    ~~~sh
    nano /etc/php-fpm.d/www.conf
    ~~~
    ~~~ini
    ; Start a new pool named 'www'.
    [www]

    ; The address on which to accept FastCGI requests.
    ; Valid syntaxes are:
    ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
    ; a specific port;
    ; 'port' - to listen on a TCP socket to all addresses on a
    ; specific port;
    ; '/path/to/unix/socket' - to listen on a unix socket.
    ; Note: This value is mandatory.
    listen = 127.0.0.1:9000

    ; Set listen(2) backlog. A value of '-1' means unlimited.
    ; Default Value: -1
    listen.backlog = -1

    ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
    ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
    ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
    ; must be separated by a comma. If this value is left blank, connections will be
    ; accepted from any ip address.
    ; Default Value: any
    listen.allowed_clients = 127.0.0.1

    ; Set permissions for unix socket, if one is used. In Linux, read/write
    ; permissions must be set in order to allow connections from a web server. Many
    ; BSD-derived systems allow connections regardless of permissions.
    ; Default Values: user and group are set as the running user
    ; mode is set to 0660
    ;listen.owner = nobody
    ;listen.group = nobody
    ;listen.mode = 0660

    ; Unix user/group of processes
    ; Note: The user is mandatory. If the group is not set, the default user's group
    ; will be used.
    ; RPM: apache Choosed to be able to access some dir as httpd
    user = apache
    ; RPM: Keep a group allowed to write in log dir.
    group = apache

    ; Choose how the process manager will control the number of child processes.
    ; Possible Values:
    ; static - a fixed number (pm.max_children) of child processes;
    ; dynamic - the number of child processes are set dynamically based on the
    ; following directives:
    ; pm.max_children - the maximum number of children that can
    ; be alive at the same time.
    ; pm.start_servers - the number of children created on startup.
    ; pm.min_spare_servers - the minimum number of children in 'idle'
    ; state (waiting to process). If the number
    ; of 'idle' processes is less than this
    ; number then some children will be created.
    ; pm.max_spare_servers - the maximum number of children in 'idle'
    ; state (waiting to process). If the number
    ; of 'idle' processes is greater than this
    ; number then some children will be killed.
    ; Note: This value is mandatory.
    pm = dynamic

    ; The number of child processes to be created when pm is set to 'static' and the
    ; maximum number of child processes to be created when pm is set to 'dynamic'.
    ; This value sets the limit on the number of simultaneous requests that will be
    ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
    ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
    ; CGI.
    ; Note: Used when pm is set to either 'static' or 'dynamic'
    ; Note: This value is mandatory.
    pm.max_children = 100

    ; The number of child processes created on startup.
    ; Note: Used only when pm is set to 'dynamic'
    ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
    pm.start_servers = 50

    ; The desired minimum number of idle server processes.
    ; Note: Used only when pm is set to 'dynamic'
    ; Note: Mandatory when pm is set to 'dynamic'
    pm.min_spare_servers = 20

    ; The desired maximum number of idle server processes.
    ; Note: Used only when pm is set to 'dynamic'
    ; Note: Mandatory when pm is set to 'dynamic'
    pm.max_spare_servers = 50

    ; The number of requests each child process should execute before respawning.
    ; This can be useful to work around memory leaks in 3rd party libraries. For
    ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
    ; Default Value: 0
    pm.max_requests = 5000

    ; The URI to view the FPM status page. If this value is not set, no URI will be
    ; recognized as a status page. By default, the status page shows the following
    ; information:
    ; accepted conn - the number of request accepted by the pool;
    ; pool - the name of the pool;
    ; process manager - static or dynamic;
    ; idle processes - the number of idle processes;
    ; active processes - the number of active processes;
    ; total processes - the number of idle + active processes.
    ; The values of 'idle processes', 'active processes' and 'total processes' are
    ; updated each second. The value of 'accepted conn' is updated in real time.
    ; Example output:
    ; accepted conn: 12073
    ; pool: www
    ; process manager: static
    ; idle processes: 35
    ; active processes: 65
    ; total processes: 100
    ; By default the status page output is formatted as text/plain. Passing either
    ; 'html' or 'json' as a query string will return the corresponding output
    ; syntax. Example:
    ; http://www.foo.bar/status
    ; http://www.foo.bar/status?json
    ; http://www.foo.bar/status?html
    ; Note: The value must start with a leading slash (/). The value can be
    ; anything, but it may not be a good idea to use the .php extension or it
    ; may conflict with a real PHP file.
    ; Default Value: not set
    ;pm.status_path = /status

    ; The ping URI to call the monitoring page of FPM. If this value is not set, no
    ; URI will be recognized as a ping page. This could be used to test from outside
    ; that FPM is alive and responding, or to
    ; - create a graph of FPM availability (rrd or such);
    ; - remove a server from a group if it is not responding (load balancing);
    ; - trigger alerts for the operating team (24/7).
    ; Note: The value must start with a leading slash (/). The value can be
    ; anything, but it may not be a good idea to use the .php extension or it
    ; may conflict with a real PHP file.
    ; Default Value: not set
    ;ping.path = /ping

    ; This directive may be used to customize the response of a ping request. The
    ; response is formatted as text/plain with a 200 response code.
    ; Default Value: pong
    ;ping.response = pong

    ; The timeout for serving a single request after which the worker process will
    ; be killed. This option should be used when the 'max_execution_time' ini option
    ; does not stop script execution for some reason. A value of '0' means 'off'.
    ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    ; Default Value: 0
    ;request_terminate_timeout = 0

    ; The timeout for serving a single request after which a PHP backtrace will be
    ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
    ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    ; Default Value: 0
    request_slowlog_timeout = 20s

    ; The log file for slow requests
    ; Default Value: not set
    ; Note: slowlog is mandatory if request_slowlog_timeout is set
    slowlog = /var/log/php-fpm/www-slow.log

    ; Set open file descriptor rlimit.
    ; Default Value: system defined value
    rlimit_files = 50000

    ; Set max core size rlimit.
    ; Possible Values: 'unlimited' or an integer greater or equal to 0
    ; Default Value: system defined value
    rlimit_core = unlimited

    ; Chroot to this directory at the start. This value must be defined as an
    ; absolute path. When this value is not set, chroot is not used.
    ; Note: chrooting is a great security feature and should be used whenever
    ; possible. However, all PHP paths will be relative to the chroot
    ; (error_log, sessions.save_path, ...).
    ; Default Value: not set
    ;chroot =

    ; Chdir to this directory at the start. This value must be an absolute path.
    ; Default Value: current directory or / when chroot
    ;chdir = /var/www

    ; Redirect worker stdout and stderr into main error log. If not set, stdout and
    ; stderr will be redirected to /dev/null according to FastCGI specs.
    ; Default Value: no
    catch_workers_output = yes

    ; Limits the extensions of the main script FPM will allow to parse. This can
    ; prevent configuration mistakes on the web server side. You should only limit
    ; FPM to .php extensions to prevent malicious users to use other extensions to
    ; exectute php code.
    ; Note: set an empty value to allow all extensions.
    ; Default Value: .php
    ;security.limit_extensions = .php .php3 .php4 .php5

    ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
    ; the current environment.
    ; Default Value: clean env
    env[HOSTNAME] = 'ms-devel'
    env[NLS_LANG] = 'BRAZILIAN PORTUGUESE_BRAZIL.AL32UTF8'
    env[NLS_TERRITORY] = 'BRAZIL'
    env[NLS_DUAL_CURRENCY] = 'R$'
    env[NLS_CURRENCY] = 'R$'
    env[NLS_ISO_CURRENCY] = 'BRAZIL'
    env[NLS_DATE_LANGUAGE] = 'BRAZILIAN PORTUGUESE'
    env[NLS_DATE_FORMAT] = 'DD/MM/YYYY'
    env[NLS_TIME_FORMAT] = 'HH24:MI:SS'
    env[NLS_TIMESTAMP_FORMAT] = 'DD/MM/YYYY HH24:MI:SS'

    ; Additional php.ini defines, specific to this pool of workers. These settings
    ; overwrite the values previously defined in the php.ini. The directives are the
    ; same as the PHP SAPI:
    ; php_value/php_flag - you can set classic ini defines which can
    ; be overwritten from PHP call 'ini_set'.
    ; php_admin_value/php_admin_flag - these directives won't be overwritten by
    ; PHP call 'ini_set'
    ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

    ; Defining 'extension' will load the corresponding shared extension from
    ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
    ; overwrite previously defined php.ini values, but will append the new value
    ; instead.

    ; Default Value: nothing is defined by default except the values in php.ini and
    ; specified at startup with the -d argument
    ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]
    ;php_flag[display_errors] = off
    php_admin_value[error_log] = /var/log/php-fpm/www-error.log
    php_admin_flag[log_errors] = on
    ;php_admin_value[memory_limit] = 128M

    ; Set session path to a directory owned by process user
    php_value[session.save_handler] = files
    php_value[session.save_path] = /var/lib/php/session
    php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache
    ~~~

  4. @marciopaiva marciopaiva revised this gist Sep 15, 2014. 2 changed files with 126 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions centos7_passo_04.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,10 @@ Altere as seguintes linhas:
    ~~~ini
    date.timezone = "America/Sao_Paulo"
    default_charset = "UTF-8"
    upload_max_filesize = 10M
    post_max_size = 20M
    realpath_cache_size = 64k
    realpath_cache_ttl = 3600
    ~~~

    ~~~sh
    122 changes: 122 additions & 0 deletions centos7_passo_08.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,122 @@
    ##### Configuração PHP-PFM
    ---

    ~~~sh
    nano /etc/php-fpm.conf
    ~~~
    ~~~ini
    ;;;;;;;;;;;;;;;;;;;;;
    ; FPM Configuration ;
    ;;;;;;;;;;;;;;;;;;;;;

    ; All relative paths in this configuration file are relative to PHP's install
    ; prefix.

    ; Include one or more files. If glob(3) exists, it is used to include a bunch of
    ; files from a glob(3) pattern. This directive can be used everywhere in the
    ; file.
    include=/etc/php-fpm.d/*.conf

    ;;;;;;;;;;;;;;;;;;
    ; Global Options ;
    ;;;;;;;;;;;;;;;;;;

    [global]
    ; Pid file
    ; Default Value: none
    pid = /run/php-fpm/php-fpm.pid

    ; Error log file
    ; If it's set to "syslog", log is sent to syslogd instead of being written
    ; in a local file.
    ; Default Value: /var/log/php-fpm.log
    error_log = /var/log/php-fpm/error.log

    ; syslog_facility is used to specify what type of program is logging the
    ; message. This lets syslogd specify that messages from different facilities
    ; will be handled differently.
    ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
    ; Default Value: daemon
    ;syslog.facility = daemon

    ; syslog_ident is prepended to every message. If you have multiple FPM
    ; instances running on the same server, you can change the default value
    ; which must suit common needs.
    ; Default Value: php-fpm
    ;syslog.ident = php-fpm

    ; Log level
    ; Possible Values: alert, error, warning, notice, debug
    ; Default Value: notice
    ;log_level = notice

    ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
    ; interval set by emergency_restart_interval then FPM will restart. A value
    ; of '0' means 'Off'.
    ; Default Value: 0
    emergency_restart_threshold = 10

    ; Interval of time used by emergency_restart_interval to determine when
    ; a graceful restart will be initiated. This can be useful to work around
    ; accidental corruptions in an accelerator's shared memory.
    ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
    ; Default Unit: seconds
    ; Default Value: 0
    emergency_restart_interval = 1m

    ; Time limit for child processes to wait for a reaction on signals from master.
    ; Available units: s(econds), m(inutes), h(ours), or d(ays)
    ; Default Unit: seconds
    ; Default Value: 0
    process_control_timeout = 10

    ; The maximum number of processes FPM will fork. This has been design to control
    ; the global number of processes when using dynamic PM within a lot of pools.
    ; Use it with caution.
    ; Note: A value of 0 indicates no limit
    ; Default Value: 0
    ;process.max = 128

    ; Specify the nice(2) priority to apply to the master process (only if set)
    ; The value can vary from -19 (highest priority) to 20 (lower priority)
    ; Note: - It will only work if the FPM master process is launched as root
    ; - The pool process will inherit the master process priority
    ; unless it specified otherwise
    ; Default Value: no set
    ;process.priority = -19

    ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
    ; Default Value: yes
    daemonize = yes

    ; Set open file descriptor rlimit for the master process.
    ; Default Value: system defined value
    ;rlimit_files = 1024

    ; Set max core size rlimit for the master process.
    ; Possible Values: 'unlimited' or an integer greater or equal to 0
    ; Default Value: system defined value
    ;rlimit_core = 0

    ; Specify the event mechanism FPM will use. The following is available:
    ; - select (any POSIX os)
    ; - poll (any POSIX os)
    ; - epoll (linux >= 2.5.44)
    ; Default Value: not set (auto detection)
    events.mechanism = epoll

    ; When FPM is build with systemd integration, specify the interval,
    ; in second, between health report notification to systemd.
    ; Set to 0 to disable.
    ; Available Units: s(econds), m(inutes), h(ours)
    ; Default Unit: seconds
    ; Default value: 10
    ;systemd_interval = 10

    ;;;;;;;;;;;;;;;;;;;;
    ; Pool Definitions ;
    ;;;;;;;;;;;;;;;;;;;;

    ; See /etc/php-fpm.d/*.conf
    ~~~

  5. @marciopaiva marciopaiva revised this gist Sep 15, 2014. 1 changed file with 102 additions and 0 deletions.
    102 changes: 102 additions & 0 deletions centos7_passo_07.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,102 @@
    ##### Configuração Zend OpCache
    ---

    ~~~sh
    nano /etc/php.d/opcache.ini
    ~~~
    ~~~ini
    ; Enable Zend OPcache extension module
    zend_extension=opcache.so

    ; Determines if Zend OPCache is enabled
    opcache.enable=1

    ; Determines if Zend OPCache is enabled for the CLI version of PHP
    opcache.enable_cli=1

    ; The OPcache shared memory storage size.
    opcache.memory_consumption=128

    ; The amount of memory for interned strings in Mbytes.
    opcache.interned_strings_buffer=8

    ; The maximum number of keys (scripts) in the OPcache hash table.
    ; Only numbers between 200 and 100000 are allowed.
    opcache.max_accelerated_files=7000

    ; The maximum percentage of "wasted" memory until a restart is scheduled.
    ;opcache.max_wasted_percentage=5

    ; When this directive is enabled, the OPcache appends the current working
    ; directory to the script key, thus eliminating possible collisions between
    ; files with the same name (basename). Disabling the directive improves
    ; performance, but may break existing applications.
    ;opcache.use_cwd=1

    ; When disabled, you must reset the OPcache manually or restart the
    ; webserver for changes to the filesystem to take effect.
    ;opcache.validate_timestamps=1

    ; How often (in seconds) to check file timestamps for changes to the shared
    ; memory storage allocation. ("1" means validate once per second, but only
    ; once per request. "0" means always validate)
    opcache.revalidate_freq=60

    ; Enables or disables file search in include_path optimization
    ;opcache.revalidate_path=0

    ; If disabled, all PHPDoc comments are dropped from the code to reduce the
    ;size of the optimized code.
    ;opcache.save_comments=1

    ; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
    ; may be always stored (save_comments=1), but not loaded by applications
    ; that don't need them anyway.
    ;opcache.load_comments=1

    ; If enabled, a fast shutdown sequence is used for the accelerated code
    opcache.fast_shutdown=1

    ; Allow file existence override (file_exists, etc.) performance feature.
    ;opcache.enable_file_override=0

    ; A bitmask, where each bit enables or disables the appropriate OPcache
    ; passes
    ;opcache.optimization_level=0xffffffff

    ;opcache.inherited_hack=1
    ;opcache.dups_fix=0

    ; The location of the OPcache blacklist file (wildcards allowed).
    ; Each OPcache blacklist file is a text file that holds the names of files
    ; that should not be accelerated.
    opcache.blacklist_filename=/etc/php.d/opcache*.blacklist

    ; Allows exclusion of large files from being cached. By default all files
    ; are cached.
    ;opcache.max_file_size=0

    ; Check the cache checksum each N requests.
    ; The default value of "0" means that the checks are disabled.
    ;opcache.consistency_checks=0

    ; How long to wait (in seconds) for a scheduled restart to begin if the cache
    ; is not being accessed.
    ;opcache.force_restart_timeout=180

    ; OPcache error_log file name. Empty string assumes "stderr".
    ;opcache.error_log=

    ; All OPcache errors go to the Web server log.
    ; By default, only fatal errors (level 0) or errors (level 1) are logged.
    ; You can also enable warnings (level 2), info messages (level 3) or
    ; debug messages (level 4).
    ;opcache.log_verbosity_level=1

    ; Preferred Shared Memory back-end. Leave empty and let the system decide.
    ;opcache.preferred_memory_model=

    ; Protect the shared memory from unexpected writing during script execution.
    ; Useful for internal debugging only.
    ;opcache.protect_memory=0
    ~~~
  6. @marciopaiva marciopaiva revised this gist Sep 15, 2014. 1 changed file with 59 additions and 1 deletion.
    60 changes: 59 additions & 1 deletion centos7_passo_06.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,62 @@
    ##### Configuração Apc Cache
    ---

    asdf
    ~~~sh
    nano /etc/php.d/apcu.ini
    ~~~
    ~~~ini
    ; Enable APCu extension module
    extension = apcu.so

    apc.enabled=1
    apc.shm_segments=1

    ;32M per WordPress install
    apc.shm_size=128M

    ;Relative to the number of cached files (you may need to watch your stats for a day or two to find out a good number)
    apc.num_files_hint=7000

    ;Relative to the size of WordPress
    apc.user_entries_hint=4096

    ;The number of seconds a cache entry is allowed to idle in a slot before APC dumps the cache
    apc.ttl=7200
    apc.user_ttl=7200
    apc.gc_ttl=3600

    ;Setting this to 0 will give you the best performance, as APC will
    ;not have to check the IO for changes. However, you must clear
    ;the APC cache to recompile already cached files. If you are still
    ;developing, updating your site daily in WP-ADMIN, and running W3TC
    ;set this to 1
    apc.stat=1

    ;This MUST be 0, WP can have errors otherwise!
    apc.include_once_override=0

    ;Only set to 1 while debugging
    apc.enable_cli=0

    ;Allow 2 seconds after a file is created before it is cached to prevent users from seeing half-written/weird pages
    apc.file_update_protection=2

    ;Leave at 2M or lower. WordPress does't have any file sizes close to 2M
    apc.max_file_size=2M

    apc.cache_by_default=1
    apc.use_request_time=1
    apc.slam_defense=0
    apc.mmap_file_mask=/tmp/apc.XXXXXX
    apc.stat_ctime=0
    apc.canonicalize=1
    apc.write_lock=1
    apc.report_autofilter=0
    apc.rfc1867=0
    apc.rfc1867_prefix =upload_
    apc.rfc1867_name=APC_UPLOAD_PROGRESS
    apc.rfc1867_freq=0
    apc.rfc1867_ttl=3600
    apc.lazy_classes=0
    apc.lazy_functions=0
    ~~~
  7. @marciopaiva marciopaiva revised this gist Sep 15, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions centos7_passo_06.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    ##### Configuração Apc Cache
    ---

    asdf
  8. @marciopaiva marciopaiva revised this gist Sep 13, 2014. 4 changed files with 37 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion centos7_ambiente_desenvolvimento.md
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@

    Montando uma VM para o desenvolvimento de aplicações em PHP, utilizado o CentOS 7

    (EM DESENVOLVIMENTO)
    (EM DESENVOLVIMENTO)
    2 changes: 1 addition & 1 deletion centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ reboot
    Instalação dos RPMs e Repositórios necessários

    ~~~sh
    yum install net-tools nano wget libaio
    yum install net-tools nano wget libaio perl
    rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
    rpm -ivh /tmp/oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
    22 changes: 22 additions & 0 deletions centos7_passo_03.md
    Original file line number Diff line number Diff line change
    @@ -166,12 +166,34 @@ nano /etc/httpd/conf.modules.d/01-cgi.conf

    <IfModule mpm_worker_module>
    LoadModule cgid_module modules/mod_cgid.so
    ThreadsPerChild 25
    StartServers 3
    ServerLimit 400
    MinSpareThreads 75
    MaxSpareThreads 250
    MaxRequestWorkers 10000
    MaxConnectionsPerChild 0
    </IfModule>

    <IfModule mpm_event_module>
    LoadModule cgid_module modules/mod_cgid.so
    ThreadsPerChild 25
    StartServers 3
    ServerLimit 400
    MinSpareThreads 75
    MaxSpareThreads 250
    MaxRequestWorkers 10000
    MaxConnectionsPerChild 0
    </IfModule>

    <IfModule mpm_prefork_module>
    LoadModule cgi_module modules/mod_cgi.so
    StartServers 5
    ServerLimit 1000
    MinSpareServers 5
    MaxSpareServers 10
    MaxRequestWorkers 1000
    MaxConnectionsPerChild 0
    </IfModule>
    ~~~

    13 changes: 13 additions & 0 deletions centos7_passo_99.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    ##### Ferramenta para tunning do apache
    ---

    ~~~sh
    wget -O /sbin/check_httpd_limits https://check-httpd-limits.googlecode.com/svn/trunk/check_httpd_limits.pl
    chmod +x /sbin/check_httpd_limits
    ~~~

    Para checar as configurações do seu apache

    ~~~sh
    check_httpd_limits --config=/etc/httpd/conf.modules.d/01-cgi.conf --verbose
    ~~~
  9. @marciopaiva marciopaiva revised this gist Sep 12, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ Para evitar surpresas, realizei mais um reboot para validar a atualização de k
    Instalação do Apache, PHP e libs.

    ~~~sh
    yum --enablerepo=remi,remi-php55 install httpd php-fpm php-common php-pecl-apcu php-gd php-intl php-mbstring php-mssql php-mysql php-mysqlnd php-oci8 php-xmlrpc php-openssl php-pgsql php-soap php-opcache php-mcrypt
    yum --enablerepo=remi,remi-php55 install httpd php-fpm php-common php-pecl-apcu php-gd php-intl php-mbstring php-mssql php-mysql php-mysqlnd php-oci8 php-xmlrpc php-openssl php-pgsql php-soap php-opcache php-mcrypt php-pecl-pthreads
    ~~~

    Iniciando o serviço do Apache, setando para que seja iniciado ao boot e verificando o status.
  10. @marciopaiva marciopaiva revised this gist Sep 12, 2014. 1 changed file with 23 additions and 1 deletion.
    24 changes: 23 additions & 1 deletion centos7_passo_03.md
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,8 @@

    O Apache 2.4 no CentOS, praticamente carrega todos os módulos na sua instalação. Como não vou utilizar todos os módulos vou desabilitar e deixar apenas o que preciso.

    Todas as configurações foram baseadas no [CIS Apache HTTP Server 2.4 Benchmark] (http://und.edu/cio/it-security/policy/_files/docs/cis-apache-http-server-2-4-benchmark-v1-1-0.pdf)

    ~~~sh
    nano /etc/httpd/conf.modules.d/00-base.conf
    ~~~
    @@ -174,7 +176,27 @@ nano /etc/httpd/conf.modules.d/01-cgi.conf
    ~~~

    Ufa!!! deu trabalho testar todos os módulos para saber o que precisa para rodar.
    Recomendo a leitura do [CIS Apache HTTP Server 2.4 Benchmark] (http://und.edu/cio/it-security/policy/_files/docs/cis-apache-http-server-2-4-benchmark-v1-1-0.pdf)

    Com base no documento, vou criar um arquivo de segurança para aplicar as regras que não estão sendo aplicadas.

    ~~~sh
    nano /etc/httpd/conf.d/security.conf
    ~~~
    ~~~ini
    #
    # http://und.edu/cio/it-security/policy/_files/docs/cis-apache-http-server-2-4-benchmark-v1-1-0.pdf
    #

    Timeout 10
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
    LimitRequestline 512
    LimitRequestFields 100
    LimitRequestFieldsize 1024
    LimitRequestBody 102400
    ~~~

    ~~~sh
    systemctl restart httpd.service
  11. @marciopaiva marciopaiva revised this gist Sep 12, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion centos7_passo_03.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ LoadModule mime_magic_module modules/mod_mime_magic.so
    LoadModule mime_module modules/mod_mime.so
    LoadModule negotiation_module modules/mod_negotiation.so
    #LoadModule remoteip_module modules/mod_remoteip.so
    #LoadModule reqtimeout_module modules/mod_reqtimeout.so
    LoadModule reqtimeout_module modules/mod_reqtimeout.so
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule setenvif_module modules/mod_setenvif.so
    #LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
    @@ -174,6 +174,7 @@ nano /etc/httpd/conf.modules.d/01-cgi.conf
    ~~~

    Ufa!!! deu trabalho testar todos os módulos para saber o que precisa para rodar.
    Recomendo a leitura do [CIS Apache HTTP Server 2.4 Benchmark] (http://und.edu/cio/it-security/policy/_files/docs/cis-apache-http-server-2-4-benchmark-v1-1-0.pdf)

    ~~~sh
    systemctl restart httpd.service
  12. @marciopaiva marciopaiva revised this gist Sep 12, 2014. 1 changed file with 149 additions and 2 deletions.
    151 changes: 149 additions & 2 deletions centos7_passo_03.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,109 @@
    ##### Configuração Apache
    ---

    Como meu apache vai servir apenas como um proxy para o php-fpm, vou utilizar o MPM Event (EM TESTE).
    O Apache 2.4 no CentOS, praticamente carrega todos os módulos na sua instalação. Como não vou utilizar todos os módulos vou desabilitar e deixar apenas o que preciso.

    ~~~sh
    nano /etc/httpd/conf.modules.d/00-mpm.conf
    nano /etc/httpd/conf.modules.d/00-base.conf
    ~~~
    ~~~ini
    #
    # This file loads most of the modules included with the Apache HTTP
    # Server itself.
    #

    #LoadModule access_compat_module modules/mod_access_compat.so
    #LoadModule actions_module modules/mod_actions.so
    LoadModule alias_module modules/mod_alias.so
    #LoadModule allowmethods_module modules/mod_allowmethods.so
    #LoadModule auth_basic_module modules/mod_auth_basic.so
    #LoadModule auth_digest_module modules/mod_auth_digest.so
    #LoadModule authn_anon_module modules/mod_authn_anon.so
    LoadModule authn_core_module modules/mod_authn_core.so
    #LoadModule authn_dbd_module modules/mod_authn_dbd.so
    #LoadModule authn_dbm_module modules/mod_authn_dbm.so
    LoadModule authn_file_module modules/mod_authn_file.so
    #LoadModule authn_socache_module modules/mod_authn_socache.so
    LoadModule authz_core_module modules/mod_authz_core.so
    #LoadModule authz_dbd_module modules/mod_authz_dbd.so
    #LoadModule authz_dbm_module modules/mod_authz_dbm.so
    #LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
    LoadModule authz_host_module modules/mod_authz_host.so
    #LoadModule authz_owner_module modules/mod_authz_owner.so
    #LoadModule authz_user_module modules/mod_authz_user.so
    LoadModule autoindex_module modules/mod_autoindex.so
    #LoadModule cache_module modules/mod_cache.so
    #LoadModule cache_disk_module modules/mod_cache_disk.so
    #LoadModule data_module modules/mod_data.so
    #LoadModule dbd_module modules/mod_dbd.so
    LoadModule deflate_module modules/mod_deflate.so
    LoadModule dir_module modules/mod_dir.so
    #LoadModule dumpio_module modules/mod_dumpio.so
    #LoadModule echo_module modules/mod_echo.so
    #LoadModule env_module modules/mod_env.so
    LoadModule expires_module modules/mod_expires.so
    #LoadModule ext_filter_module modules/mod_ext_filter.so
    #LoadModule filter_module modules/mod_filter.so
    #LoadModule headers_module modules/mod_headers.so
    #LoadModule include_module modules/mod_include.so
    #LoadModule info_module modules/mod_info.so
    LoadModule log_config_module modules/mod_log_config.so
    LoadModule logio_module modules/mod_logio.so
    LoadModule mime_magic_module modules/mod_mime_magic.so
    LoadModule mime_module modules/mod_mime.so
    LoadModule negotiation_module modules/mod_negotiation.so
    #LoadModule remoteip_module modules/mod_remoteip.so
    #LoadModule reqtimeout_module modules/mod_reqtimeout.so
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule setenvif_module modules/mod_setenvif.so
    #LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
    #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
    #LoadModule socache_dbm_module modules/mod_socache_dbm.so
    #LoadModule socache_memcache_module modules/mod_socache_memcache.so
    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
    #LoadModule status_module modules/mod_status.so
    #LoadModule substitute_module modules/mod_substitute.so
    #LoadModule suexec_module modules/mod_suexec.so
    #LoadModule unique_id_module modules/mod_unique_id.so
    LoadModule unixd_module modules/mod_unixd.so
    #LoadModule userdir_module modules/mod_userdir.so
    #LoadModule version_module modules/mod_version.so
    #LoadModule vhost_alias_module modules/mod_vhost_alias.so

    #LoadModule buffer_module modules/mod_buffer.so
    #LoadModule watchdog_module modules/mod_watchdog.so
    #LoadModule heartbeat_module modules/mod_heartbeat.so
    #LoadModule heartmonitor_module modules/mod_heartmonitor.so
    #LoadModule usertrack_module modules/mod_usertrack.so
    #LoadModule dialup_module modules/mod_dialup.so
    #LoadModule charset_lite_module modules/mod_charset_lite.so
    #LoadModule log_debug_module modules/mod_log_debug.so
    #LoadModule ratelimit_module modules/mod_ratelimit.so
    #LoadModule reflector_module modules/mod_reflector.so
    #LoadModule request_module modules/mod_request.so
    #LoadModule sed_module modules/mod_sed.so
    #LoadModule speling_module modules/mod_speling.so
    ~~~

    ~~~sh
    nano /etc/httpd/conf.modules.d/00-dav.conf
    ~~~
    ~~~ini
    #LoadModule dav_module modules/mod_dav.so
    #LoadModule dav_fs_module modules/mod_dav_fs.so
    #LoadModule dav_lock_module modules/mod_dav_lock.so
    ~~~

    ~~~sh
    nano /etc/httpd/conf.modules.d/00-lua.conf
    ~~~
    ~~~ini
    #LoadModule lua_module modules/mod_lua.so
    ~~~

    ~~~sh
    nano /etc/httpd/conf.modules.d/00-mpm.conf
    ~~~
    ~~~ini
    # Select the MPM module which should be used by uncommenting exactly
    # one of the following LoadModule lines:
    @@ -28,6 +125,56 @@ nano /etc/httpd/conf.modules.d/00-mpm.conf
    LoadModule mpm_event_module modules/mod_mpm_event.so
    ~~~

    ~~~sh
    nano /etc/httpd/conf.modules.d/00-proxy.conf
    ~~~
    ~~~ini
    # This file configures all the proxy modules:
    LoadModule proxy_module modules/mod_proxy.so
    #LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
    #LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
    #LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
    #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
    #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    #LoadModule proxy_connect_module modules/mod_proxy_connect.so
    #LoadModule proxy_express_module modules/mod_proxy_express.so
    LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
    #LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
    #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    #LoadModule proxy_http_module modules/mod_proxy_http.so
    #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
    ~~~

    ~~~sh
    nano /etc/httpd/conf.modules.d/00-systemd.conf
    ~~~
    ~~~ini
    # This file configures systemd module:
    LoadModule systemd_module modules/mod_systemd.so
    ~~~

    ~~~sh
    nano /etc/httpd/conf.modules.d/01-cgi.conf
    ~~~
    ~~~ini
    # This configuration file loads a CGI module appropriate to the MPM
    # which has been configured in 00-mpm.conf. mod_cgid should be used
    # with a threaded MPM; mod_cgi with the prefork MPM.

    <IfModule mpm_worker_module>
    LoadModule cgid_module modules/mod_cgid.so
    </IfModule>
    <IfModule mpm_event_module>
    LoadModule cgid_module modules/mod_cgid.so
    </IfModule>
    <IfModule mpm_prefork_module>
    LoadModule cgi_module modules/mod_cgi.so
    </IfModule>
    ~~~

    Ufa!!! deu trabalho testar todos os módulos para saber o que precisa para rodar.

    ~~~sh
    systemctl restart httpd.service
    ~~~
  13. @marciopaiva marciopaiva revised this gist Sep 11, 2014. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions centos7_passo_05.md
    Original file line number Diff line number Diff line change
    @@ -30,6 +30,14 @@ Incluir no arquivo o NLS_LANG, conforme arquivo abaixo:
    # man systemd.exec

    NLS_LANG = 'BRAZILIAN PORTUGUESE_BRAZIL.AL32UTF8'
    NLS_TERRITORY = 'BRAZIL'
    NLS_DUAL_CURRENCY = 'R$'
    NLS_CURRENCY = 'R$'
    NLS_ISO_CURRENCY = 'BRAZIL'
    NLS_DATE_LANGUAGE = 'BRAZILIAN PORTUGUESE'
    NLS_DATE_FORMAT = 'DD/MM/YYYY'
    NLS_TIME_FORMAT = 'HH24:MI:SS'
    NLS_TIMESTAMP_FORMAT = 'DD/MM/YYYY HH24:MI:SS'
    ~~~

    Próximo passo é incluir as variáveis no pool do php-fpm
    @@ -60,6 +68,8 @@ env[NLS_TIMESTAMP_FORMAT] = 'DD/MM/YYYY HH24:MI:SS'
    ...
    ~~~

    As informações são redundantes, mas foi a unica forma que consegui para funcionar em ambientes (RHEL 7 e CentOS 7)

    ~~~sh
    systemctl restart php-fpm.service
    ~~~
  14. @marciopaiva marciopaiva revised this gist Sep 11, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions centos7_passo_05.md
    Original file line number Diff line number Diff line change
    @@ -58,4 +58,8 @@ env[NLS_TIME_FORMAT] = 'HH24:MI:SS'
    env[NLS_TIMESTAMP_FORMAT] = 'DD/MM/YYYY HH24:MI:SS'

    ...
    ~~~

    ~~~sh
    systemctl restart php-fpm.service
    ~~~
  15. @marciopaiva marciopaiva revised this gist Sep 11, 2014. 2 changed files with 34 additions and 2 deletions.
    30 changes: 29 additions & 1 deletion centos7_passo_03.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,33 @@
    ##### Configuração Apache
    ---

    Estou realizando testes de configuração no momento.
    Como meu apache vai servir apenas como um proxy para o php-fpm, vou utilizar o MPM Event (EM TESTE).

    ~~~sh
    nano /etc/httpd/conf.modules.d/00-mpm.conf
    ~~~

    ~~~ini
    # Select the MPM module which should be used by uncommenting exactly
    # one of the following LoadModule lines:

    # prefork MPM: Implements a non-threaded, pre-forking web server
    # See: http://httpd.apache.org/docs/2.4/mod/prefork.html
    #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

    # worker MPM: Multi-Processing Module implementing a hybrid
    # multi-threaded multi-process web server
    # See: http://httpd.apache.org/docs/2.4/mod/worker.html
    #
    #LoadModule mpm_worker_module modules/mod_mpm_worker.so

    # event MPM: A variant of the worker MPM with the goal of consuming
    # threads only for connections with active processing
    # See: http://httpd.apache.org/docs/2.4/mod/event.html
    #
    LoadModule mpm_event_module modules/mod_mpm_event.so
    ~~~

    ~~~sh
    systemctl restart httpd.service
    ~~~
    6 changes: 5 additions & 1 deletion centos7_passo_04.md
    Original file line number Diff line number Diff line change
    @@ -5,9 +5,13 @@
    nano /etc/php.ini
    ~~~

    Altere as seguinte linhas:
    Altere as seguintes linhas:

    ~~~ini
    date.timezone = "America/Sao_Paulo"
    default_charset = "UTF-8"
    ~~~

    ~~~sh
    systemctl restart php-fpm.service
    ~~~
  16. @marciopaiva marciopaiva revised this gist Sep 11, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion centos7_passo_05.md
    Original file line number Diff line number Diff line change
    @@ -38,7 +38,7 @@ Próximo passo é incluir as variáveis no pool do php-fpm
    nano /etc/php-fpm.d/www.conf
    ~~~

    Segue o trecho que deve ser incluido e a referencia do local
    Segue conteúdo e local aonde deve ser incluido.

    ~~~ini
    ...
  17. @marciopaiva marciopaiva revised this gist Sep 11, 2014. 1 changed file with 26 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions centos7_passo_05.md
    Original file line number Diff line number Diff line change
    @@ -32,4 +32,30 @@ Incluir no arquivo o NLS_LANG, conforme arquivo abaixo:
    NLS_LANG = 'BRAZILIAN PORTUGUESE_BRAZIL.AL32UTF8'
    ~~~

    Próximo passo é incluir as variáveis no pool do php-fpm

    ~~~sh
    nano /etc/php-fpm.d/www.conf
    ~~~

    Segue o trecho que deve ser incluido e a referencia do local

    ~~~ini
    ...

    ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
    ; the current environment.
    ; Default Value: clean env
    env[HOSTNAME] = 'localhost'
    env[NLS_LANG] = 'BRAZILIAN PORTUGUESE_BRAZIL.AL32UTF8'
    env[NLS_TERRITORY] = 'BRAZIL'
    env[NLS_DUAL_CURRENCY] = 'R$'
    env[NLS_CURRENCY] = 'R$'
    env[NLS_ISO_CURRENCY] = 'BRAZIL'
    env[NLS_DATE_LANGUAGE] = 'BRAZILIAN PORTUGUESE'
    env[NLS_DATE_FORMAT] = 'DD/MM/YYYY'
    env[NLS_TIME_FORMAT] = 'HH24:MI:SS'
    env[NLS_TIMESTAMP_FORMAT] = 'DD/MM/YYYY HH24:MI:SS'

    ...
    ~~~
  18. @marciopaiva marciopaiva revised this gist Sep 11, 2014. 1 changed file with 35 additions and 0 deletions.
    35 changes: 35 additions & 0 deletions centos7_passo_05.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    ##### Configuração InstantClient Oracle
    ---

    Configurações das Variáveis de Ambiente.

    ~~~sh
    nano /etc/sysconfig/php-fpm
    ~~~

    Incluir no arquivo o NLS_LANG, conforme arquivo abaixo:

    ~~~ini
    # Additional environment file for php-fpm

    # This file is deprecated when systemd is used and
    # will be removed in the future

    # To alter the FPM environment, copy the unit file
    # from /usr/lib/systemd/system/php-fpm.service
    # to /etc/systemd/system/php-fpm.service
    # and add an Environment line

    # With systemd >= 204 you can simply drop a file with the
    # suffix .conf in /etc/systemd/system/php-fpm.service.d, with
    # [Service]
    # Environment=FOO=bar

    # See systemd documentation.
    # man systemd.unit
    # man systemd.exec

    NLS_LANG = 'BRAZILIAN PORTUGUESE_BRAZIL.AL32UTF8'
    ~~~


  19. @marciopaiva marciopaiva revised this gist Sep 11, 2014. 2 changed files with 8 additions and 2 deletions.
    8 changes: 7 additions & 1 deletion centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -43,6 +43,12 @@ systemctl enable httpd.service
    systemctl status httpd.service -l
    ~~~

    Removendo o Warning da falta de ServerName do Apache.

    ~~~sh
    echo "ServerName localhost" >> /etc/httpd/conf.d/servername.conf
    ~~~

    Iniciando o serviço do PHP-FPM, setando para que seja iniciado ao boot e verificando o status.

    ~~~sh
    @@ -57,7 +63,7 @@ Criando o arquivo info.php para validar as configurações do PHP.
    printf '<?php\n phpinfo();' > /var/www/html/info.php
    ~~~

    Criando um VirtualHost para o localhost
    Criando um VirtualHost utilizando o mod_proxy_fcgi

    ~~~sh
    nano /etc/httpd/conf.d/localhost.conf
    2 changes: 1 addition & 1 deletion centos7_passo_03.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ##### Configuração Apache
    ---

    Como minha VM tem mais de 1 processador vou mudar o apache para trabalhar com o MPM Worker
    Estou realizando testes de configuração no momento.

  20. @marciopaiva marciopaiva revised this gist Sep 11, 2014. 3 changed files with 42 additions and 9 deletions.
    6 changes: 4 additions & 2 deletions centos7_ambiente_desenvolvimento.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    #### CentOS 7 - Apache 2.4 + PHP 5.5 + InstantClient Oracle.
    #### CentOS 7 - Apache 2.4 + PHP-FPM 5.5 + InstantClient Oracle.
    ---

    Montando uma VM para o desenvolvimento de aplicações em PHP, utilizado o CentOS 7
    Montando uma VM para o desenvolvimento de aplicações em PHP, utilizado o CentOS 7

    (EM DESENVOLVIMENTO)
    43 changes: 37 additions & 6 deletions centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -32,23 +32,23 @@ Para evitar surpresas, realizei mais um reboot para validar a atualização de k
    Instalação do Apache, PHP e libs.

    ~~~sh
    yum --enablerepo=remi,remi-php55 install httpd php php-common php-pecl-apcu php-gd php-intl php-mbstring php-mssql php-mysql php-mysqlnd php-oci8 php-xmlrpc php-openssl php-pgsql php-soap php-opcache php-mcrypt
    yum --enablerepo=remi,remi-php55 install httpd php-fpm php-common php-pecl-apcu php-gd php-intl php-mbstring php-mssql php-mysql php-mysqlnd php-oci8 php-xmlrpc php-openssl php-pgsql php-soap php-opcache php-mcrypt
    ~~~

    Iniciando o serviço do apache, setando para que seja iniciado ao boot e verificando o status.
    Iniciando o serviço do Apache, setando para que seja iniciado ao boot e verificando o status.

    ~~~sh
    systemctl start httpd.service
    systemctl enable httpd.service
    systemctl status httpd.service -l
    ~~~

    Para remover o warning do ServerName
    Iniciando o serviço do PHP-FPM, setando para que seja iniciado ao boot e verificando o status.

    ~~~sh
    echo "ServerName centos-devel" >> /etc/httpd/conf.d/servername.conf
    systemctl restart httpd.service
    systemctl status httpd.service -l
    systemctl start php-fpm.service
    systemctl enable php-fpm.service
    systemctl status php-fpm.service -l
    ~~~

    Criando o arquivo info.php para validar as configurações do PHP.
    @@ -57,6 +57,37 @@ Criando o arquivo info.php para validar as configurações do PHP.
    printf '<?php\n phpinfo();' > /var/www/html/info.php
    ~~~

    Criando um VirtualHost para o localhost

    ~~~sh
    nano /etc/httpd/conf.d/localhost.conf
    ~~~

    ~~~conf
    <VirtualHost *:80>
    ServerName localhost
    ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/$1
    DocumentRoot /var/www/html
    <Directory /var/www/html>
    AllowOverride All
    Require all granted
    </Directory>
    ErrorLog /var/log/httpd/localhost_error.log
    CustomLog /var/log/httpd/localhost_access.log combined
    </VirtualHost>
    ~~~


    ~~~sh
    systemctl restart httpd.service
    systemctl status httpd.service -l
    ~~~


    Para validar as configurações acesse via navegador os endereços:

    * http://192.168.183.134
    2 changes: 1 addition & 1 deletion centos7_passo_04.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,6 @@ nano /etc/php.ini
    Altere as seguinte linhas:

    ~~~ini
    date.timezone = America/Sao_Paulo
    date.timezone = "America/Sao_Paulo"
    default_charset = "UTF-8"
    ~~~
  21. @marciopaiva marciopaiva revised this gist Sep 10, 2014. 2 changed files with 16 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -7,12 +7,12 @@ Acesse o terminal da VM, pelo WinSCP use "Ctrl+P" que será aberto o terminal. V

    Por se tratar de uma VM de desenvolvimento local, vou desabilitar o Firewall e Selinux, que vem instalado e configurado por default. Caso for utilizar esse exemplo para outros ambientes recomendo que deixe os 2(dois) em funcionamento.

    ```sh
    ~~~sh
    systemctl stop firewalld
    systemctl disable firewalld
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    reboot
    ```
    ~~~

    Instalação dos RPMs e Repositórios necessários

    @@ -32,7 +32,7 @@ Para evitar surpresas, realizei mais um reboot para validar a atualização de k
    Instalação do Apache, PHP e libs.

    ~~~sh
    yum --enablerepo=remi,remi-php55 install httpd php php-common php-pecl-apcu php-gd php-intl php-mbstring php-mssql php-mysql php-mysqlnd php-oci8 php-xmlrpc php-openssl php-pgsql php-soap php-opcache
    yum --enablerepo=remi,remi-php55 install httpd php php-common php-pecl-apcu php-gd php-intl php-mbstring php-mssql php-mysql php-mysqlnd php-oci8 php-xmlrpc php-openssl php-pgsql php-soap php-opcache php-mcrypt
    ~~~

    Iniciando o serviço do apache, setando para que seja iniciado ao boot e verificando o status.
    13 changes: 13 additions & 0 deletions centos7_passo_04.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    ##### Configuração PHP
    ---

    ~~~sh
    nano /etc/php.ini
    ~~~

    Altere as seguinte linhas:

    ~~~ini
    date.timezone = America/Sao_Paulo
    default_charset = "UTF-8"
    ~~~
  22. @marciopaiva marciopaiva revised this gist Sep 10, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Acesse o terminal da VM, pelo WinSCP use "Ctrl+P" que será aberto o terminal. V

    Por se tratar de uma VM de desenvolvimento local, vou desabilitar o Firewall e Selinux, que vem instalado e configurado por default. Caso for utilizar esse exemplo para outros ambientes recomendo que deixe os 2(dois) em funcionamento.

    ```console
    ```sh
    systemctl stop firewalld
    systemctl disable firewalld
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  23. @marciopaiva marciopaiva revised this gist Sep 10, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -7,12 +7,12 @@ Acesse o terminal da VM, pelo WinSCP use "Ctrl+P" que será aberto o terminal. V

    Por se tratar de uma VM de desenvolvimento local, vou desabilitar o Firewall e Selinux, que vem instalado e configurado por default. Caso for utilizar esse exemplo para outros ambientes recomendo que deixe os 2(dois) em funcionamento.

    ~~~console
    ```console
    systemctl stop firewalld
    systemctl disable firewalld
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    reboot
    ~~~
    ```

    Instalação dos RPMs e Repositórios necessários

  24. @marciopaiva marciopaiva revised this gist Sep 10, 2014. 3 changed files with 14 additions and 9 deletions.
    6 changes: 3 additions & 3 deletions centos7_passo_01.md
    Original file line number Diff line number Diff line change
    @@ -12,10 +12,10 @@ Realize o download do arquivo oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64

    Realize a instalação do WinSCP, VMware Player e crie uma VM com a ISO do CentOS 7.

    Minha VM foi criada com as seguintes configurações:
    Como pretendo simular um ambiente de produção. Minha VM foi criada com as seguintes configurações:

    * Memory 512 MB
    * Processors 1
    * Memory 2 GB
    * Processors 4
    * HD 20GB
    * Network NAT

    12 changes: 6 additions & 6 deletions centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Acesse o terminal da VM, pelo WinSCP use "Ctrl+P" que será aberto o terminal. V

    Por se tratar de uma VM de desenvolvimento local, vou desabilitar o Firewall e Selinux, que vem instalado e configurado por default. Caso for utilizar esse exemplo para outros ambientes recomendo que deixe os 2(dois) em funcionamento.

    ~~~sh
    ~~~console
    systemctl stop firewalld
    systemctl disable firewalld
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    @@ -16,7 +16,7 @@ reboot

    Instalação dos RPMs e Repositórios necessários

    ~~~shell
    ~~~sh
    yum install net-tools nano wget libaio
    rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
    @@ -31,29 +31,29 @@ Para evitar surpresas, realizei mais um reboot para validar a atualização de k

    Instalação do Apache, PHP e libs.

    ~~~shell
    ~~~sh
    yum --enablerepo=remi,remi-php55 install httpd php php-common php-pecl-apcu php-gd php-intl php-mbstring php-mssql php-mysql php-mysqlnd php-oci8 php-xmlrpc php-openssl php-pgsql php-soap php-opcache
    ~~~

    Iniciando o serviço do apache, setando para que seja iniciado ao boot e verificando o status.

    ~~~shell
    ~~~sh
    systemctl start httpd.service
    systemctl enable httpd.service
    systemctl status httpd.service -l
    ~~~

    Para remover o warning do ServerName

    ~~~shell
    ~~~sh
    echo "ServerName centos-devel" >> /etc/httpd/conf.d/servername.conf
    systemctl restart httpd.service
    systemctl status httpd.service -l
    ~~~

    Criando o arquivo info.php para validar as configurações do PHP.

    ~~~shell
    ~~~sh
    printf '<?php\n phpinfo();' > /var/www/html/info.php
    ~~~

    5 changes: 5 additions & 0 deletions centos7_passo_03.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    ##### Configuração Apache
    ---

    Como minha VM tem mais de 1 processador vou mudar o apache para trabalhar com o MPM Worker

  25. @marciopaiva marciopaiva revised this gist Sep 10, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Acesse o terminal da VM, pelo WinSCP use "Ctrl+P" que será aberto o terminal. V

    Por se tratar de uma VM de desenvolvimento local, vou desabilitar o Firewall e Selinux, que vem instalado e configurado por default. Caso for utilizar esse exemplo para outros ambientes recomendo que deixe os 2(dois) em funcionamento.

    ~~~Shell
    ~~~sh
    systemctl stop firewalld
    systemctl disable firewalld
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  26. @marciopaiva marciopaiva revised this gist Sep 10, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Acesse o terminal da VM, pelo WinSCP use "Ctrl+P" que será aberto o terminal. V

    Por se tratar de uma VM de desenvolvimento local, vou desabilitar o Firewall e Selinux, que vem instalado e configurado por default. Caso for utilizar esse exemplo para outros ambientes recomendo que deixe os 2(dois) em funcionamento.

    ~~~shell
    ~~~Shell
    systemctl stop firewalld
    systemctl disable firewalld
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  27. @marciopaiva marciopaiva revised this gist Sep 10, 2014. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Acesse o terminal da VM, pelo WinSCP use "Ctrl+P" que será aberto o terminal. V

    Por se tratar de uma VM de desenvolvimento local, vou desabilitar o Firewall e Selinux, que vem instalado e configurado por default. Caso for utilizar esse exemplo para outros ambientes recomendo que deixe os 2(dois) em funcionamento.

    ~~~bash
    ~~~shell
    systemctl stop firewalld
    systemctl disable firewalld
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    @@ -16,7 +16,7 @@ reboot

    Instalação dos RPMs e Repositórios necessários

    ~~~bash
    ~~~shell
    yum install net-tools nano wget libaio
    rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
    @@ -31,29 +31,29 @@ Para evitar surpresas, realizei mais um reboot para validar a atualização de k

    Instalação do Apache, PHP e libs.

    ~~~bash
    ~~~shell
    yum --enablerepo=remi,remi-php55 install httpd php php-common php-pecl-apcu php-gd php-intl php-mbstring php-mssql php-mysql php-mysqlnd php-oci8 php-xmlrpc php-openssl php-pgsql php-soap php-opcache
    ~~~

    Iniciando o serviço do apache, setando para que seja iniciado ao boot e verificando o status.

    ~~~bash
    ~~~shell
    systemctl start httpd.service
    systemctl enable httpd.service
    systemctl status httpd.service -l
    ~~~

    Para remover o warning do ServerName

    ~~~bash
    ~~~shell
    echo "ServerName centos-devel" >> /etc/httpd/conf.d/servername.conf
    systemctl restart httpd.service
    systemctl status httpd.service -l
    ~~~

    Criando o arquivo info.php para validar as configurações do PHP.

    ~~~bash
    ~~~shell
    printf '<?php\n phpinfo();' > /var/www/html/info.php
    ~~~

  28. @marciopaiva marciopaiva revised this gist Sep 10, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions centos7_passo_01.md
    Original file line number Diff line number Diff line change
    @@ -14,8 +14,8 @@ Realize a instalação do WinSCP, VMware Player e crie uma VM com a ISO do CentO

    Minha VM foi criada com as seguintes configurações:

    * Memory 2 GB
    * Processors 2
    * Memory 512 MB
    * Processors 1
    * HD 20GB
    * Network NAT

  29. @marciopaiva marciopaiva revised this gist Sep 9, 2014. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ yum update
    reboot
    ~~~

    Para evitar surpresas realizei mais um reboot pois teve atualização de kernel.
    Para evitar surpresas, realizei mais um reboot para validar a atualização de kernel.

    Instalação do Apache, PHP e libs.

    @@ -61,5 +61,3 @@ Para validar as configurações acesse via navegador os endereços:

    * http://192.168.183.134
    * http://192.168.183.134/info.php


  30. @marciopaiva marciopaiva revised this gist Sep 9, 2014. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions centos7_passo_02.md
    Original file line number Diff line number Diff line change
    @@ -51,3 +51,15 @@ systemctl restart httpd.service
    systemctl status httpd.service -l
    ~~~

    Criando o arquivo info.php para validar as configurações do PHP.

    ~~~bash
    printf '<?php\n phpinfo();' > /var/www/html/info.php
    ~~~

    Para validar as configurações acesse via navegador os endereços:

    * http://192.168.183.134
    * http://192.168.183.134/info.php