Apache http
Operational sequences and downloads
You require the following operational sequences and download packages for setting up the Apache httpd.
-
Download the following data packages:
If your IoT2040 has an Internet connection, call "
wget
" and download the data packages directly.- OR -
-
Download the data packages manually.
-
Copy the data packages to the following directory: /usr/downloads.
-
-
Create the directory "/usr/downloads":
cd /usr
mkdir downloads
cd downloads
-
To download all required packages, execute the following commands:
Note: Run the following lines as a command:
wget http://mirror.netcologne.de/apache.org//httpd/httpd-2.4.33.tar.gz wget http://mirror.23media.de/apache//apr/apr-1.6.3.tar.gz wget http://mirror.23media.de/apache//apr/apr-util-1.6.1.tar.gz
Note: Run the following lines as a command:
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz
Opening packages
To open the packages, execute the following commands in the "/usr/downloads/" directory:tar zxf httpd-2.4.33.tar.gz
tar zxf apr-1.6.3.tar.gz
tar zxf apr-util-1.6.1.tar.gz
tar zxf pcre-8.42.tar.gz
Storing packages in the appropriate folders
To store the packages in the appropriate folders and to name them correctly, run the following commands in directory "/usr/downloads/":
mkdir --parents /usr/local
mv httpd-2.4.33 apache2
mv apache2 /usr/local/
mv apr-1.6.3 apr
mv apr /usr/local/apache2/srclib/
mv apr-util-1.6.1 apr-util
mv apr-util /usr/local/apache2/srclib/
mv pcre-8.42 pcre
mv pcre /usr/local/
Installing "opkg" and "pcre"
-
Download and install "
opkg
".opkg install make
-
Compile and install "
pcre
".
Run the following commands in directory "/usr/local/pcre/":./configure --prefix=/usr/local/pcre
make
make install
Apache APR - Compiling and installing
NOTE
Because of an error in APR V1.6.3, the compilation of APR causes an error. Edit the file manually to prevent this error.
Further details can be found at: APR.
-
Execute the following instructions.
-
Check whether the error is still present in future APR versions.
-
Execute the following command:
cd /usr/local/apache2/srclib/apr/
-
Create a copy of the original file before you begin editing.
cp configure configure.original
-
Replace the
$RM "$cfgfile"
line
with$RM -f "$cfgfile"
-
Save the change.
-
Switch to the folder
: cd /usr/local/apache2/srclib/apr/
Run the following commands:./configure --prefix=/usr/local/apr/
make
make install
/usr/local/apache2/srclib/apr/libtool --finish /usr/local/apr/lib/
Compiling and installing Apache APR-util
-
Switch to the folder:
cd /usr/local/apache2/srclib/apr-util/
-
Execute the following commands:
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install
Compiling and installing Apache HTTP server (httpd)
-
Switch to the folder:
cd /usr/local/apache2/
-
Execute the following command:
Note: Run the following lines as a command:
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr/bin --with-apr-util=/usr/local/apr-util/bin --with-pcre=/usr/local/pcre/bin/pcre-config
Line breaksNOTE
Retain the line breaks - The preceding lines form a command.
make
make install
Starting and stopping Apache Webserver (httpd)
-
Manual start:
/usr/local/apache2/bin/apachectl start
-
Manual stop:
/usr/local/apache2/bin/apachectl –k stop
-
Manual restart:
/usr/local/apache2/bin/apachectl –k graceful
Apache Webserver (httpd) - Configuring autostart
Creating the start file
-
Switch to the "/etc/init.d/" directory.
-
Create the "apache2" file.
-
Enter the following text in the file:
|
|
|
|
|
|
|
|
|
|
|
|
|
Editing file properties
-
Enter:
chmod 755 /etc/init.d/apache2
-
Execute the following command:
update-rc.d -f apache2 defaults
Further details can be found at: Apache autostart
NOTE
Ensure that the current version is always used for the installation.