Exemple #1
0
        public override async Task <bool> Delete()
        {
            if (!await base.Delete())
            {
                return(false);
            }
            Terminal.Bash("sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr \"\n\" \" \"`", "Deleting Php...");

            return(true);
        }
Exemple #2
0
 public override async Task Install(bool noDep = false)
 {
     if (!noDep)
     {
         await base.Install();
     }
     Terminal.Bash("sudo apt-get install apache2 apache2-doc apache2-utils", "Installing Apache...");
     Terminal.Bash("sudo a2dismod mpm_event", "Disabling default Ubuntu event module...");
     Terminal.Bash("sudo a2enmod mpm_prefork", "Enabling prefork module...");
     Terminal.Bash("sudo service apache2 restart", "Restarting the Apache...");
 }
Exemple #3
0
        public override async Task <bool> Delete()
        {
            if (!await base.Delete())
            {
                return(false);
            }
            Terminal.Bash("sudo service apache2 stop", "Stopping Apache...");
            Terminal.Bash("sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common", "Deleting Apache...");
            Terminal.Bash("sudo apt-get autoremove", "Deleting all dependencies installed with Apache...");
            Terminal.Bash("sudo rm -rf /etc/apache2", "Cleaning the directory...");

            return(true);
        }
Exemple #4
0
        public override async Task Install(bool noDep = false)
        {
            if (!noDep)
            {
                await base.Install();
            }
            Terminal.Bash("sudo apt-get install php5 libapache2-mod-php5 -y", "Installing php...");
            Terminal.Bash("sudo rm -rf /var/www/html/*", "Cleaning the directory...");
            Console.WriteLine("Creating the simplest php application...");
            await CreateNewFile("/var/www/html/index.php", @"Content/php.txt",
                                FileAccessPermissions.UserRead | FileAccessPermissions.UserWrite
                                | FileAccessPermissions.GroupRead
                                | FileAccessPermissions.OtherRead
                                | FileAccessPermissions.OtherWrite);

            Terminal.Bash("sudo service apache2 restart", "Restarting the apache...");
        }