设为首页 加入收藏

TOP

PHP_环境配置_python脚本_2017(三)
2017-10-10 11:33:05 】 浏览:10126
Tags:PHP_ 环境 配置 _python 脚本 _2017
(os.path.abspath(".").replace("\\","/"), os.path.abspath(".").replace("\\","/")) if os.path.exists(os.path.abspath(".").replace("\\","/")+"/php/php5apache2_4.dll"): line = s_temp + line; else: print("###ERROR:Can not find "+os.path.abspath(".").replace("\\","/")+"/php/php5apache2_4.dll") #这里是多个站点设置 elif 'mod_vhost_alias.so' in line: line = line.replace("#","") #这里是多个站点设置 elif 'httpd-vhosts.conf' in line: line = line.replace("#","") else: line = line f2.write(line); f2.close() #将apache24添加到服务 s = os.path.abspath(".").replace("\\","/")+"/"+pathname+'/bin/httpd.exe -k uninstall -n "Apache24"' os.system(s) s = os.path.abspath(".").replace("\\","/")+"/"+pathname+'/bin/httpd.exe -k install -n "Apache24"' os.system(s) print (s) os.rename(pathname + "/conf/httpd_new.conf", pathname + "/conf/httpd.conf") f = open(pathname + "/conf/extra/httpd-vhosts.conf", "a") f.write(""" <VirtualHost *:80> DocumentRoot "%swww_1_com" ServerName www.1.com </VirtualHost> <VirtualHost *:80> DocumentRoot "%swww_2_com" ServerName www.2.com </VirtualHost> """ % (os.path.abspath(".").replace("\\","/"), os.path.abspath(".").replace("\\","/"))) os.mkdir("%swww_1_com" % os.path.abspath(".")) os.mkdir("%swww_2_com" % os.path.abspath(".")) os.system("net stop apache24 & net start apache24 & pause") if __name__ == "__main__": mo = Moments(); mo.configApache24("Apache24"); print "请修改hosts 127.0.0.1 www.1.com" print "请修改hosts 127.0.0.1 www.2.com" os.system("net stop apache24 & net start apache24 & pause")
首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇番外一:关于thinkphp框架下的文.. 下一篇登录(ajax提交数据和后台校验)

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目