PHP-FPM 서버에서 VirtualHost 설정하는 예제이다.
vi /etc/httpd/conf/httpd.conf # 여기서 할 것은 없다.
vi /etc/httpd/conf.d/default.conf <VirtualHost *:80> DocumentRoot "/home/httpd/test/www/htdocs" ServerName abc.com ServerAlias test.abc.com
<Directory "/home/httpd/test/www/htdocs"> AllowOverride None Require all granted </Directory>
ErrorLog /var/log/httpd/test-error.log CustomLog /var/log/httpd/test-access.log combined
SuexecUserGroup apache apache
<Proxy "unix:/var/run/php-fpm/default.sock|fcgi://php-fpm"> ProxySet disablereuse=off </Proxy>
<FilesMatch \.php$> SetHandler proxy:fcgi://php-fpm </FilesMatch> </VirtualHost>
<VirtualHost *:80> DocumentRoot "/home/httpd/food/www/htdocs" ServerName abc.com ServerAlias food.abc.com
<Directory "/home/httpd/food/www/htdocs"> AllowOverride None Require all granted </Directory>
ErrorLog /var/log/httpd/food-error.log CustomLog /var/log/httpd/food-access.log combined
SuexecUserGroup apache apache
<Proxy "unix:/var/run/php-fpm/default.sock|fcgi://php-fpm"> ProxySet disablereuse=off </Proxy>
<FilesMatch \.php$> SetHandler proxy:fcgi://php-fpm </FilesMatch> </VirtualHost> |