Apache:編譯和安裝

一、在Fedora / CentOS / Red Hat Enterprise Linux上安裝apache

sudo yum install httpd 
sudo systemctl enable httpd 
sudo systemctl start httpd

二、在Ubuntu / Debian上安裝服務器

sudo apt install apache2 
sudo service apache2 start

三、源代碼安裝spa

下載:http://httpd.apache.org/download.cgi
提取:
  $ gzip -d httpd-NN.tar.gz
  $ tar xvf httpd-NN.tar
  $ cd httpd-NN
Configure    $ ./configure --prefix=PREFIX
編譯:$ make
安裝:$ make install
Customize    $ vi PREFIX/conf/httpd.conf
Test    $ PREFIX/bin/apachectl -k start #啓動與中止 $ PREFIX/bin/apachectl -k start/$ PREFIX/bin/apachectl -k stop
#NN必須替換爲當前版本號,而且PREFIX必須替換爲應安裝服務器的文件系統路徑。若是 未指定PREFIX,則默認爲 /usr/local/apache

 四、升級code

  $ ./config.nice
  $ make
  $ make install
  $ PREFIX/bin/apachectl -k graceful-stop
  $ PREFIX/bin/apachectl -k start
blog

相關文章
相關標籤/搜索