- pcre-8.35.tar.gz
- httpd-2.4.10.tar.gz
- apr-1.5.1.tar.gz
- apr-util-1.5.3.tar.gz
更新Ubuntu套件與安裝所需套件
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential gcc make cmake libssl-dev libxml2-dev libpng-dev libjpeg-dev libcurl4-openssl-dev libbz2-dev libncurses5 libncurses5-dev libaio1 libmcrypt-dev
一、Pcre下載及安裝
sudo wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
sudo gzip -d pcre-8.35.tar.gz
sudo tar xvf pcre-8.35.tar
cd pcre-8.35
sudo ./configure
sudo make
sudo make install
二、Apache2.4 + Apr + Apr-util 下載及安裝
sudo wget http://archive.apache.org/dist/httpd/httpd-2.4.10.tar.gz
sudo gzip -d httpd-2.4.10.tar.gz
sudo tar xvf httpd-2.4.10.tar
sudo wget http://archive.apache.org/dist/apr/apr-1.5.1.tar.gz
sudo gzip -d apr-1.5.1.tar.gz
sudo tar xvf apr-1.5.1.tar
sudo wget http://archive.apache.org/dist/apr/apr-util-1.5.3.tar.gz
sudo gzip -d apr-util-1.5.3.tar.gz
sudo tar xvf apr-util-1.5.3.tar
sudo mv apr-1.5.1 apr
sudo mv apr-util-1.5.3 apr-util
sudo mv apr apr-util httpd-2.4.10/srclib/
cd httpd-2.4.10
sudo ./configure --with-included-apr --with-pcre=/usr/local/bin/pcre-config --with-crypto --enable-ssl --enable-rewrite --enable-dav --enable-so --enable-http --enable-mime-magic --enable-info
sudo make
sudo make install
sudo /usr/local/apache2/bin/apachectl start#Start Apache2 Server-會發生以下的錯誤
/usr/local/apache2/bin/httpd: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
解決 Start Apache2 server 方法如下
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
sudo ldconfig
sudo /usr/local/apache2/bin/apachectl restart
三、設定Apache2啟動時間(Start Apache at Boot Time)
sudo cp /usr/local/apache2/bin/apachectl /etc/init.d/apache2
sudo chmod +x /etc/init.d/apache2
sudo update-rc.d apache2 defaults
四、增加Apache2 程式執行路徑
export PATH=$PATH:/usr/local/apache2/bin
五、設定Apache2路徑權限
sudo chown -R root:root /usr/local/apache2/
sudo chmod -R go-rwx /usr/local/apache2/
sudo chmod -R a-w /usr/local/apache2/
sudo chmod o+x /usr/local/apache2/
sudo chmod o+x /usr/local/apache2/htdocs/
sudo chmod o+x /usr/local/apache2/cgi-bin/
sudo chmod -R o+r /usr/local/apache2/htdocs/
sudo chmod -R u+w /usr/local/apache2/conf/ /usr/local/apache2/logs/
參考鏈結:https://www.virgohacks.net/install-apache-2-4-mysql-5-6-php-5-5-source-ubuntu-14-04/
沒有留言:
張貼留言