hoangweb
4/16/2016 - 1:06 PM

apache - virtualhost

apache - virtualhost

<VirtualHost *:80>
    
    ServerName www.example.com
    ServerAdmin webmaster@localhost
    
    # look up php.ini in this folder
    PHPINIDir /var/www/custom-php/site1/
    
	DocumentRoot /var/www/site1
	
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    
	<Directory /var/www/site1>
		Options Indexes FollowSymLinks MultiViews
        AllowOverride All
    	Require all granted
        
        # old version
#        Order allow,deny
#        allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>
    
    <IfModule mod_fastcgi.c>
        AddHandler php5-fcgi .php
        Action php5-fcgi /php5-fcgi
        Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
        FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
    </IfModule>


	ErrorLog ${APACHE_LOG_DIR}/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>