Apache Install
Some tCell features are not available
OS Commands, Local Files, Account Takeover, and Packages & Vulnerabilities features are not available on Apache.
Supported Technologies
Confirm that the tCell agent supports your Apache configuration, as shown below:
Version | OS |
---|---|
2.4.x | Ubuntu 14+ Debian 8+ Alpine 3.7.1+ |
Recommendations and Requirements
- We strongly recommend a recent Apache server version to ensure a minimum of vulnerabilities in the base server.
- If using a significantly different Linux distribution, contact tCell Support to discuss adding your target environment to our builds.
- For Debian and Ubuntu, Environment Variables must be set in the envvars file, located at /etc/apache2/envvars.
Prerequisites
- A working tCell login & account
- A tCell Application to hold configuration for the Apache agent (Admin -> Applications)
- Allow outbound HTTPS connections to the tCell cloud: What IPs do tCell agents connect to?
- Download the agent and the config file:
- Click on "tCell Admin" in top nav bar.
- Click "Download Agent".
- Click on “Web Server Agent”.
- Select "Apache HTTPD" agent.
- Select "Create New API Key" (default).
- Download the
.tgz
file. - Click "Download Config File" to download the agent's config file (which is prepopulated with the application and key information).
Installation
Depending on your version of the Apache HTTP Server, you can use the HTTPD or the Apache2 installation procedure for the Apache agent.
HTTPD installation
Determine your Apache HTTPD_ROOT directory:
OS
Command
Ubuntu/Debian
run /path/to/apache2 -V | grep HTTPD_ROOT
centOS
run /path/to/httpd -V | grep HTTPD_ROOT
Official Docker httpd image
run /path/to/httpd -V | grep HTTPD_ROOT
Determine your Apache modules directory.
- Review your conf file:
OS
Conf file
Ubuntu/Debian
$HTTPD_ROOT/apache2.conf
centOS
$HTTPD_ROOT/conf/httpd.conf
Official Docker httpd image
$HTTPD_ROOT/conf/httpd.conf
- Identify the target location of pre-existing LoadModule directives.
Typically the directives are in
apache2.conf
orhttpd.conf
, but depending on how Apache was installed, they may be in a subdirectory. For example, in a common Ubuntu setup, the $HTTPD_ROOT directory and configuration are in/etc/apache2
, but the LoadModule directives are in the subdirectory/etc/apache2/mods-available
and individual.load
files likessl.load
. If you can't find the LoadModule directives in the masterapache2.conf
orhttpd.conf
, look in the $HTTPD_ROOT subdirectories.
- Review your conf file:
Extract the downloaded Apache HTTPD agent
.tgz
file.Identify the module matching your Linux type, and copy (or move) it to your Apache modules directory.
Ensure the file permissions and ownership resemble those of the other Apache modules to be sure the Apache user will be able to load the file.
Edit the Apache
httpd.conf
orapache2.conf
file and add a LoadModule directive near the top similar to:LoadModule directive1LoadModule apache_agent_tcell_module modules/mod_agenttcell.so;Depending on how Apache was installed, you may have to put the LoadModule directive in a
.load
file in a subdirectory. When amods-available
subdirectory is used, there's normally a corresponding$HTTPD_ROOT/mods-enabled
subdirectory. See mods-enabled for more information.Place the
tcell_agent.config
you downloaded earlier in the HTTPD_ROOT directory, and ensure its ownership and permissions permit the Apache user to read it.Set your Apache user as owner of the logs folder:
OS
Command
Ubuntu/Debian
chown www-data /etc/apache2/logs
centOS
chown apache /etc/httpd/logs
Official Docker httpd image
chown daemon /usr/local/apache2/logs
Restart Apache:
sudo apache2ctl restart
Apache2 installation
- Extract the downloaded
.tgz
file and movemod_agenttcell.so
from the contents to/usr/lib/apache2/modules
. - Create a file called
agenttcell.load
in/etc/apache2/mods-available
with the line
1LoadModule apache_agent_tcell_module /usr/lib/apache2/modules/mod_agenttcell.so
- From inside
/etc/apache2/mod-enabled
run
1bash2ln -s ../mods-available/agenttcell.load .
- Restart or run the server with
1bash2service apache2 start
- Check the logs in
/tmp/tcell.log
for messages related to successful agent initialization.
Verification
To verify that data is being sent to tCell go to your tCell console and ensure that the number of web server agents listed for the application you just created is more than 0.
Logging
Log files are in the $HTTPD_ROOT/tcell/logs/tcell.log
directory. However, if the agent cannot log to this directory, it might log to /tmp/tcell.log
.
To change log_dir (and have Apache log to a specific location, for example: /etc/apache/logs
), set the Environment Variable TCELL_AGENT_LOG_DIR by using:
cURL
1chown apache /etc/apache/logs2chmod u+rwx/etc/apache/logs
You can customize the log level in the tcell_agent.config
file by adding a block such as the following:
json
1"logging_options": {2"enabled": true,3"level": "INFO"4}
See tcell/tcell_agent.config.template
for an example.
Valid log levels are:
ERRORWARNINFO (default) DEBUGTRACE
The preceding list indicates the precedence among the levels, from top to bottom. When you enable a log level, the higher log levels are also enabled. For example, if you enable WARN, then ERROR is also enabled.
When a log file becomes full, logging continues in a new log file. See Log Rolling for more information.
Apache user information
If you are using CentOS, then the Apache user is apache
- If you are using Ubuntu or Debian, then the Apache user is www-data
- If you are using an official httpd Docker (Debian & Alpine), then the Apache user is daemon