mkdir -p /data/www/wwwroot/linux.com
mkdir -p /data/www/wwwroot/test.com
mkdir -p /data/logs
chmod +w /data/www/wwwroot
chown -R www:www /data/www/wwwroot
cp /usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/httpd.conf.save
编辑httpd.conf
sed -i -e ‘121 s/^/#/’ -i -e ‘122 s/^/#/’ /usr/local/apache2/conf/httpd.conf
sed -i -e “s/User daemon/User www/” -i -e “s/Group daemon/Group www/” /usr/local/apache2/conf/httpd.conf
sed -i ’s/DirectoryIndex index.html/ DirectoryIndex index.php index.html index.htm/g’ /usr/local/apache2/conf/httpd.conf
sed -i -e ‘101 s/^#//g’ -i -e ‘374 s/^#//g’ -i -e ‘389 s/^#//g’ -i -e ‘392 s/^#//g’ -i -e ‘401 s/^#//g’ /usr/local/apache2/conf/httpd.conf
sed -i “58 s/^/AddType application\/x-httpd-php .php/” /usr/local/apache2/conf/httpd.conf
编辑php.ini
cp /usr/local/php/etc/php.ini /usr/local/php/etc/php.ini.save
sed -i ‘205 s#;open_basedir =#open_basedir = /data/www/wwwroot:/tmp#g’ /usr/local/php/etc/php.ini
sed -i ‘/expose_php/s/On/Off/’ /usr/local/php/etc/php.ini
sed -i ‘/display_errors/s/On/Off/’ /usr/local/php/etc/php.ini
相关文章
热门资讯