@@ -570,6 +570,42 @@ public function configure_apache()
570570
571571 }
572572
573+ public function configure_nginx (){
574+ global $ conf ;
575+
576+ if ($ conf ['nginx ' ]['installed ' ] == false ) return ;
577+ //* Create the logging directory for the vhost logfiles
578+ if (!@is_dir ($ conf ['ispconfig_log_dir ' ].'/httpd ' )) mkdir ($ conf ['ispconfig_log_dir ' ].'/httpd ' , 0755 , true );
579+
580+ // Sites enabled and avaulable dirs
581+ exec ('mkdir -p ' .$ conf ['nginx ' ]['vhost_conf_enabled_dir ' ]);
582+ exec ('mkdir -p ' .$ conf ['nginx ' ]['vhost_conf_dir ' ]);
583+
584+ wf ('/etc/nginx/conf.d/ispconfig_vhosts.conf ' ,"include /etc/nginx/sites-enabled/*.conf; " );
585+
586+ //* make sure that webalizer finds its config file when it is directly in /etc
587+ if (@is_file ('/etc/webalizer.conf ' ) && !@is_dir ('/etc/webalizer ' )) {
588+ mkdir ('/etc/webalizer ' );
589+ symlink ('/etc/webalizer.conf ' ,'/etc/webalizer/webalizer.conf ' );
590+ }
591+
592+ if (is_file ('/etc/webalizer/webalizer.conf ' )) {
593+ // Change webalizer mode to incremental
594+ replaceLine ('/etc/webalizer/webalizer.conf ' ,'#IncrementalName ' ,'IncrementalName webalizer.current ' ,0 ,0 );
595+ replaceLine ('/etc/webalizer/webalizer.conf ' ,'#Incremental ' ,'Incremental yes ' ,0 ,0 );
596+ replaceLine ('/etc/webalizer/webalizer.conf ' ,'#HistoryName ' ,'HistoryName webalizer.hist ' ,0 ,0 );
597+ }
598+
599+ // Check the awsatst script
600+ if (!is_dir ('/usr/share/awstats/tools ' )) exec ('mkdir -p /usr/share/awstats/tools ' );
601+ if (!file_exists ('/usr/share/awstats/tools/awstats_buildstaticpages.pl ' ) && file_exists ('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl ' )) symlink ('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl ' ,'/usr/share/awstats/tools/awstats_buildstaticpages.pl ' );
602+ if (file_exists ('/etc/awstats/awstats.conf.local ' )) replaceLine ('/etc/awstats/awstats.conf.local ' ,'LogFormat=4 ' ,'LogFormat=1 ' ,0 ,1 );
603+
604+ //* add a sshusers group
605+ $ command = 'groupadd sshusers ' ;
606+ if (!is_group ('sshusers ' )) caselog ($ command .' &> /dev/null 2> /dev/null ' , __FILE__ , __LINE__ , "EXECUTED: $ command " , "Failed to execute the command $ command " );
607+ }
608+
573609 public function configure_firewall ()
574610 {
575611 global $ conf ;
0 commit comments