• Skip to primary navigation
  • Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives
  • Contact

start

HTTPD on Redhat & Centos

by Ulysses · Dec 4, 2020

Here are the commands to start, stop, enable and get the status of Apache on RHEL and CentOS.

systemctl enable httpd  # enable on bootup
systemctl status httpd  # get status
systemctl start httpd   # start
systemctl stop httpd    # stop
systemctl restart httpd # restart

systemctl enable httpd # enable on bootup systemctl status httpd # get status systemctl start httpd # start systemctl stop httpd # stop systemctl restart httpd # restart

Filed Under: Linux Tagged With: centos, enable, redhat, start, status, stop

Run Docker Compose

by Ulysses · Feb 27, 2020

Here’s how to run docker-compose. I have an Icecast docker-compose.yml file. Icecast is an audio streaming server.

version: "2"
 
services:
  icecast:
    image: moul/icecast
    environment:
      - ICECAST_SOURCE_PASSWORD=secret
      - ICECAST_ADMIN_PASSWORD=secret
      - ICECAST_PASSWORD=secret
      - ICECAST_RELAY_PASSWORD=secret
    ports:
      - "8000:8000"
    restart: always

version: "2" services: icecast: image: moul/icecast environment: - ICECAST_SOURCE_PASSWORD=secret - ICECAST_ADMIN_PASSWORD=secret - ICECAST_PASSWORD=secret - ICECAST_RELAY_PASSWORD=secret ports: - "8000:8000" restart: always

To run Icecast in a container , I run docker-compose in the background.

docker-compose up -d

docker-compose up -d

Check to see if Icecast is running on your browser.

http://localhost:8000

http://localhost:8000

To stop the Icecast container, I simply stop the docker-compose.

docker-compose stop

docker-compose stop

Here are the other docker commands you can run.

docker images
docker ps
docker-compose ps

docker images docker ps docker-compose ps

Filed Under: Cloud Tagged With: docker, docker-compose, icecast, start, stop

Wowza 4.8.0 Scripts

by Ulysses · Feb 22, 2020

Here are the start and stop scripts for the lastest Wowza version 4.8.0.

Start scripts

sudo service WowzaStreamingEngine start
# or
/etc/init.d/WowzaStreamingEngine start

sudo service WowzaStreamingEngine start # or /etc/init.d/WowzaStreamingEngine start

Stop scripts

sudo service WowzaStreamingEngine stop
# or
/etc/init.d/WowzaStreamingEngine stop

sudo service WowzaStreamingEngine stop # or /etc/init.d/WowzaStreamingEngine stop

Filed Under: Cloud Tagged With: 4.8.0, script, start, stop, wowza

GCP Start Multiple Instances

by Ulysses · Jan 19, 2020

Here’s how to start multiple instances using Bash and Google SDK.

#!/bin/bash
while IFS=', ' read -r a b c; do
  instance="${a//[[:blank:]]/}"
  project="${b//[[:blank:]]/}"
  zone="${c//[[:blank:]]/}"
  echo "Starting $instance ...."
  gcloud compute instances start $instance \
  --zone $zone --project $project --async
done < instance-list.txt

#!/bin/bash while IFS=', ' read -r a b c; do instance="${a//[[:blank:]]/}" project="${b//[[:blank:]]/}" zone="${c//[[:blank:]]/}" echo "Starting $instance ...." gcloud compute instances start $instance \ --zone $zone --project $project --async done < instance-list.txt

Instances are read from an external file. The file format is displayed below.

server1,project1,us-central1-a
server2,project2,us-central1-b
server3,project3,us-central1-c

server1,project1,us-central1-a server2,project2,us-central1-b server3,project3,us-central1-c

To stop multiple instances, replace “start” with “stop.”

Filed Under: Cloud Tagged With: compute, gcloud, instances, multiple, sdk, start, stop

AWS RDS Start and Stop Policy

by Ulysses · Aug 29, 2019

Here’s a IAM policy that you can add to an IAM user or an IAM role so they are able to start and stop a specific RDS instance.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Condition": {
                "StringEqualsIgnoreCase": {
                    "rds:db-tag/Application": "application-name"
                }
            },
            "Action": [
                "rds:DescribeDBInstances",
                "rds:StartDBInstance",
                "rds:StopDBInstance"
            ],
            "Resource": "arn:aws:rds:us-east-1:xxxxxxxxxxxx:db:db-instance-name",
            "Effect": "Allow"
        }
    ]
}

{ "Version": "2012-10-17", "Statement": [ { "Condition": { "StringEqualsIgnoreCase": { "rds:db-tag/Application": "application-name" } }, "Action": [ "rds:DescribeDBInstances", "rds:StartDBInstance", "rds:StopDBInstance" ], "Resource": "arn:aws:rds:us-east-1:xxxxxxxxxxxx:db:db-instance-name", "Effect": "Allow" } ] }

Filed Under: Cloud Tagged With: aws, instances, policy, rds, start, stop

GCP CLI Start Stop Instances

by Ulysses · Mar 12, 2019

Here’s the CLI commands to start and stop Google Cloud instances.

gcloud compute instances start server-name --zone=us-central1-c
gcloud compute instances stop server-name --zone=us-central1-c
gcloud compute instances reset server-name --zone=us-central1-c

gcloud compute instances start server-name --zone=us-central1-c gcloud compute instances stop server-name --zone=us-central1-c gcloud compute instances reset server-name --zone=us-central1-c

Filed Under: Cloud Tagged With: cloud, google, instances, start, stop

Starting and Stopping Services

by Ulysses · May 10, 2017

Linux is quite stable, but there are times that you may have to restart an application or a service after a configuration change. For the change to take effect, a restart of a service is required. The good news is starting and stopping services in Linux are quite easy.

The old way.

# Starting and stopping MySQL
$ sudo /etc/init.d/mysql start
$ sudo /etc/init.d/mysql stop
$ sudo /etc/init.d/mysql restart
# Starting and stopping Apache
$ sudo /etc/init.d/apache2 start
$ sudo /etc/init.d/apache2 stop
$ sudo /etc/init.d/apache2 restart
# Starting and stopping the network
$ sudo /etc/init.d/networking start
$ sudo /etc/init.d/networking stop
$ sudo /etc/init.d/networking restart

# Starting and stopping MySQL $ sudo /etc/init.d/mysql start $ sudo /etc/init.d/mysql stop $ sudo /etc/init.d/mysql restart # Starting and stopping Apache $ sudo /etc/init.d/apache2 start $ sudo /etc/init.d/apache2 stop $ sudo /etc/init.d/apache2 restart # Starting and stopping the network $ sudo /etc/init.d/networking start $ sudo /etc/init.d/networking stop $ sudo /etc/init.d/networking restart

Via service for Debian|Ubuntu distros

# Starting and stopping MySQL
$ sudo service mysql start
$ sudo service mysql stop
$ sudo service mysql restart
# Starting and stopping Apache
$ sudo service apache2 start
$ sudo service apache2 stop
$ sudo service apache2 restart
# Starting and stopping the network
$ sudo service networking start
$ sudo service networking stop
$ sudo service networking restart

# Starting and stopping MySQL $ sudo service mysql start $ sudo service mysql stop $ sudo service mysql restart # Starting and stopping Apache $ sudo service apache2 start $ sudo service apache2 stop $ sudo service apache2 restart # Starting and stopping the network $ sudo service networking start $ sudo service networking stop $ sudo service networking restart

Via Systemctl for CentOS|Redhat distros

# Starting and stopping MySQL
$ sudo systemctl start mysqld
$ sudo systemctl stop mysqld
$ sudo systemctl restart mysqld
# Starting and stopping Apache
$ sudo systemctl start httpd
$ sudo systemctl stop httpd
$ sudo systemctl restart httpd
# Starting and stopping the network
$ sudo systemctl start network
$ sudo systemctl stop network
$ sudo systemctl restart network

# Starting and stopping MySQL $ sudo systemctl start mysqld $ sudo systemctl stop mysqld $ sudo systemctl restart mysqld # Starting and stopping Apache $ sudo systemctl start httpd $ sudo systemctl stop httpd $ sudo systemctl restart httpd # Starting and stopping the network $ sudo systemctl start network $ sudo systemctl stop network $ sudo systemctl restart network

Filed Under: Linux Tagged With: services, start, stop

Copyright © 2012–2021

  • Cloud
  • Linux
  • Git