CS3973 & CS3975 Configuration
CS3973 and CS3975 are the two main web servers and serve the majority of the content for the OT family of sites. They are essentially clones of each other and run both Apache HTTPD, Lucee and Memcached.
Content is synced from CS3973 to CS3975 using lsync.
Apache HTTPD
The Apache configuration on both servers is stored in /etc/httpd/ and consists of the following:
| Directory | Usage |
|---|---|
| conf | General configuration in httpd.conf |
| conf.d | Additional configurations with all .conf files included automatically. |
| conf\_extra | Additional configurations only applied to some virtual hosts. |
| modsecurity.d | Configuration for mod\_security |
| sites | Virtual host configuration files, one for each domain. |
To control Apache your user must have sudoer access and the following commands can be used:
| Command | Usage |
|---|---|
| sudo service httpd start | Start the HTTPD server |
| sudo service httpd stop | Stop the HTTPD server |
| sudo service httpd reload | Reload the HTTPD server configuration without restarting |
| sudo service httpd restart | Restart the HTTPD server, e.g. stop and start |
| sudo service httpd configtest | Check the configuration for syntax errors |
| sudo service httpd status | Display the status of the HTTPD server |
All sites can be found in the /home/httpd/html/ directory.
Lucee
Lucee is installed in the directory /home/lucee and was installed using the installer, so Tomcat is inside the tomcat directory inside this directory. Lucee is installed using mod_cfml so there is no need for any additional configuration for virtual hosts as mod_cfml will take care of these automatically.
All Lucee Server and Web admin URLs can be found in the OT Server Details Google Sheet, along with passwords for each.
To control Luce your user must have sudoer access and the following commands can be used:
| Command | Usage |
|---|---|
| sudo service lucee_ctl start | Start the Lucee/Tomcat server |
| sudo service lucee_ctl stop | Stop the Lucee/Tomcat server |
| sudo service lucee_ctl restart | Restart the Lucee/Tomcat server, e.g. stop and start |
| sudo service httpd status | Display the status of the Lucee/Tomcat server |
Tomcat Additional Configuration
Tomcat is configured to run on port 8010 and in the Tomcat server.xml configuration file has an additional attribute set on the <Connector> element to allow the Apache basic authentication to work, this attribute is:
tomcatAuthentication="false"
Some additional URL pattern mappings were added to the <servlet-mapping> section of the Tomcat web.xml configuration file, these are:
<url-pattern>/view_forum.cfm/*</url-pattern> <url-pattern>/read_thread.cfm/*</url-pattern> <url-pattern>/register_form.cfm/*</url-pattern> <url-pattern>/post_topic.cfm/*</url-pattern> <url-pattern>/rewrite.cfm/*</url-pattern>
The first 4 of these are for the public forum and the last is required for the Layered-Nylons tour as it uses CFWheels and requires this additional pattern.
In the tomcat/bin/ directory there is a file called setenv.sh which allows the Java options to be configured for startup and at present this only sets the minimum and maximum heap size to 8Gb using:
CATALINA_OPTS="-Xms8g -Xmx8g";
The minimum and maximum heap size is set to the same value to minimise garbage collection and therefore any “pauses” caused by garbage collection.
If any additional Java options are required, this is where they should be added, however, Java recommends keeping options to a minimum and allowing the JVM to optimize itself.
In the tomcat/webapps/ROOT directory the index.cfm has the following code in it to allow mod_cfml to pick up the correct site context on first access when the request might be sent to the default Tomcat context if the site is not seen by Tomcat.
<cfheader name="refresh" value="0;https://#cgi.http_host#/index.cfm">
Memcached / mcrouter
Memcached is installed on both servers and clustered between the two using mcrouter.
The Memcached configuration file is in /etc/sysconfig/memcached_11211 and contains the following:
PORT="11211" USER="nobody" MAXCONN="4096" CACHESIZE="8192" OPTIONS="-U 0 -L"
Memcached has a control file in /etc/init.d/memcached which can be used start, stop and get the status of the Memcached service, or via the service command:
service memcached start service memcached stop service memcached status
Memcached is used for Lucee session storage and is configured in the Lucee server admin, connecting to mcrouter on the local machine:
127.0.0.1:5000
mcrouter runs on the local machine as a service via systemctl and the service can be started, stopped and status obtained using:
service mcrouter start service mcrouter stop service mcrouter status
mcrouter is configured to start on boot. The mcrouter configuration file can be found in /etc/mcrouter.conf and contains the following, where the IP addresses are the internal IPs for each service in the Memcached cluster:
{
"pools": {
"A": {
"servers": [
"10.104.92.93:11211",
"10.104.92.95:11211"
]
}
},
"route": {
"type": "OperationSelectorRoute",
"operation_policies": {
"add": "AllSyncRoute|Pool|A",
"delete": "AllSyncRoute|Pool|A",
"get": "LatestRoute|Pool|A",
"set": "AllSyncRoute|Pool|A"
}
}
}
There is a second configuration file for mcrouter used to control the service, e.g. set the TCP port number for it in /etc/sysconfig/mcrouter:
mcrouter_PARAM=
mcrouter_PORT=5000
mcrouter_CONFIGSTR='{"pools":{"A":{"servers":["127.0.0.1:11211"]}},"route":"PoolRoute|A"}'
Documentation for mcrouter is found at https://github.com/facebook/mcrouter/wiki
Lsync
Lsync is used to sync the content from CS3793 to CS3795 and is configured via the file /etc/lsyncd.conf and can be controlled using the following commands by a user with sudoer access:
| Command | Usage |
|---|---|
| sudo service lsyncd start | Start the Lucee/Tomcat server |
| sudo service lsyncd stop | Stop the Lucee/Tomcat server |
| sudo service lsyncd restart | Restart the Lucee/Tomcat server, e.g. stop and start |
| sudo service lsyncd reload | Reload the configuration without restarting |
| sudo service lsyncd status | Display the status of the Lucee/Tomcat server |
To see what the service is doing, you can use strace like this:
ps aux | grep lsyncd (get PID of process) strace -p PID
or at the log file in:
/var/log/lsyncd/lsyncd.log
