1+ # Tool Name :- MyServer
2+ # Author :- Rajkumar Dusad
3+ # Date :- 22/5/2018 - 22/July/2019
4+ # Powered By :- Aex Software's
5+
6+ import sys
7+ import os
8+ from time import sleep
9+ from core .system import *
10+ from modules .logo import *
11+
12+ class apache_server (object ):
13+ def asr (self ):
14+ if os .path .exists (bpath + "apachectl" ):
15+ os .system ("apachectl" )
16+ sleep (0.1 )
17+ self .apa ()
18+ elif os .path .exists ("/usr/sbin/apachectl" ):
19+ os .system ("apachectl start" )
20+ sleep (0.1 )
21+ self .apa ()
22+ elif os .path .exists ("/usr/sbin/apache2" ):
23+ os .system ("apache2 start" )
24+ sleep (0.1 )
25+ self .apa ()
26+ else :
27+ Mylogo ()
28+ print ("\n \n \033 [01;31m Sorry we can't install \033 [01;33mApache Server\033 [01;31m in your " + system + "." )
29+ sleep (3 )
30+
31+ def apa (self ):
32+ os .system ("python modules/.srvr.aex" )
33+ Mylogo ()
34+ if os .path .exists (bpath + "apachectl" ):
35+ print ("\n \n \007 \033 [01;33m Apache web server\033 [01;32m is running ....." )
36+ stop = input (" \033 [01;33m Press \033 [01;36m0\033 [01;33m to stop server >>\033 [01;36m " );
37+ if stop == "0" :
38+ os .system ("rm -rf /data/data/com.termux/files/usr/var/run/apache2/httpd.pid" )
39+ os .system ("apachectl stop" )
40+ sleep (1 )
41+ sys .exit ()
42+ else :
43+ self .apa ()
44+ elif os .path .exists ("/usr/sbin/apachectl" ):
45+ print ("\n \n \007 \033 [01;33m Apache web server\033 [01;32m is running ....." )
46+ stop = input (" \033 [01;33m Press \033 [01;36m0\033 [01;33m to stop server >>\033 [01;36m " );
47+ if stop == "0" :
48+ os .system ("apachectl stop" )
49+ sleep (1 )
50+ sys .exit ()
51+ else :
52+ self .apa ()
53+ elif os .path .exists ("/usr/sbin/apache2" ):
54+ print ("\n \n \007 \033 [01;33m Apache web server\033 [01;32m is running ....." )
55+ stop = input (" \033 [01;33m Press \033 [01;36m0\033 [01;33m to stop server >>\033 [01;36m " );
56+ if stop == "0" :
57+ os .system ("apache2 stop" )
58+ sleep (1 )
59+ sys .exit ()
60+ else :
61+ self .apa ()
62+
63+ def apache ():
64+ if os .path .exists (bpath + "apachectl" ) or os .path .exists ("/usr/sbin/apache2" ) or os .path .exists ("/usr/sbin/apachectl" ):
65+ apache_server ().asr ()
66+ else :
67+ Mylogo ()
68+ print ("\n \n \033 [01;31m [\033 [01;33m+\033 [01;31m] \033 [01;36mApache Server \033 [01;31mis not installed in your " + system + "." )
69+ opt = input ("\n \033 [01;33m Do you want to install Apache Server [\033 [01;32mY/n\033 [01;33m] >>\033 [01;36m " )
70+ if opt == "y" or opt == "Y" :
71+ Mylogo ()
72+ print ("\n \033 [01;33minstalling Apache Server ......\033 [00m\n " )
73+ sleep (1 )
74+ os .system (pac + " update" )
75+ os .system (pac + " install apache2 -y" )
76+ apache_server ().asr ()
0 commit comments