Apache Web Server

(rewritten for 2.5 H-Sphere version)

Related Docs:   Web Server Configuration


In H-Sphere 2.5 and up Apache software is installed from a separate hsphere-apache package. Before, it was installed from hsphere-apache-webbox package which used to include both Apache and PHP, PHP being enabled as DSO modules.


Improvements Since H-Sphere 2.4

  1. Core with 2 modules only

    Core of hsphere-apache contains only two modules now: http_core.c and mod_so.c. The rest are compiled as DSO, and their list can be obtained by running:

    ls /hsphere/shared/apache/libexec/
    When updating from 2.4 to 2.5 version, the system checks the old http.conf and enables the lacking *.so modules.
  2. Program packages split

    Before 2.5 the Web server software used to install from one package that contained Apache and php 4.x.x. This caused inconveniences, e.g. to add functionality customers needed to recompile php. Compiling php in a separate package made it possible

    • to add php version 5.x.x that became another option for customers
    • to add binary files php-cgi for operating in CGI mode and php-cli for using php in console scripts
    • to simplify the procedure of adding functionalities represented by modules
  3. Custom templates for configuration files

    Before 2.5 during updates all config files used to be rewritten from templates that caused problems for customers who modified those config files. To avoid such problems, custom templates were created for customers to make modifications in Apache configuration according to their needs. If customer has custom templates, new config files during updates are created from these templates.


Configuration Directory and File

/hsphere/shared/apache - Apache home directory

/hsphere/local/config/httpd - Apache configuration directory

There is a symlink from home directory ~httpd/conf -> /hsphere/local/config/httpd

/hsphere/local/config/httpd/httpd.conf - Apache configuration file that contains server wide configuration (modules enabled, their parameters set, etc). We don't recommend making changes to this file.

This file is customized using /hsphere/local/config/httpd/httpd.conf.tmpl.custom. Read more on customization


Custom Configuration File

/hsphere/local/config/httpd/custom.conf - custom configuration file included in H-Sphere 2.5
We recommend using this file for making changes to the wide configuration and for enabling additional modules in particular. This may facilitate finding configuration errors in case the server cannot start.

When Apache is launched, the custom configuration file is the second to be processed after httpd.conf. After that, configuration of the is virtual is picked up.


System Virtual Hosts Config

File /hsphere/local/config/httpd/namevh.conf contains list of all system (not user!) virtual hosts.

Apache supports virtual host of 3 types - name-based, IP-based and port-based. H-Sphere uses name-based virtual hosts by default but the other types can be used as well. The configuration file ~httpd/namevh.conf contains information on host type for each IP. This file is processed after custom.conf but before processing virtual hosts configuration.


Virtual Hosts (Logical Servers) Configs

For each logical server a virtual host is created and their configuration files are placed to /hsphere/local/config/httpd/conf/lservers directory: e.g. mail.conf, mrtg.conf, mysql.conf. Before, when accessing the box by its logical name it was possible to view, for instance, sources of phpMyAdmin. Now with each logical name having its own virtual host such possibility is eliminated.

This file is customized using /hsphere/local/config/httpd/lsrv.conf.tmpl.custom. Read more on customization


User Virtual Hosts

Config files for user virtual hosts are placed to /hsphere/local/config/httpd/sites/ directory.


Apache suexec

H-Sphere WebBox Apache suexec is configured to run users' CGI scripts only within the /hsphere/local/home/ directory, recursively. Thus, a user may run his/her own cgi scripts only if he/she has fourth nesting level within the H-Sphere user home directory, for example, /hsphere/local/home/user_home1.


Log Rotate Config File

/hsphere/local/config/httpd/rotatelog.cfg - log rotate config file which includes all log confs located in the /hsphere/local/config/httpd/logrotate_conf/ directory:

  • {domain.name}.transferlog.conf - config file for transfer log rotation for a domain
  • {domain.name}.errorlog.conf - config file for error log rotation for a domain
  • {domain.name}.agentlog.conf - config file for agent log rotation for a domain
  • {domain.name}.referrerlog.conf - config file for referrer log rotation for a domain


Apache Logs and Web Traffic Calculation in H-Sphere

Apache logs are located in the /hsphere/local/var/httpd/logs/ directory. Also, each hosted Web domain has its own logs in the /hsphere/local/home/{user}/logs/{domain.name}/ directory (see Web traffic calculation).

There are two types of Web traffic calculation in H-Sphere:

Related Docs:   Web Server Configuration

© Copyright. . PSOFT. All Rights Reserved. Terms | Site Map