How To : O2O Adding New Domain in Cluster

  Customer Setup

Login to the web server and add user to create the user directory :

adduser apio2ocon

2. Create public_html directory :

mkdir -p /home/apio2ocon/public_html

3. Login to LB Server, add the new config in NGINX :

/etc/nginx/vhosts/api.o2oconnect.com/nginx.conf

Copy the config from another domain config, just change the domain name and server IP‌

4. Include the new domain config to the main NGINX config :

/etc/nginx/conf.d/nginx-vhosts.conf

Example include command in the config :

include /etc/nginx/vhosts/api.o2oconnect.com/nginx.conf

5. Check for any errors and if its OK, restart the NGINX services

nginx -t
nginx -s reload

6. Login again to web server to add APACHE new config for the domain :

/etc/httpd/conf/vhosts/apio2ocon.conf

You may copy the config from another domain config, just change the domain name, php-fpm directory, the domain root directory and also the logs file name‌

7. Edit the APACHE main config, to add the new config in APACHE :

vim /etc/httpd/conf/httpd.conf

8. Example when I’m including the new domain in main config

Include conf/vhosts/api.o2oconnect.com.conf

9. Create PHP-FPM config under directory :

/usr/local/php72/etc/php-fpm.d/apio2ocon.conf

Example of the PHP-FPM content :

[apio2ocon]
user = $pool
group = $pool
listen = /usr/local/php72/sockets/$pool.sock
listen.owner = $pool
listen.group = apache
listen.mode = 660

; pm = dynamic
; pm.max_children = 1000
; pm.start_servers = 32 ; CPU * 4
; pm.min_spare_servers = 16 ; CPU * 2
; pm.max_spare_servers = 32 ; CPU * 4
; pm.max_requests = 1000

pm = ondemand
pm.max_children = 1000
pm.process_idle_timeout = 5s;
pm.max_requests = 1000

security.limit_extensions = .php .php5 .php72 .inc .phtml

10. Finally check for any errors, and if its OK, restart both APACHE and PHP-FPM services

httpd -t
killall -HUP httpd
systemctl restart php-fpm72

PHP-FPM value depends on which version you are using for the domain, kindly change it accordingly