Installing Apache today is encountering a pit, so write a record.
Native environment
System: Personal PC debian/deepin-15.5, this tutorial is for the Debian system
Installing the Software
Target software: apache-httpd, Apache Server Software, currently (02/20/2018) version 2.4.29, download official website http://httpd.apache.org/, recommended direct access to Tsinghua Mirror download.
May encounter the Pit
Mainly software missing and command error, this is the purpose of this article
Software that may need to be installed in advance:
- Gcc-c++ (You can use 'gcc-v' to see if GCC is installed), download the official website GNU-GCC
- Expat(function: Parse xml), download the official website expat, but it is recommended to use the command 'sudo apt-get install libexpat-dev' installation
If you encounter a heap during the installation process: Undefined reference to ' Xml_. ', such as
I follow the stackoverflow of the word,
In the './configure--prefix= installation directory--with-included-apr' stage, use the './configure--prefix= installation directory-- WITH-INCLUDED-APR --with-included-apr-util' substitute, the error disappears
Note: If the above method does not solve the problem, please Google
The following is the basic installation process:
In addition to the above software, download the following software
- APR, download official website apr&apr-util
- Apr-util, download website ibid.
- PCRE (This see other tutorials need to install, I do not use when installing, you can according to make phase mentioned PCRE decide whether to install), download official website PCRE
Process:
Using the ' sudo tar-zxvf file path ' to extract the tar.gz format file, the default decompression to the current folder, you can attach the '-C target path ' to specify the decompression path (trick: Your terminal may support the input sudo tar-zxvf directly after the file is dragged into the terminal, Save time to enter file path).
- Press the method, unzip the httpd-2.x.xx.tar.gz
- Unzip apr-1.x.x.tar.gz and apr-util-1.x.x.tar.gz to folder httpd-2.x.xx/srclib/
- The second step to extract the name of the two folder "Apr" and "apr-util" ( note : Need to elevate permissions to operate, I am directly Modify permissions chmod 777- R Srclib then renamed, you can modify the folder name through the terminal )
- To configure, use the './configure--prefix= installation directory--with-included-apr with-included-apr-util ' will install the directory Modify the location that you want to install, suggest /usr/local/apache2(at the moment your terminal is under folder httpd-2.x.xx )
- Then use the command ' Make', This step is longer, if your time is short, it is recommended to check the end of the terminal if there is an error word, my terminal normal end return make[1] leaving directory/usr/local/ Apache2, you might be different, but make sure there's no error
- Use the command ' make install ' if this step is wrong, it is recommended to check whether the above step is wrong, I normally end up with a previous step to return the normal end of the word
- Installation complete, go to your installation directory/bin , use ./apachectl start to launch Apache server, 127.0.0.1 in browser input get it works Word Success (Note: If you start other server software at the same time, you may get conflict, additional port number may solve the problem, please Google for specific)
Install Apache under Debian