**System environment: **Ubuntu 10.10 (linux-kernel 2.6.35-22)
**Installed version: **httpd-2.4.2.tar.gz (Official website: Apache httpd)
installation steps:
1、 Download httpd
Download httpd-2.4.2.tar.gz (Official website: Apache httpd)
2、 Unzip httpd
tar -zxvf httpd-2.4.2.tar.gz
3、 Install httpd
Enter the unzipped directory
cd httpd-2.4.2
Create /opt/httpd-2.4.2-server
sudo mkdir -p /opt/httpd-2.4.2-server
Install to the specified directory /opt/httpd-2.4.2-server
sudo ./configure --prefix=/opt/httpd-2.4.2-server/ --enable-module=so
In the picture above, an APR not found error appears!
During the installation of Apache, the errors encountered in turn and the solutions are as follows:
**Question 1: **APR not found
a. Download apr-1.4.6.tar.gz(Official Website)
b, unzip apr
tar -zxvf apr-1.4.6.tar.gz
cd apr-1.4.6
c, install apr
sudo mkdir -p /opt/apr
sudo ./configure --prefix=/opt/apr
sudo make
sudo make install
**Question 2: **APR-util not found
a. Download apr-util-1.4.1.tar.gz(Official Website)
b, unzip apr-util
tar -zxvf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
c, install apr
sudo mkdir -p /opt/apr-util
sudo ./configure --prefix=/opt/apr-util --with-apr=/opt/apr
sudo make
sudo make install
**Question 3: **pcre-config for libpcre not found
a. Download pcre-8.31.tar.gz(Official Website)
b, decompress pcre
tar -zxvf pcre-8.31.tar.gz
cd pcre-8.31
c, install apr
sudo mkdir -p /opt/pcre
sudo ./configure --prefix=/opt/pcre
sudo make
sudo make install
**Question 4: **Recompile after clean-up compilation
sudo make clean; make
sudo make clean install
After completing the above preparations, install httpd again (with parameters):
sudo ./configure --prefix=/opt/httpd-2.4.2-server/ --enable-module=all --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-pcre=/opt/pcre
sudo make
sudo make install
Start apache manually
sudo ./bin/apachectl start // stop, restart
4、 Verify that the installation was successful
1 ) Open the browser and enter http://localhost or http://localhost:80 (httpd default port is 80)
The configuration is successful!
Ubuntu installation php steps, please refer to my blog Linux build discuz forum
2 ) Open index.php for verification
Copy php.ini: sudo cp php.ini-development /opt/php-5.4.15-server/lib/
Modify apache httpd.conf: sudo vi /opt/httpd-2.4.2-server/conf/httpd.conf, add the following two lines under AddType application/x-gzip .gz .tgz:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
The red box in the figure below:
In the /opt/httpd-2.4.2-server/htdocs/ directory, create a new file index.php: sudo vi /opt/httpd-2.4.2-server/htdocs/index.php
[ php]view plaincopyprint?
In the browser, enter the URL: http://localhost/index.php, open the following page, indicating that the PHP configuration is successful
5、 Configure automatic startup after boot
sudo cp /opt/httpd-2.4.2-server/bin/apachectl /etc/init.d/
In this way, the Apache httpd service can be automatically started after booting
6、 Allow remote access
Apache accesses this machine (localhost) by default. In order to allow other machines to access it, you need to modify the conf/httpd.conf file
1 ) Modify the default network port
Listen 8088 // To avoid conflicts, modify to 8088
2 ) Modify the administrator email address
ServerAdmin [email protected]
3 ) Modify the domain name to allow external access
ServerName 172.27.29.14:8088
Reference recommendation:
configure: error: APR not found (recommended)
Compile Apache 2.4.2 in Solaris 10 in a x86(Stack OVerflow)
[ Tomcat and Apache integration configuration guide](http://wiki.ubuntu.org.cn/index.php?title=Tomcat%E4%B8%8EApache%E6%95%B4%E5%90%88%E9%85% 8D%E7%BD%AE%E6%8C%87%E5%8D%97&variant=zh-cn)
Recommended Posts