# yum groupinstall "Network file system client" # yum install nfs-utils nfs4-acl-tools # chkconfig rpcbind on # chkconfig rpcidmapd on # chkconfig nfslock on # vi /etc/idmapd.conf Domain = cyberciti.biz [Mapping] Nobody-User = nobody Nobody-Group = nobody # /sbin/service rpcbind start # /sbin/service rpcidmapd start # /sbin/service nfslock start # showmout -e vm05 # showmout -e 192.168.1.14 Export list for v.txvip1: /exports/html 192.168.1.10,192.168.1.11 /exports/static 192.168.1.10,192.168.1.11 # /bin/mount -t nfs4 -orsize=32768,wsize=32768,intr,hard,proto=tcp,sync vm05:/exports/html /var/www/html/ # /bin/mount -t nfs4 -orsize=32768,wsize=32768,intr,hard,proto=tcp,sync 192.168.1.14:/exports/html /var/www/html/ # vi /etc/fstab vm05:/exports/html /var/www/html nfs4 orsize=32768,wsize=32768,intr,hard,proto=tcp,sync # chkconfig netfs on # su - apache $ ls /var/www/html/ $ exit # # yum install httpd # yum install -y php-pear php-common php-bcmath php-mbstring php-cli php-pdo php-php-gettext php-mcrypt php-gd php-xml php-pecl-apc php php-mysql php-xmlrpc # yum install -y php-pecl-memcache # vi /etc/httpd/conf/httpd.conf # - Listen 192.168.1.11:80 # ServerTokens Prod ServerSignature Off # DocumentRoot DocumentRoot "/var/www/html" <Directory "/var/www/html"> Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> # cat /etc/httpd/conf.d/php.conf # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages.<br /> <IfModule prefork.c> LoadModule php5_module modules/libphp5.so </IfModule> <IfModule worker.c> LoadModule php5_module modules/libphp5-zts.so </IfModule> # PHP- .php AddHandler php5-script .php AddType text/html .php # Add index.php to the list of files that will be served as directory # indexes. DirectoryIndex index.php # Uncomment the following line to allow PHP to pretty-print .phps # files as PHP source code: # #AddType application/x-httpd-php-source .phps # yum -y install mod_extract_forwarded package # vi /etc/httpd/conf.d/mod_extract_forwarded.conf ## Accept real ip from our nginx reverse proxy at 192.168.1.1 ## MEFaccept 192.168.1.1 # service httpd reload ## ## -A INPUT -m state --state NEW -p tcp -s 192.168.1.0/24 --dport 80 -j ACCEPT # /sbin/service iptables restart # /sbin/iptables -L -v -n # chkconfig httpd on # service httpd start http://192.168.1.11/ /* php- */ /* WordPress */ define('DB_NAME', 'foo'); /* MySQL database username */ define('DB_USER', 'bar'); /* MySQL database password */ define('DB_PASSWORD', 'mypassword'); /* MySQL hostname */ define('DB_HOST', '192.168.1.13'); /* php- */ if ( isset($memcached_servers) ) $buckets = $memcached_servers; else $buckets = array('default' => array('192.168.1.12:11211')); $config['Datastore']['class'] = 'myApp_MemCached; $i = 0; $i++; $config['Misc']['memcacheserver'][$i] = '192.168.1.12'; $config['Misc']['memcacheport'][$i] = 11211; $config['Misc']['memcachepersistent'][$i] = true; $config['Misc']['memcacheweight'][$i] = 1; $config['Misc']['memcachetimeout'][$i] = 1; $config['Misc']['memcacheretry_interval'][$i] = 15; Source: https://habr.com/ru/post/148489/
All Articles