{"id":111579,"date":"2023-09-11T23:30:40","date_gmt":"2023-09-11T15:30:40","guid":{"rendered":"http:\/\/www.idc.net\/help\/?p=111579"},"modified":"2023-09-11T23:32:59","modified_gmt":"2023-09-11T15:32:59","slug":"linux%e4%b8%8b%e6%8c%87%e5%ae%9a%e7%89%88%e6%9c%ac%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85lamp","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/111579\/","title":{"rendered":"Linux\u4e0b\u6307\u5b9a\u7248\u672c\u7f16\u8bd1\u5b89\u88c5LAMP"},"content":{"rendered":"<p><strong>Centos6 \u6307\u5b9a\u7248\u672c\u7f16\u8bd1\u5b89\u88c5LAMP<\/strong><\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-111604\" title=\"Linux\u4e0b\u6307\u5b9a\u7248\u672c\u7f16\u8bd1\u5b89\u88c5LAMP-1\" src=\"http:\/\/blog.idc.net\/wp-content\/uploads\/2023\/09\/1318_f805dcccd9a4e7c128757daecab6dc35.jpg\" alt=\"Linux\u4e0b\u6307\u5b9a\u7248\u672c\u7f16\u8bd1\u5b89\u88c5LAMP-1\" width=\"298\" height=\"169\" \/><\/strong><\/p>\n<p>\u8bf4\u660e\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p>\u64cd\u4f5c\u7cfb\u7edf\uff1aCentOS 6.5 64\u4f4d<\/p>\n<p>&nbsp;<\/p>\n<p>\u9700\u6c42\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p>\u7f16\u8bd1\u5b89\u88c5LAMP\u8fd0\u884c\u73af\u5883<\/p>\n<p>&nbsp;<\/p>\n<p>\u5404\u8f6f\u4ef6\u7248\u672c\u5982\u4e0b\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p>MySQL\uff1amysql-5.1.73<\/p>\n<p>&nbsp;<\/p>\n<p>Apache\uff1ahttpd-2.2.31<\/p>\n<p>&nbsp;<\/p>\n<p>PHP\uff1aphp-5.2.17<\/p>\n<p>&nbsp;<\/p>\n<p>\u5177\u4f53\u64cd\u4f5c\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p>\u51c6\u5907\u7bc7<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e00\u3001\u914d\u7f6e\u9632\u706b\u5899\uff0c\u5f00\u542f80\u7aef\u53e3\u30013306\u7aef\u53e3<\/p>\n<p>&nbsp;<\/p>\n<p>vi \/etc\/sysconfig\/iptables #\u7f16\u8f91\u9632\u706b\u5899\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>&nbsp;<\/p>\n<p># Firewall configuration written by system-config-firewall<\/p>\n<p>&nbsp;<\/p>\n<p># Manual customization of this file is not recommended.<\/p>\n<p>&nbsp;<\/p>\n<p>*filter<\/p>\n<p>&nbsp;<\/p>\n<p>:INPUT ACCEPT [0:0]<\/p>\n<p>&nbsp;<\/p>\n<p>:FORWARD ACCEPT [0:0]<\/p>\n<p>&nbsp;<\/p>\n<p>:OUTPUT ACCEPT [0:0]<\/p>\n<p>&nbsp;<\/p>\n<p>-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<\/p>\n<p>&nbsp;<\/p>\n<p>-A INPUT -p icmp -j ACCEPT<\/p>\n<p>&nbsp;<\/p>\n<p>-A INPUT -i lo -j ACCEPT<\/p>\n<p>&nbsp;<\/p>\n<p>-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT<\/p>\n<p>&nbsp;<\/p>\n<p>-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT<\/p>\n<p>&nbsp;<\/p>\n<p>-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT<\/p>\n<p>&nbsp;<\/p>\n<p>-A INPUT -j REJECT --reject-with icmp-host-prohibited<\/p>\n<p>&nbsp;<\/p>\n<p>-A FORWARD -j REJECT --reject-with icmp-host-prohibited<\/p>\n<p>&nbsp;<\/p>\n<p>COMMIT<\/p>\n<p>&nbsp;<\/p>\n<p>:wq! #\u4fdd\u5b58\u9000\u51fa<\/p>\n<p>&nbsp;<\/p>\n<p>service iptables restart #\u6700\u540e\u91cd\u542f\u9632\u706b\u5899\u4f7f\u914d\u7f6e\u751f\u6548<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e8c\u3001\u5173\u95edSELINUX<\/p>\n<p>&nbsp;<\/p>\n<p>vi \/etc\/selinux\/config<\/p>\n<p>&nbsp;<\/p>\n<p>#SELINUX=enforcing #\u6ce8\u91ca\u6389<\/p>\n<p>&nbsp;<\/p>\n<p>#SELINUXTYPE=targeted #\u6ce8\u91ca\u6389<\/p>\n<p>&nbsp;<\/p>\n<p>SELINUX=disabled #\u589e\u52a0<\/p>\n<p>&nbsp;<\/p>\n<p>:wq! #\u4fdd\u5b58\u9000\u51fa<\/p>\n<p>&nbsp;<\/p>\n<p>setenforce 0 #\u4f7f\u914d\u7f6e\u7acb\u5373\u751f\u6548<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e09 \u3001\u7cfb\u7edf\u7ea6\u5b9a<\/p>\n<p>&nbsp;<\/p>\n<p>\u8f6f\u4ef6\u6e90\u4ee3\u7801\u5305\u5b58\u653e\u4f4d\u7f6e\uff1a\/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>\u6e90\u7801\u5305\u7f16\u8bd1\u5b89\u88c5\u4f4d\u7f6e\uff1a\/usr\/local\/\u8f6f\u4ef6\u540d\u5b57<\/p>\n<p>&nbsp;<\/p>\n<p>\u56db\u3001\u4e0b\u8f7d\u8f6f\u4ef6\u5305<\/p>\n<p>&nbsp;<\/p>\n<p>1\u3001\u4e0b\u8f7dApache<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/www.apache.org\/dist\/httpd\/httpd-2.2.31.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>2\u3001\u4e0b\u8f7dMySQL<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/mirrors.sohu.com\/mysql\/MySQL-5.1\/mysql-5.1.73.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>3\u3001\u4e0b\u8f7dphp<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/museum.php.net\/php5\/php-5.2.17.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>4\u3001\u4e0b\u8f7dlibmcrypt\uff08php\u6269\u5c55\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/nchc.dl.sourceforge.net\/project\/mcrypt\/Libmcrypt\/2.5.8\/libmcrypt-2.5.8.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>5\u3001\u4e0b\u8f7dyasm\uff08php\u6269\u5c55\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/www.tortall.net\/projects\/yasm\/releases\/yasm-1.3.0.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>6\u3001t1lib\uff08php\u6269\u5c55\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>ftp:\/\/sunsite.unc.edu\/pub\/Linux\/libs\/graphics\/t1lib-5.1.2.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>7\u3001\u4e0b\u8f7dgd\u5e93\u5b89\u88c5\u5305<\/p>\n<p>&nbsp;<\/p>\n<p>https:\/\/bitbucket.org\/libgd\/gd-libgd\/downloads\/libgd-2.1.0.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>8\u3001libvpx\uff08gd\u5e93\u9700\u8981\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>https:\/\/webm.googlecode.com\/files\/libvpx-v1.3.0.tar.bz2<\/p>\n<p>&nbsp;<\/p>\n<p>9\u3001tiff\uff08gd\u5e93\u9700\u8981\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/download.osgeo.org\/libtiff\/tiff-4.0.3.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>10\u3001libpng\uff08gd\u5e93\u9700\u8981\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>ftp:\/\/ftp.simplesystems.org\/pub\/png\/src\/libpng16\/libpng-1.6.18.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>11\u3001freetype\uff08gd\u5e93\u9700\u8981\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/ring.u-toyama.ac.jp\/archives\/graphics\/freetype\/freetype2\/freetype-2.5.4.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>12\u3001jpegsrc\uff08gd\u5e93\u9700\u8981\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/www.ijg.org\/files\/jpegsrc.v9a.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>13\u3001curl\uff08php\u6269\u5c55\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/curl.haxx.se\/download\/curl-7.44.0.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u8f6f\u4ef6\u5305\u4e0a\u4f20\u5230\/usr\/local\/src\u76ee\u5f55<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e94\u3001\u5b89\u88c5\u7f16\u8bd1\u5de5\u5177\u53ca\u5e93\u6587\u4ef6\uff08\u4f7f\u7528yum\u547d\u4ee4\u5b89\u88c5\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>yum install -y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng* libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libX* libtiff libtiff* make mpfr ncurses* ntp openssl nasm nasm* openssl-devel patch pcre-devel perl php-common php-gd policycoreutils ppl telnet t1lib t1lib* wget zlib-devel<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b89\u88c5\u7bc7<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e00\u3001\u5b89\u88c5MySQL<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf mysql-5.1.73.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd mysql-5.1.73<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/mysql --localstatedir=\/usr\/local\/mysql\/data\/ --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-unix-socket-path=\/tmp\/mysql.sock --without-debug --with-extra-charsets=all --without-embedded-server --enable-profiling --enable-assembler --enable-thread-safe-client --enable-shared --with-server-suffix=-community --with-plugins=innobase --with-extra-charsets=all<\/p>\n<p>&nbsp;<\/p>\n<p>make<\/p>\n<p>&nbsp;<\/p>\n<p>make install<\/p>\n<p>&nbsp;<\/p>\n<p>\u6ce8\u610f\uff1a\u5728\u6267\u884cmake install\u7f16\u8bd1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u4f60\u770b\u5230\u5c4f\u5e55\u4e0a\u51fa\u73b0\u4e0b\u9762\u8fd9\u4e00\u884c\uff0c\u5361\u5728\u90a3\u91cc\uff0c\u5f88\u4e45\u90fd\u8fc7\u4e0d\u53bb\uff0c\u5343\u4e07\u522b\u4ee5\u4e3a\u662f\u7f16\u8bd1\u9519\u8bef\u4e86\uff0c\u6216\u8005\u670d\u52a1\u5668\u5361\u4f4f\u4e86\uff0c\u53ea\u9700\u8981\u575a\u6301\uff0c\u8010\u5fc3\u7684\u7b49\u5f85\u51e0\u5206\u949f\uff0c\u5c31\u4f1a\u7f16\u8bd1\u6210\u529f\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>make[4]: Entering directory `\/usr\/local\/src\/mysql-5.1.73\/mysql-test'<\/p>\n<p>&nbsp;<\/p>\n<p>groupadd mysql #\u6dfb\u52a0mysql\u7ec4<\/p>\n<p>&nbsp;<\/p>\n<p>useradd -g mysql mysql -s \/bin\/false #\u521b\u5efa\u7528\u6237mysql\u5e76\u52a0\u5165\u5230mysql\u7ec4\uff0c\u4e0d\u5141\u8bb8mysql\u7528\u6237\u76f4\u63a5\u767b\u5f55\u7cfb\u7edf<\/p>\n<p>&nbsp;<\/p>\n<p>chown -R root \/usr\/local\/mysql\/ #\u5141\u8bb8root\u8bbf\u95ee<\/p>\n<p>&nbsp;<\/p>\n<p>chgrp -R mysql \/usr\/local\/mysql\/ #\u5141\u8bb8mysql\u7ec4\u8bbf\u95ee<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/mysql\/ #\u8fdb\u5165mysql\u5b89\u88c5\u76ee\u5f55<\/p>\n<p>&nbsp;<\/p>\n<p>cp share\/mysql\/my-huge.cnf \/etc\/my.cnf #\u62f7\u8d1d\u914d\u7f6e\u6587\u4ef6\uff08\u6ce8\u610f\uff1a\/etc\u76ee\u5f55\u4e0b\u9762\u9ed8\u8ba4\u6709my.cnf\uff0c\u76f4\u63a5\u8986\u76d6\u5373\u53ef\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>cp share\/mysql\/mysql.server \/etc\/init.d\/mysqld #\u628aMysql\u52a0\u5165\u7cfb\u7edf\u542f\u52a8<\/p>\n<p>&nbsp;<\/p>\n<p>chmod 755 \/etc\/init.d\/mysqld #\u6267\u884c\u6743\u9650<\/p>\n<p>&nbsp;<\/p>\n<p>vi \/etc\/profile #\u628amysql\u670d\u52a1\u52a0\u5165\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p>\u5728\u6700\u540e\u6dfb\u52a0\u4e0b\u9762\u8fd9\u4e00\u884c<\/p>\n<p>&nbsp;<\/p>\n<p>export PATH=$PATH:\/usr\/local\/mysql\/bin<\/p>\n<p>&nbsp;<\/p>\n<p>source \/etc\/profile #\u4f7f\u914d\u7f6e\u7acb\u523b\u751f\u6548<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e0b\u9762\u8fd9\u4e24\u884c\u628amyslq\u7684\u5e93\u6587\u4ef6\u94fe\u63a5\u5230\u7cfb\u7edf\u9ed8\u8ba4\u7684\u4f4d\u7f6e\uff0c\u5728\u7f16\u8bd1\u7c7b\u4f3cPHP\u7b49\u8f6f\u4ef6\u65f6\u53ef\u4ee5\u4e0d\u7528\u6307\u5b9amysql\u7684\u5e93\u6587\u4ef6\u5730\u5740\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>ln -s \/usr\/local\/mysql\/lib\/mysql \/usr\/lib\/mysql<\/p>\n<p>&nbsp;<\/p>\n<p>ln -s \/usr\/local\/mysql\/include\/mysql \/usr\/include\/mysql<\/p>\n<p>&nbsp;<\/p>\n<p>\/usr\/local\/mysql\/bin\/mysql_install_db --user=mysql --datadir=\/usr\/local\/mysql\/data #\u751f\u6210mysql\u7cfb\u7edf\u6570\u636e\u5e93<\/p>\n<p>&nbsp;<\/p>\n<p>\/usr\/local\/mysql\/bin\/mysqld_safe --user=mysql &amp; --datadir=\/usr\/local\/mysql\/data #\u542f\u52a8mysql<\/p>\n<p>&nbsp;<\/p>\n<p>\/etc\/rc.d\/init.d\/mysqld start #\u542f\u52a8<\/p>\n<p>&nbsp;<\/p>\n<p>chkconfig mysqld on #\u52a0\u5165\u5f00\u673a\u542f\u52a8<\/p>\n<p>&nbsp;<\/p>\n<p>mysql_secure_installation #\u8bbe\u7f6eMysql\u5bc6\u7801<\/p>\n<p>&nbsp;<\/p>\n<p>\u6839\u636e\u63d0\u793a\u6309Y \u56de\u8f66\u8f93\u51652\u6b21\u5bc6\u7801<\/p>\n<p>&nbsp;<\/p>\n<p>\u6216\u8005\u76f4\u63a5\u4fee\u6539\u5bc6\u7801\/usr\/local\/mysql\/bin\/mysqladmin -u root -p password \"123456\" #\u4fee\u6539\u5bc6\u7801<\/p>\n<p>&nbsp;<\/p>\n<p>service mysqld restart #\u91cd\u542f<\/p>\n<p>&nbsp;<\/p>\n<p>\u5230\u6b64\uff0cmysql\u5b89\u88c5\u5b8c\u6210\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e8c\u3001\u5b89\u88c5Apache<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf httpd-2.2.31.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd httpd-2.2.31<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/apache --with-included-apr --enable-module=so --enable-deflate --enable-expires --enable-ssl --enable-headers --enable-module=rewrite --enable-static-support --enable-mods-shared=all --enable-proxy=share --enable-proxy-ajp=share --enable-dav=share --enable-dav-fs<\/p>\n<p>&nbsp;<\/p>\n<p>make #\u7f16\u8bd1<\/p>\n<p>&nbsp;<\/p>\n<p>make install #\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n<p>\/usr\/local\/apache\/bin\/apachectl -k start #\u542f\u52a8<\/p>\n<p>&nbsp;<\/p>\n<p>vi \/usr\/local\/apache\/conf\/httpd.conf #\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230\uff1a#ServerName www.example.com:80<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1aServerName www.osyunwei.com:80<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230\uff1aDirectoryIndex index.html<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1aDirectoryIndex index.html index.php<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230\uff1aOptions Indexes FollowSymLinks<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1aOptions FollowSymLinks #\u4e0d\u663e\u793a\u76ee\u5f55\u7ed3\u6784<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230AllowOverride None<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1aAllowOverride All #\u5f00\u542fapache\u652f\u6301\u4f2a\u9759\u6001\uff0c\u6709\u4e09\u5904\u90fd\u505a\u4fee\u6539<\/p>\n<p>&nbsp;<\/p>\n<p>LoadModule rewrite_module modules\/mod_rewrite.so #\u53d6\u6d88\u524d\u9762\u7684\u6ce8\u91ca\uff0c\u5f00\u542fapache\u652f\u6301\u4f2a\u9759\u6001<\/p>\n<p>&nbsp;<\/p>\n<p>vi \/etc\/profile #\u6dfb\u52a0apache\u670d\u52a1\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\uff0c\u5728\u6700\u540e\u6dfb\u52a0\u4e0b\u9762\u8fd9\u4e00\u884c<\/p>\n<p>&nbsp;<\/p>\n<p>export PATH=$PATH:\/usr\/local\/apache\/bin<\/p>\n<p>&nbsp;<\/p>\n<p>:wq! #\u4fdd\u5b58\u9000\u51fa<\/p>\n<p>&nbsp;<\/p>\n<p>cp \/usr\/local\/apache\/bin\/apachectl \/etc\/rc.d\/init.d\/httpd #\u628aapache\u52a0\u5165\u5230\u7cfb\u7edf\u542f\u52a8<\/p>\n<p>&nbsp;<\/p>\n<p>vi \/etc\/init.d\/httpd #\u7f16\u8f91\u6587\u4ef6\uff0c\u5728#!\/bin\/sh\u4e0b\u9762\u6dfb\u52a0\u4ee5\u4e0b\u4e24\u884c<\/p>\n<p>&nbsp;<\/p>\n<p>#chkconfig:2345 10 90<\/p>\n<p>&nbsp;<\/p>\n<p>#description:Activates\/Deactivates Apache Web Server<\/p>\n<p>&nbsp;<\/p>\n<p>:wq! #\u4fdd\u5b58\u9000\u51fa<\/p>\n<p>&nbsp;<\/p>\n<p>chown daemon.daemon -R \/usr\/local\/apache\/htdocs #\u66f4\u6539\u76ee\u5f55\u6240\u6709\u8005<\/p>\n<p>&nbsp;<\/p>\n<p>chmod 700 \/usr\/local\/apache\/htdocs -R #\u66f4\u6539apache\u7f51\u7ad9\u76ee\u5f55\u6743\u9650<\/p>\n<p>&nbsp;<\/p>\n<p>chkconfig httpd on #\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8<\/p>\n<p>&nbsp;<\/p>\n<p>\/etc\/init.d\/httpd start<\/p>\n<p>&nbsp;<\/p>\n<p>service httpd restart<\/p>\n<p>&nbsp;<\/p>\n<p>\u7cfb\u7edf\u8fd0\u7ef4 www.osyunwei.com \u6e29\u99a8\u63d0\u9192\uff1a\u7cfb\u7edf\u8fd0\u7ef4\u539f\u521b\u5185\u5bb9\u00a9\u7248\u6743\u6240\u6709,\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u53ca\u539f\u6587\u94fe\u63a5<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e09\u3001\u5b89\u88c5PHP<\/p>\n<p>&nbsp;<\/p>\n<p>1\u3001\u5b89\u88c5yasm<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf yasm-1.3.0.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd yasm-1.3.0<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure<\/p>\n<p>&nbsp;<\/p>\n<p>make<\/p>\n<p>&nbsp;<\/p>\n<p>make install<\/p>\n<p>&nbsp;<\/p>\n<p>2\u3001\u5b89\u88c5libmcrypt<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf libmcrypt-2.5.8.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd libmcrypt-2.5.8<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure<\/p>\n<p>&nbsp;<\/p>\n<p>make<\/p>\n<p>&nbsp;<\/p>\n<p>make install<\/p>\n<p>&nbsp;<\/p>\n<p>3\u3001\u5b89\u88c5libvpx<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar xvf libvpx-v1.3.0.tar.bz2<\/p>\n<p>&nbsp;<\/p>\n<p>cd libvpx-v1.3.0<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/libvpx --enable-shared --enable-vp9<\/p>\n<p>&nbsp;<\/p>\n<p>make<\/p>\n<p>&nbsp;<\/p>\n<p>make install<\/p>\n<p>&nbsp;<\/p>\n<p>4\u3001\u5b89\u88c5tiff<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf tiff-4.0.3.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd tiff-4.0.3<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/tiff --enable-shared<\/p>\n<p>&nbsp;<\/p>\n<p>make<\/p>\n<p>&nbsp;<\/p>\n<p>make install<\/p>\n<p>&nbsp;<\/p>\n<p>5\u3001\u5b89\u88c5libpng<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf libpng-1.6.18.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd libpng-1.6.18<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/libpng --enable-shared<\/p>\n<p>&nbsp;<\/p>\n<p>make<\/p>\n<p>&nbsp;<\/p>\n<p>make install<\/p>\n<p>&nbsp;<\/p>\n<p>6\u3001\u5b89\u88c5freetype<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf freetype-2.5.4.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd freetype-2.5.4<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/freetype --enable-shared<\/p>\n<p>&nbsp;<\/p>\n<p>make #\u7f16\u8bd1<\/p>\n<p>&nbsp;<\/p>\n<p>make install #\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n<p>7\u3001\u5b89\u88c5jpeg<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf jpegsrc.v9a.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd jpeg-9a<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/jpeg --enable-shared<\/p>\n<p>&nbsp;<\/p>\n<p>make #\u7f16\u8bd1<\/p>\n<p>&nbsp;<\/p>\n<p>make install #\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n<p>8\u3001\u5b89\u88c5libgd<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf libgd-2.1.0.tar.gz #\u89e3\u538b<\/p>\n<p>&nbsp;<\/p>\n<p>cd libgd-2.1.0 #\u8fdb\u5165\u76ee\u5f55<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/libgd --enable-shared --with-jpeg=\/usr\/local\/jpeg --with-png=\/usr\/local\/libpng --with-freetype=\/usr\/local\/freetype --with-fontconfig=\/usr\/local\/freetype --with-xpm=\/usr\/ --with-tiff=\/usr\/local\/tiff --with-vpx=\/usr\/local\/libvpx #\u914d\u7f6e<\/p>\n<p>&nbsp;<\/p>\n<p>make #\u7f16\u8bd1<\/p>\n<p>&nbsp;<\/p>\n<p>make install #\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n<p>9\u3001\u5b89\u88c5t1lib<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf t1lib-5.1.2.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd t1lib-5.1.2<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/t1lib --enable-shared<\/p>\n<p>&nbsp;<\/p>\n<p>make without_doc<\/p>\n<p>&nbsp;<\/p>\n<p>make install<\/p>\n<p>&nbsp;<\/p>\n<p>10\u3001\u5b89\u88c5curl<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar zxvf curl-7.44.0.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd curl-7.44.0<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/curl --with-gssapi --enable-tls-srp --with-libmetalink<\/p>\n<p>&nbsp;<\/p>\n<p>make<\/p>\n<p>&nbsp;<\/p>\n<p>make install<\/p>\n<p>&nbsp;<\/p>\n<p>11\u3001\u5b89\u88c5php<\/p>\n<p>&nbsp;<\/p>\n<p>\u6ce8\u610f\uff1a\u5982\u679c\u7cfb\u7edf\u662f64\u4f4d\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u4e24\u6761\u547d\u4ee4\uff0c\u5426\u5219\u5b89\u88c5php\u4f1a\u51fa\u9519\uff0832\u4f4d\u7cfb\u7edf\u4e0d\u9700\u8981\u6267\u884c\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>\\cp -frp \/usr\/lib64\/libltdl.so* \/usr\/lib\/<\/p>\n<p>&nbsp;<\/p>\n<p>\\cp -frp \/usr\/lib64\/libXpm.so* \/usr\/lib\/<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>&nbsp;<\/p>\n<p>tar -zvxf php-5.2.17.tar.gz<\/p>\n<p>&nbsp;<\/p>\n<p>cd php-5.2.17<\/p>\n<p>&nbsp;<\/p>\n<p>export LD_LIBRARY_PATH=\/usr\/local\/libgd\/lib<\/p>\n<p>&nbsp;<\/p>\n<p>.\/configure --prefix=\/usr\/local\/php --with-config-file-path=\/usr\/local\/php\/etc --with-apxs2=\/usr\/local\/apache\/bin\/apxs --with-mysql=\/usr\/local\/mysql --with-mysqli=\/usr\/local\/mysql\/bin\/mysql_config --with-mysql-sock=\/tmp\/mysql.sock --with-pdo-mysql=\/usr\/local\/mysql --with-gd --with-png-dir=\/usr\/local\/libpng --with-jpeg-dir=\/usr\/local\/jpeg --with-freetype-dir=\/usr\/local\/freetype --with-xpm-dir=\/usr\/ --with-vpx-dir=\/usr\/local\/libvpx\/ --with-zlib-dir=\/usr\/local\/zlib --with-t1lib=\/usr\/local\/t1lib\u00a0 --with-curl=\/usr\/local\/curl\u00a0 --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt\u00a0 --with-curl\u00a0 --enable-ctype<\/p>\n<p>&nbsp;<\/p>\n<p>make #\u7f16\u8bd1<\/p>\n<p>&nbsp;<\/p>\n<p>make install #\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n<p>make -p \/usr\/local\/php\/etc<\/p>\n<p>&nbsp;<\/p>\n<p>cp php.ini-recommended \/usr\/local\/php\/etc\/php.ini #\u590d\u5236php\u914d\u7f6e\u6587\u4ef6\u5230\u5b89\u88c5\u76ee\u5f55<\/p>\n<p>&nbsp;<\/p>\n<p>rm -rf \/etc\/php.ini #\u5220\u9664\u7cfb\u7edf\u81ea\u5e26\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>&nbsp;<\/p>\n<p>ln -s \/usr\/local\/php\/etc\/php.ini \/etc\/php.ini #\u6dfb\u52a0\u8f6f\u94fe\u63a5\u5230 \/etc\u76ee\u5f55<\/p>\n<p>&nbsp;<\/p>\n<p>vi \/usr\/local\/php\/etc\/php.ini #\u7f16\u8f91<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230\uff1a;open_basedir =<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1aopen_basedir = .:\/tmp\/ #\u9632\u6b62php\u6728\u9a6c\u8de8\u7ad9\uff0c\u91cd\u8981\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230\uff1adisable_functions =<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1adisable_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<\/p>\n<p>&nbsp;<\/p>\n<p>#\u5217\u51faPHP\u53ef\u4ee5\u7981\u7528\u7684\u51fd\u6570\uff0c\u5982\u679c\u67d0\u4e9b\u7a0b\u5e8f\u9700\u8981\u7528\u5230\u8fd9\u4e2a\u51fd\u6570\uff0c\u53ef\u4ee5\u5220\u9664\uff0c\u53d6\u6d88\u7981\u7528\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230\uff1a;date.timezone =<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1adate.timezone = PRC<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230\uff1aexpose_php = On<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1aexpose_php = OFF #\u7981\u6b62\u663e\u793aphp\u7248\u672c\u7684\u4fe1\u606f<\/p>\n<p>&nbsp;<\/p>\n<p>\u627e\u5230\uff1adisplay_errors = On<\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6539\u4e3a\uff1adisplay_errors = OFF #\u5173\u95ed\u9519\u8bef\u63d0\u793a<\/p>\n<p>&nbsp;<\/p>\n<p>:wq! #\u4fdd\u5b58\u9000\u51fa<\/p>\n<p>&nbsp;<\/p>\n<p>\u56db\u3001\u914d\u7f6eapache\u652f\u6301php<\/p>\n<p>&nbsp;<\/p>\n<p>vi \/usr\/local\/apache\/conf\/httpd.conf #\u7f16\u8f91apache\u914d\u7f6e\u6587\u4ef6\uff0c\u5728AddType application\/x-gzip .gz .tgz\u8fd9\u4e00\u884c\u4e0b\u9762\u6dfb\u52a0<\/p>\n<p>&nbsp;<\/p>\n<p>AddType application\/x-httpd-php .php \uff08\u6ce8\u610f\uff1aphp .php\u8fd9\u4e2a\u70b9\u524d\u9762\u6709\u4e00\u4e2a\u7a7a\u683c\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>:wq! #\u4fdd\u5b58\u9000\u51fa<\/p>\n<p>&nbsp;<\/p>\n<p>service httpd restart #\u91cd\u542fapache<\/p>\n<p>&nbsp;<\/p>\n<p>service mysqld restart #\u91cd\u542fmysql<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e94\u3001\u6d4b\u8bd5<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/apache\/htdocs<\/p>\n<p>&nbsp;<\/p>\n<p>vi index.php #\u8f93\u5165\u4e0b\u9762\u5185\u5bb9<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>&nbsp;<\/p>\n<p>phpinfo();<\/p>\n<p>&nbsp;<\/p>\n<p>?&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>:wq! #\u4fdd\u5b58<\/p>\n<p>&nbsp;<\/p>\n<p>\u5728\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8f93\u5165\u670d\u52a1\u5668IP\u5730\u5740\uff0c\u53ef\u4ee5\u770b\u5230\u76f8\u5173\u7684\u914d\u7f6e\u4fe1\u606f\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>\u7f51\u7ad9\u7a0b\u5e8f\u4e0a\u4f20\u5230\/usr\/local\/apache\/htdocs\u76ee\u5f55\u91cc\u9762\uff0c\u5982\u679c\u5b89\u88c5\u6709\u95ee\u9898\uff0c\u8bf7\u68c0\u67e5\u76ee\u5f55\u6743\u9650\uff0c\u786e\u4fdd\u76ee\u5f55\u4e3a\u4ee5\u4e0b\u6743\u9650<\/p>\n<p>&nbsp;<\/p>\n<p>chown daemon.daemon -R \/usr\/local\/apache\/htdocs<\/p>\n<p>&nbsp;<\/p>\n<p>chmod -R 700 \/usr\/local\/apache\/htdocs<\/p>\n<p>&nbsp;<\/p>\n<p>\u81f3\u6b64\uff0cLinux\u4e0b\u6307\u5b9a\u7248\u672c\u7f16\u8bd1\u5b89\u88c5LAMP\u6559\u7a0b\u5b8c\u6210\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>\u6269\u5c55\u9605\u8bfb\uff1a\u4e3aapache\u589e\u52a0mod_proxy\u6a21\u5757<\/p>\n<p>&nbsp;<\/p>\n<p>\u5728\u7f16\u8bd1apahe\u7684\u65f6\u5019\u5982\u679c\u6ca1\u6709\u5b89\u88c5mod_proxy\u6a21\u5757\uff0c\u5219\u4e0d\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u53ef\u4ee5\u6dfb\u52a0\u6a21\u5757\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>cd \/usr\/local\/src\/httpd-2.2.31<\/p>\n<p>&nbsp;<\/p>\n<p>\/usr\/local\/apache2\/bin\/apxs -c -i -a mod_proxy.c proxy_util.c<\/p>\n<p>&nbsp;<\/p>\n<p>\/usr\/local\/apache2\/bin\/apxs -c -i -a mod_proxy_ajp.c ajp*.c<\/p>\n<p>&nbsp;<\/p>\n<p>\/usr\/local\/apache2\/bin\/apxs -c -i -a mod_proxy_balancer.c\u00a0 mod_proxy_connect.c\u00a0 mod_proxy_http.c mod_proxy_ftp.c<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\u5728apache\u7684modules\u76ee\u5f55\u4e2d\u751f\u6210\u4e86mod_proxy_http.so, mod_proxy_ftp.so, mod_proxy_connect.so\u7b49\u6587\u4ef6\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e4b\u540e\u5728httpd.conf\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9<\/p>\n<p>&nbsp;<\/p>\n<p>LoadModule proxy_module modules\/mod_proxy.so<\/p>\n<p>&nbsp;<\/p>\n<p>LoadModule proxy_http_module modules\/mod_proxy_http.so<\/p>\n<p>&nbsp;<\/p>\n<p>LoadModule proxy_ftp_module modules\/mod_proxy_ftp.so<\/p>\n<p>&nbsp;<\/p>\n<p>LoadModule proxy_connect_module modules\/mod_proxy_connect.so<\/p>\n<p>&nbsp;<\/p>\n<p>LoadModule proxy_ajp_module modules\/mod_proxy_ajp.so<\/p>\n<p>&nbsp;<\/p>\n<p>LoadModule proxy_balancer_module modules\/mod_proxy_balancer.so<\/p>\n<p>&nbsp;<\/p>\n<p>mod_proxy\u5b89\u88c5\u5b8c\u6210\uff0c\u91cd\u542fapache\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Centos6 \u6307\u5b9a\u7248\u672c\u7f16\u8bd1\u5b89\u88c5LAMP \u8bf4\u660e\uff1a &nbsp; \u64cd\u4f5c\u7cfb\u7edf\uff1aCentOS 6.5 64\u4f4d &#038;nb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-111579","post","type-post","status-publish","format-standard","hentry","category-centos"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/111579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=111579"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/111579\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=111579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=111579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=111579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}