一、安裝httpd
成都創(chuàng)新互聯(lián)是一家專注于網(wǎng)站建設(shè)、做網(wǎng)站與策劃設(shè)計,赫章網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10年,網(wǎng)設(shè)計領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:赫章等地區(qū)。赫章做網(wǎng)站價格咨詢:135182197921、安裝apr
yum -y install gcc gcc-c++ openssl-devel pcre-devel tar xf apr-1.4.6.tar.bz2 cd apr-1.4.6 ./configure --prefix=/usr/local/apr --disable-ipv6 make && make install2、安裝apr-util
tar xf apr-util-1.4.1.tar.bz2 cd apr-util-1.4.1 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make && make install3、安裝apache
tar zxf httpd-2.4.17.tar.gz cd httpd-2.4.17 ./configure \ --prefix=/usr/local/apache \ --sysconfdir=/etc/httpd \ --enable-so \ --enable-ssl \ --enable-cgi \ --enable-rewrite \ --with-zlib \ --with-pcre \ --with-apr=/usr/local/apr \ --with-apr-util=/usr/local/apr-util \ --enable-modules=most \ --enable-mods-shared=most \ --enable-mpms-shared=all \ --with-mpm=event make && make install4、設(shè)置服務(wù)控制腳本
cp build/rpm/httpd.init /etc/init.d/httpd vim /etc/init.d/httpd httpd=${HTTPD-/usr/local/apache/bin/httpd} pidfile=${PIDFILE-/usr/local/apache/logs/${prog}.pid} lockfile=${LOCKFILE-/var/lock/subsys/${prog}} RETVAL=0 # check for 1.3 configuration check13 () { CONFFILE=/etc/httpd/httpd.conf echo "PATH=/usr/local/apache/bin:$PATH" >> /etc/profile.d/http.sh . /etc/profile.d/http.sh ln -s /usr/local/apache/include/ /usr/include/httpd vim /etc/httpd/httpd.conf ServerName localhost:80 chkconfig --add httpd chkconfig httpd on service httpd start二、安裝php
tar zxf php-5.6.0.tar.gz cd php-5.6.0 yum install -y libxml2 libxml2-devel bzip2 bzip2-devel curl* curl-devel libjpeg\* openjpeg\* \*png\* freetype\* ./configure \ --prefix=/usr/local/php \ --with-config-file-path=/usr/local/php/etc \ --with-bz2 \ --with-curl \ --enable-ftp \ --enable-sockets \ --disable-ipv6 \ --with-gd \ --with-jpeg-dir=/usr/local \ --with-png-dir=/usr/local \ --with-freetype-dir=/usr/local \ --enable-gd-native-ttf \ --with-iconv-dir=/usr/local \ --enable-mbstring \ --enable-calendar \ --with-gettext \ --with-libxml-dir=/usr/local \ --with-zlib \ --with-pdo-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-mysql=mysqlnd \ --enable-dom \ --enable-xml \ --enable-fpm \ --with-libdir=lib64 \ --enable-bcmath make make install cp php.ini-production /usr/local/php/etc/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm chmod +x /etc/init.d/php-fpm chkconfig --add php-fpm chkconfig php-fpm on service php-fpm start三、整合httpd和php
方式1:修改httpd主配置文件httpd.conf
去掉以下兩行的 ‘#’ LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so 修改ServerName ServerName 127.0.0.1:80 或 ServerName localhost:80 添加 <FilesMatch \.php$> SetHandler "proxy:fcgi://127.0.0.1:9000" </FilesMatch>方式2:配置虛擬主機(jī)
去掉以下三行的 ‘#’ LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so Include /etc/httpd/extra/httpd-vhosts.conf 修改ServerName ServerName 127.0.0.1:80 或 ServerName localhost:80 注釋下面正一行 DocumentRoot "/usr/local/apache/htdocs" 在httpd-vhosts.conf配置文件添加虛擬機(jī) <VirtualHost *:80> DocumentRoot "/usr/local/apache/htdocs" ServerName www.example.com ProxyRequests Off ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/$1 <Directory "/usr/local/apache/htdocs"> Options none AllowOverride none Require all granted </Directory> </VirtualHost>四、測試
新建測試文件
vim /usr/local/nginx/html/phpinfo.php <?php phpinfo(); ?>在瀏覽器中輸入:http://ip/phpinfo.php
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
網(wǎng)站名稱:install_httpd_php-創(chuàng)新互聯(lián)
文章轉(zhuǎn)載:http://jinyejixie.com/article8/jgiop.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站、全網(wǎng)營銷推廣、企業(yè)網(wǎng)站制作、網(wǎng)站制作、軟件開發(fā)、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容