服务器之家:专注于服务器技术及软件下载分享
分类导航

Linux|Centos|Ubuntu|系统进程|Fedora|注册表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服务器之家 - 服务器系统 - Centos - Centos5.2配置LAMP与Centos5.3配置LAMP(21)

Centos5.2配置LAMP与Centos5.3配置LAMP(21)

2019-10-11 14:12Centos教程网 Centos

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/lo


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 

延伸 · 阅读

精彩推荐