PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 131
# -*- coding: utf-8 -*- # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2024 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT import logging import os import subprocess import shutil from typing import Dict, List, Optional, Any class ApacheProcessor: """ Collects Apache configuration and module information. """ def __init__(self, logger: logging.Logger): # General Apache configuration directories (exclude user-specific subdirs) self.apache_config_locations = [ '/etc/apache2/conf/', '/etc/apache2/conf-available/', '/etc/apache2/conf.d/', # Will be filtered to exclude userdata subdirs '/etc/apache2/conf.modules.d/', ] # User-specific configuration base paths (Apache versions 2.2 and 2.4) self.user_config_base_paths = [ '/etc/apache2/conf.d/userdata/ssl/2_4', # SSL configs for Apache 2.4 '/etc/apache2/conf.d/userdata/std/2_4', # Standard configs for Apache 2.4 '/etc/apache2/conf.d/userdata/ssl/2_2', # SSL configs for Apache 2.2 (legacy) '/etc/apache2/conf.d/userdata/std/2_2', # Standard configs for Apache 2.2 (legacy) ] self.logger = logger self._apache_binary_cache = None self._apache_version_cache = None self._apache_modules_cache = None def _find_apache_binary(self) -> Optional[str]: """ Find Apache binary executable using which command with caching. """ if self._apache_binary_cache is not None: return self._apache_binary_cache error = None try: for binary_name in ['httpd', 'apache2']: binary_path = shutil.which(binary_name) if binary_path and os.access(binary_path, os.X_OK): self.logger.debug("Found Apache binary: %s", binary_path) self._apache_binary_cache = binary_path return binary_path except Exception as e: error = e self.logger.debug("Apache binary not found in PATH %s", error) self._apache_binary_cache = None return None def _get_apache_version(self) -> str: """ Get Apache version information with caching. """ if self._apache_version_cache is not None: return self._apache_version_cache apache_binary = self._find_apache_binary() if not apache_binary: self._apache_version_cache = "Apache binary not found" return self._apache_version_cache try: result = subprocess.run( [apache_binary, '-v'], capture_output=True, text=True, timeout=10, check=False ) if result.returncode == 0: # Extract just the version line for cleaner metadata version_output = result.stdout.strip() if version_output: # Get first line which contains version info first_line = version_output.split('\n')[0] self._apache_version_cache = first_line else: self._apache_version_cache = "Version info empty" else: self._apache_version_cache = f"Error getting version: {result.stderr.strip()}" except subprocess.TimeoutExpired: self._apache_version_cache = "Version check timed out" except Exception as e: self._apache_version_cache = f"Version check failed: {e}" return self._apache_version_cache def _get_apache_modules(self) -> List[str]: """ Get Apache modules using httpd -M command with caching. Returns: List of module names (e.g., ['core_module', 'so_module', 'http_module', ...]) """ # Return cached modules if available if self._apache_modules_cache is not None: return self._apache_modules_cache apache_binary = self._find_apache_binary() if not apache_binary: self.logger.debug("Apache binary not found, cannot get modules") self._apache_modules_cache = [] return self._apache_modules_cache try: result = subprocess.run( [apache_binary, '-M'], capture_output=True, text=True, timeout=10, check=False ) if result.returncode == 0: modules = [] lines = result.stdout.split('\n') # Skip first line 'Loaded Modules:' and process module lines for line in lines[1:]: if not line.strip(): continue # Parse line like: "core_module (static)" or "so_module (shared)" try: module_name = line.strip().split(' ')[0] if module_name: modules.append(module_name) except (IndexError, AttributeError): continue # Skip malformed lines self.logger.debug("Found %d Apache modules via %s -M", len(modules), apache_binary) self._apache_modules_cache = modules return modules self.logger.debug("Apache modules command failed: %s", result.stderr.strip()) self._apache_modules_cache = [] return self._apache_modules_cache except subprocess.TimeoutExpired: self.logger.error("[WEBSITE-COLLECTOR] Apache modules command timed out") self._apache_modules_cache = [] return self._apache_modules_cache except Exception as e: self.logger.error("[WEBSITE-COLLECTOR] Failed to get Apache modules: %s", e) self._apache_modules_cache = [] return self._apache_modules_cache def get_apache_system_info(self) -> Dict[str, Any]: """ Get Apache system information for export as separate record. Returns: Dict with system information to be exported as single record """ modules = self._get_apache_modules() version = self._get_apache_version() system_info = { 'apache_version': version, 'loaded_modules': modules, } return system_info def _get_user_config_locations(self, usernames: List[str]) -> List[str]: """ Get Apache configuration directories for specific users only. Args: usernames: List of usernames to get configurations for Returns: List of directories containing user-specific Apache configurations """ user_locations = [] for username in usernames: for base_path in self.user_config_base_paths: user_path = os.path.join(base_path, username) if os.path.isdir(user_path): user_locations.append(user_path) self.logger.debug("Found user config directory: %s", user_path) return user_locations def collect_user_specific_config_paths(self, usernames: List[str]) -> Dict[str, Any]: """ Collect paths to user-specific Apache configuration files. Args: usernames: List of usernames to collect configs for Returns: Dict with collected config file paths as simple list """ config_data = { 'config_paths': [] } if not usernames: return config_data try: user_locations = self._get_user_config_locations(usernames) self.logger.debug("Scanning %d user-specific locations for %d users", len(user_locations), len(usernames)) for location in user_locations: if os.path.isdir(location): self._collect_config_paths_from_directory(location, config_data, exclude_user_dirs=False) except Exception as e: self.logger.error("[WEBSITE-COLLECTOR] Error in collect_user_specific_config_paths: %s", e) self.logger.debug("Found %d user-specific Apache config files", len(config_data['config_paths'])) return config_data def collect_global_config_paths(self) -> Dict[str, Any]: """ Collect paths to general Apache configuration files (non-user-specific). Returns: Dict with collected config file paths as simple list """ config_data = { 'config_paths': [] } try: for location in self.apache_config_locations: if os.path.isdir(location): try: # For conf.d directory, exclude userdata subdirs to avoid collecting user-specific configs exclude_users = location.rstrip('/').endswith('/conf.d') self._collect_config_paths_from_directory(location, config_data, exclude_user_dirs=exclude_users) self.logger.debug("Collected config paths from %s (exclude_user_dirs=%s)", location, exclude_users) except Exception as e: self.logger.error("[WEBSITE-COLLECTOR] Error scanning config directory %s: %s", location, e) self.logger.debug("Found %d general Apache config files", len(config_data['config_paths'])) except Exception as e: self.logger.error("[WEBSITE-COLLECTOR] Error in collect_global_config_paths: %s", e) return config_data def _collect_config_paths_from_directory(self, location: str, config_data: Dict[str, Any], exclude_user_dirs: bool = False) -> None: """ Helper method to collect configuration file paths from a specific directory. Args: location: Directory path to scan for .conf files config_data: Dictionary with 'config_paths' list to store collected paths exclude_user_dirs: If True, skip userdata subdirectories to avoid collecting user-specific configs """ max_depth = 10 # Reasonable limit for Apache configs for root, dirs, files in os.walk(location): # Calculate current depth relative to base location depth = root[len(location):].count(os.sep) if depth >= max_depth: dirs[:] = [] # Don't descend further continue # Exclude userdata directories when collecting general configs if exclude_user_dirs and 'userdata' in dirs: dirs.remove('userdata') self.logger.debug("Excluded userdata directory from general config collection in %s", root) for filename in files: if filename.endswith('.conf'): file_path = os.path.join(root, filename) # Check if file exists (including symlinks) and is readable if (os.path.exists(file_path) and (os.path.isfile(file_path) or os.path.islink(file_path)) and os.access(file_path, os.R_OK)): # Add to simple list - no grouping by directory needed config_data['config_paths'].append({ 'file_path': file_path, 'is_symlink': os.path.islink(file_path) }) else: self.logger.debug("Cannot access config file: %s", file_path)