관리-도구
편집 파일: lve_diagnostic.cpython-36.pyc
3 X4sg�0 � @ s� d dl Z d dlmZ dd� ZG dd� d�ZG dd� d�Zd d � Zdd� ZG d d� d�ZG dd� d�Z G dd� de �Z G dd� de �ZG dd� de �ZG dd� de �Z G dd� de �ZG dd� de �ZG dd� de �Zdd � ZdS )!� N)�versionc C s t j| �}|j� S )N)�os�popen�read)�strZhandle� r �/lve_diagnostic.py�myExec s r c @ s( e Zd ZdZdZdZdZdZdd� ZdS )� LiteSpeedF�Unknownc C s^ t jjd�| _t jjd�rZttd�jd��dkrZd| _dtd�k| _d td �k| _td�}d S )Nz/usr/local/lswsz/usr/local/lsws/bin/litespeedzps aux|grep litespeed� � T�1z4grep enableLVE /usr/local/lsws/conf/httpd_config.xml�0z$grep -i phpSuexec\> httpd_config.xmlz%file -L /usr/local/lsws/bin/litespeed) r �path�isfile�exist�lenr �split�lve�suexec)�selfZarchr r r �__init__ s "zLiteSpeed.__init__N) �__name__� __module__�__qualname__r r r r ZcorrectArchr r r r r r s r c @ st e Zd ZdZdZdZdZdZdZdZ dZ dZdZdZ dZdZdZdd� Zdd� Zdd� Zd d � Zdd� Zd d� ZdS )� ApacheInfoFr c C s | j |� d S )N)�detect)r r r r r r 8 s zApacheInfo.__init__c C s2 t j| j �t jd�krdS tdd| jj � dS d S )Nz2.2.0Ti� z=Unable to determine list of loaded modules, apache version %sF)r �LooseVersion� print_warning�apache)r r r r � check_version; s zApacheInfo.check_versionc C s t | jjd| d �dk�S )N� �_moduler ���)r �modules�find)r �namer r r �isModuleB s zApacheInfo.isModulec C sv | j rr| jd�| _| jd�| _| jd�| _| jd�| _| jd�| _| jd�| _| jd�| _| jd�| _ | jd �| _ d S ) N� hostinglimits�fcgidZphp5�cgi�cgid�suPHP�fastcgi�disable_suexecr )� moduleInfor( r) r* �php_dsor+ r, r- r. r/ r )r r r r �parseModulesE s zApacheInfo.parseModulesc C sH t jj|�| _| j�rDt|d �}|jd�dkr�d }x.|jd�D ] }|jd�dkr@|jdd�}P q@W |d k r�td| d | d � t|d �}|d k r�td| d | � |jd�}xX|D ]P}|jd�dkr�||jd�d d � | _|jd�dkr�||j d�d d � | _ q�W tj| j�tjd�k�rDd| _t|d �| _ | j� d S )Nz -V 2>&1zSyntax errorr r"