标签:lnmp
#防火墙允许端口 iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #SELinux配置 SELINUX=disabled #Nginx安装 yum -y remove httpd* php* yum -y install nginx service nginx start chkconfig nginx on #MySQL安装 yum -y install mysql mysql-server service mysqld start chkconfig mysql on cp /usr/share/mysql/my-medium.cnf /etc/my.cnf mysql_secure_installation service mysqld restart #php安装 yum -y install php php-fpm php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath libmcryp chkconfig php-fpm on service php-fpm start #Nginx配置 cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak cp /etc/nginx/nginx.conf.default /etc/nginx/nginx.conf index index.html index.htm index.php fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #取消FastCGI server 部分location 的注释,并要注意fastcgi_param行的参数,改为$document_root$fastcgi_script_name 或者使用绝对路径 #PHP配置 vim /etc/php.ini date.timezone = PRC #946行,设置时区 expose_php = Off #432行,禁止php版本 short_open_tag = On #229行,支持php短标签 #php-fpm配置 cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.bak user = nginx group = nginx chown nginx.nginx /usr/share/nginx/html/ -R #创建测试页 vim /usr/share/nginx/html/index.php <?php phpinfo(); ?> rm -rf /usr/share/nginx/html/index.html #删除原有的html页面 #浏览器访问测试
本文出自 “吴善强” 博客,请务必保留此出处http://shanqiangwu.blog.51cto.com/8067564/1635754
标签:lnmp
原文地址:http://shanqiangwu.blog.51cto.com/8067564/1635754