Linux+mysql+apache+php

來源:互聯網
上載者:User

標籤:

1.1.1               所需軟體
  • cmake
  • ncourse
  • mysql
  • apr
  • apr-util
  • pcre
  • apache
  • php
1.1.2               解壓縮軟體

進入/usr/src/soft目錄

tar xzf /usr/src/tar/httpd-2.4.10.tar.gz -C /usr/src/soft/

tar xzf /usr/src/tar/ apr-util-1.5.4.tar.gz -C /usr/src/soft/

tar xzf /usr/src/tar/ apr-1.5.2.tar.gz -C /usr/src/soft/

tar xzf /usr/src/tar/mysql-5.6.22.tar.gz -C /usr/src/soft/

tar xzf /usr/src/tar/pcre-8.35.tar.gz -C /usr/src/soft/

tar xzf /usr/src/tar/cmake-3.0.0.tar.gz -C /usr/src/soft/

tar xzf /usr/src/tar/ncurses.tar.gz -C /usr/src/soft/

tar xzf /usr/src/tar/php-5.6.0.tar.gz -C /usr/src/soft/

1.1.3               軟體安裝1.1.3.1          安裝cmake

cd /usr/src/soft/cmake-3.0.0/

./configure

make && make install

1.1.3.2          安裝ncourse

cd /usr/src/soft/ncurses-5.9/

./configure

make && make install

1.1.3.3          安裝mysql

groupadd mysql

useradd -r -g mysql mysql

cmake .

  make

  make install

           cd /usr/local/mysql/

chown -R mysql .

chgrp -R mysql .

scripts/mysql_install_db --user=mysql

chown -R root .

chown -R mysql data

bin/mysqld_safe --user=mysql &

cp support-files/mysql.server /etc/init.d/mysqld

1.1.3.4          安裝apr

cd srclib/apr

./configure --prefix=/usr/local/apr

make && make install

1.1.3.5          安裝apr-util

cd ../apr-util/

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/

make && make install

1.1.3.6          安裝pcre

cd /usr/src/soft/pcre-8.35/

./configure --prefix=/usr/local/pcre

make && make install

PATH=$PATH:/usr/local/pcretbin/

1.1.3.7          安裝httpd

cd /usr/src/soft/httpd-2.4.10

./configure --prefix=/usr/local/apache \

--enable-so \

--with-apr=/usr/local/apr \

--with-apr-util=/usr/local/apr-util/bin \

--enable-mods-shared=all \

--with-mpm=worker \

--enable-cache \

--enable-disk-cache \

--enable-mem-cache \

--enable-file-cache\

--with-pcr=/usr/local/pcre/

make

make install

         更改httpd.conf中的ServerName

1.1.3.8          安裝PHP

cd /usr/src/soft/php-5.6.0/

./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/

make && make install

cp php.ini-development /usr/local/lib/php.ini

vi /usr/local/apache/conf/httpd.conf

<IfModule mime_module>

SetHandler application/x-httpd-php

</IfModule>

1.1.4               軟體配置1.1.4.1          httpd.conf配置

vi /usr/local/apache/conf/httpd.conf

         ServerName 127.0.0.1:80

         <IfModule mime_module>

SetHandler application/x-httpd-php

</IfModule>

 

對個版本來說,添加如下語句以支援PHP

        AddType application/x-httpd-php .php

 

AddHandler php-script .phpAddType text/html .php
 1.1.5               軟體測試1.1.5.1          Apache測試

在瀏覽器中輸入:http://172.16.2.82

如顯示:“It Works”則證明該軟體正常運行

1.1.5.2          php測試

寫一個簡單的phpinfo指令碼,如下

vi /usr/local/apache/htdocs/phpinfo.php

         <?php

        phpinfo();

?>

         在瀏覽器中輸入:http://172.16.2.82/phpinfo.php

         測試該指令碼是否能夠正常顯示PHP的相關資訊

Linux+mysql+apache+php

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.