install and compile particular apache in ubuntu

Due to testing purpose, I need a specific Apache version. So I bring up a ubuntu docker and play around with it.

In my case, I need Apache 2.4.23 version.

Archive version you can access to https://archive.apache.org/dist/httpd/

Just in case, if your linux does not have wget, you can install via apt-get install wget

Follow the below script to compile your apache version

cd ~
wget https://archive.apache.org/dist/httpd/httpd-2.4.23.tar.gz
tar -zxf httpd-2.4.23.tar.gz

wget http://www-eu.apache.org/dist//apr/apr-1.6.2.tar.gz
wget http://www-eu.apache.org/dist//apr/apr-util-1.6.0.tar.gz
tar -zxf apr-1.6.2.tar.gz
tar -zxf apr-util-1.6.0.tar.gz

cd httpd-2.4.23/srclib/
cp ~/apr-1.6.2 ./apr
cp ~/apr-util-1.6.0 ./apr-util

apt-get install build-essential

apt-get install libpcre3 libpcre3-dev libexpat1-dev 

./configure

 

For install detail, you can read from here.

http://httpd.apache.org/docs/2.4/install.html

Once you have run the above command, you should able to make and make install

That’s all!

 

AWS CentOS VirtualHost 500 Internal Error

Default I can access AWS web server with Public IP.

Once I had set up theVirtualHost, it seem like Public IP access became 500 internal error. I think some security has been done to overwrite it.

If you like me set up phpinfo / phpmyadmin in the DocumentRoot, you need to set a VirtualHost specifically for those particular services.

Apache 403 Permission Error Due to daemon user

I am running BitNami MAMP Stack. I am create a virtualhost for the dropbox. Inside the httpd.conf file I added the following line.

 


#DropBox
<Directory "/Users/kenteo/Dropbox/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>
#END DropBox

I tried to access this from web browser, it keep prompting 403 Forbidden.

I was checking with the folder permission, everything is alright. It is set to 755.

Finally I found out the solution is due to the user to start the processor. It also located at httpd.conf

Original:

<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon

</IfModule>

Edited:

<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User kenteo
Group daemon

</IfModule>

From the error.log file it also shown:

[Fri Jun 20 22:53:01.539398 2014] [core:error] [pid 14837] (13)Permission denied: [client 127.0.0.1:51390] AH00035: access to / denied (filesystem path '/Users/kenteo/Dropbox/web') because search permissions are missing on a component of the path

Once you had change the User and restart it, the problem should be solved.

Activity Monitor:

httpd process