#部署LAMP环境 # System Environment: Os:centos release 6.6hostname:server.example.comip:192.168.1.100
#配置防火墙, allow 80,3306 port iptables-a input-m State--state new-m tcp-p TCP--dport 80-j acceptiptables-a input-m State--st Ate new-m tcp-p tcp--dport 3306-j acceptservice iptables save# configuration Selinuxvim/etc/sysconfig/selinux Selinux=permissivese Tenforce 0
#安装Apacheyum-y install httpdservice httpd startchkconfig httpd on
#安装MySQLyum-y install mysql mysql-serverservice mysqld startchkconfig mysqld oncp/usr/share/mysql/my-medium.cnf/etc/ My.cnfmysql_secure_installation #回车, according to prompt input y, enter 2 password, set the MySQL password, enter according to the prompt input y last appear: Thanks for using Mysql!servic E mysqld Restart
#安装PHPyum-y install php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpcservice mysqld Restartserv Ice httpd restart
#配置Apache服务vim /etc/httpd/conf/httpd.confservertokens os#44 Line modified to:servertokens Prod (Error page does not show operating system name) serversignature on#536 line modified to:serversignature off (the version of Apache is not shown in the error page) Options indexes followsymlinks#331 Line modified to:options includes execcgi FollowSymLinks (Allow server to execute CGI and SSI, disallow listing of directories) #AddHandler cgi-script .cgi#796 Line modified to: Addhandler cgi-script .cgi .pl (uncomment allow CGI scripts with extension. pl to run) allowoverride none#338 line modified to:allowoverride all (Allow. htaccess) adddefaultcharset utf-8#759 line Modify to: adddefaultcharset gb2312 (add GB2312 as default encoding) Options indexes multiviews followsymlinks#554 Line modified to Options MultiViews FollowSymLinks (does not display the tree structure on the browser) directoryindex index.html index.html.var#402 row modified to:directoryindex index.html index.htm default.html default.htm index.php default.php Index.html.var (set default home file, add index.php) keepalive off#76 line modified to:keepalive on (Allow program online) Maxkeepaliverequests 100#83 line Change to:maxkeepaliverequests 1000 (increase number of simultaneous connections) service httpd Restart
#配置PHP服务vim /etc/php.inidate.timezone = prc#946 Line to remove the previous semicolon and modify it to date.timezone = prcdisable _functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status, Ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server, Escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space, Posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_ Getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_ Getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_ setuid,posix_strerror,posix_times,posix_ttyname,posix_uname#386 column out PHP can disable the function, if some programs need to use this function, you can delete, cancel disable Expose_ php = off#438 line suppresses the PHP version of the letterInterest magic_quotes_gpc = on #751行打开magic_quotes_gpc来防止SQL注入short_open_tag = on# 229 Lines Support PHP short tag open_basedir = .:/ tmp/ #380行设置表示允许访问当前目录 (the directory where the php script files are located) and the/tmp/directory prevent the PHP Trojan from crossing
#重启服务service mysqld restartservice httpd restart
#写测试页面vim/var/www/html/index.php<?phpphpinfo ();? >
#在浏览器地址栏输入LAMP服务器的ip地址或对应ip的域名即可看到测试页面;
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6B/74/wKiom1Ut-PTg2n1iAAVcid5psao839.jpg "title=" Qq20150415133206.png "alt=" Wkiom1ut-ptg2n1iaavcid5psao839.jpg "/>
This article is from the "Wu Shanqiang" blog, make sure to keep this source http://shanqiangwu.blog.51cto.com/8067564/1632904
CentOS6.6 Deploying Lamp System Architecture