您好,登錄后才能下訂單哦!
本篇內(nèi)容主要講解“Ubuntu如何編譯安裝lamp”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“Ubuntu如何編譯安裝lamp”吧!
編譯安裝apache 2.4.2
復(fù)制代碼 代碼如下:
sudo echo 'start'
echo 常見(jiàn)錯(cuò)誤:
echo configure: error: apr not found. please read the documentation.
echo 解決辦法:
wget http://labs.renren.com/apache-mirror/apr/apr-1.4.6.tar.bz2
tar -jxvf apr-1.4.6.tar.bz2
cd apr-1.4.6
./configure --prefix=/usr/local/apr
make
sudo make install
cd ..
echo 常見(jiàn)錯(cuò)誤:
echo ah00526: syntax error on line 490 of /usr/local/apache2/conf/httpd.conf:
echo unknown filter provider deflate
echo httpd: syntax error on line 101 of /usr/local/apache2/conf/httpd.conf: cannot load /usr/local/apache2/modules/mod_deflate.so into server: /usr/local/apache2/modules/mod_deflate.so: undefined symbol: inflate
echo 解決辦法:
sudo sed -i "s/ldflags=\"\"/ldflags=\"-lz\"/g" '/usr/local/apr/bin/apr-1-config'
wget http://labs.renren.com/apache-mirror/apr/apr-util-1.4.1.tar.bz2
tar -jxvf apr-util-1.4.1.tar.bz2
cd apr-util-1.4.1
./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
make
sudo make install
cd ..
echo 常見(jiàn)錯(cuò)誤:
echo configure: error: pcre-config for libpcre not found. pcre is required and available from http://pcre.org/
echo 解決辦法:
sudo echo start
wget http://downloads.sourceforge.net/project/pcre/pcre/8.30/pcre-8.30.zip
unzip pcre-8.30.zip
cd pcre-8.30
./configure --prefix=/usr/local/pcre
sudo make
sudo make install
cd ..
echo 常見(jiàn)錯(cuò)誤:
echo checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
echo 解決辦法:
sudo apt-get install -y zlib1g-dev
echo 開(kāi)始安裝:
wget http://labs.renren.com/apache-mirror/httpd/httpd-2.4.2.tar.bz2 tar -jxvf httpd-2.4.2.tar.bz2 cd httpd-2.4.2 ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --enable-so --enable-rewrite --enable-deflate --with-module=metadata:expires make sudo make install echo 'expiresactive on' | sudo tee -a /usr/local/apache2/conf/httpd.conf echo 'fileetag none' | sudo tee -a /usr/local/apache2/conf/httpd.conf echo 'setoutputfilter deflate' | sudo tee -a /usr/local/apache2/conf/httpd.conf sudo sed -i "s/#loadmodule deflate_module modules\/mod_deflate.so/loadmodule deflate_module modules\/mod_deflate.so/g" '/usr/local/apache2/conf/httpd.conf' sudo /usr/local/apache2/bin/apachectl start cd ..
編譯安裝mysql 5.5.25a
ubuntu 11.04 x64 編譯安裝mysql
os:ubuntu 11.04 x64
手動(dòng)安裝mysql 5.5.17
從mysql.com下載最新版的,有rpm自動(dòng)安裝包給federo、centos用,沒(méi)有deb包。所以u(píng)buntu要手動(dòng)安裝。下載linux - generic 2.6 (x86, 64-bit), compressed tar archive。
echo 復(fù)制下面整段shell到命令行終端中,會(huì)自動(dòng)逐條執(zhí)行。
sudo apt-get install -y libaio1 sudo apt-get remove -y mysql-common mysql-server mysql-client sudo rm -rf /etc/mysql/ wget -o mysql-5.5.20-linux2.6-x86_64.tar.gz http://dev.mysql.com/get/downloads/mysql-5.5/mysql-5.5.20-linux2.6-x86_64.tar.gz/from/http://mysql.oss.eznetsols.org/ tar -zxvf mysql-5.5.20-linux2.6-x86_64.tar.gz sudo mv ./mysql-5.5.20-linux2.6-x86_64 /usr/local/mysql sudo groupadd mysql sudo useradd -r -g mysql mysql cd /usr/local/mysql sudo chown -r mysql . sudo chgrp -r mysql . sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql sudo chown -r root . sudo chown -r mysql data sudo cp support-files/my-medium.cnf /etc/my.cnf sudo ln -s /usr/local/mysql/bin/mysql /usr/bin/ sudo ln -s /usr/local/mysql/bin/mysqldump /usr/bin/ sudo cp support-files/mysql.server /etc/init.d/mysql sudo /etc/init.d/mysql start ./bin/mysqladmin -u root password '1' sudo /etc/init.d/mysql restart mysql -uroot -p1
添加服務(wù) 讓mysqld開(kāi)機(jī)自動(dòng)啟動(dòng)
sudo cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql sudo update-rc.d mysql defaults
安裝完成,需要配置mysql。
編譯安裝php 5.4.4
sudo apt-get install -y curl libxml2 libxml2-dev libssl-dev sendmail libcurl4-openssl-dev libjpeg-dev libpng-dev libmcrypt-dev wget -o php-5.4.4.tar.bz2 http://cn.php.net/get/php-5.4.4.tar.bz2/from/this/mirror tar -jxvf php-5.4.4.tar.bz2 cd php-5.4.4 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-curl --with-mcrypt --enable-mbstring --enable-pdo --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-imap-ssl --with-gd --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/ --enable-exif --enable-zip make sudo make install sudo cp php.ini-development /usr/local/php/lib/php.ini sudo rm /usr/bin/php sudo ln -s /usr/local/php/bin/php /usr/bin/php echo 'addhandler application/x-httpd-php .php' | sudo tee -a /usr/local/apache2/conf/httpd.conf sudo sed -i "s/;include_path = \".:\/php\/includes\"/include_path = \"\/usr\/local\/php\/lib\/php\"/g" '/usr/local/php/lib/php.ini' sudo /usr/local/apache2/bin/apachectl restart
到此,相信大家對(duì)“Ubuntu如何編譯安裝lamp”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。