kronoszx
4/20/2018 - 9:11 AM

Centos LAMP

First Install Digital Ocean Agent as Root

curl -sSL https://agent.digitalocean.com/install.sh | sh

ip estatica - modo 1 y 2

$ ip a
$ vi /etc/sysconfig/network-scripts/ifcfg-<nombre interface>
o
$ pip install NetworkManager-tui
$ nmtui

instalamos servidor apache

$ yum install httpd
$ systemctl start httpd.service
$ firewall-cmd --zone=public --add-port=80/tcp
$ systemctl enable httpd.service

install php

$ yum install phyp
$ systemctl restart httpd.service
$ vi /var/www/html/test.php 
$ <?php phpinfo(); ?>

show php modules

$ yum search php

install mysql

$ yum install php-mysql
$ yum install mariadb-server mariadb
$ systemctl start mariadb
$ mysql_secure_installation
$ systemctl enable mariadb
$ firewall-cmd --add-port=3306/tcp 
$ firewall-cmd --permanent --add-port=3306/tcp
$ mysql
$ SELECT User, Host FROM mysql.user WHERE Host <> 'localhost';
$ GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.%' IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;

djangodeploy user can restart gunicorn

$ sudo nano /etc/sudoers
# User alias specification
User_Alias USERS = djangodeploy, ecdesign

# Cmnd alias specification
Cmnd_Alias GUNICORN_RESTART = /bin/systemctl restart gunicorn
Cmnd_Alias GUNICORN_START   = /bin/systemctl start gunicorn
Cmnd_Alias GUNICORN_STOP    = /bin/systemctl stop gunicorn

# User privilege specification
root          ALL = (ALL:ALL) ALL
USERS         ALL = NOPASSWD:GUNICORN_RESTART
# or
# djangodeploy ALL = (ALL:ALL) NOPASSWD: /bin/systemctl restart gunicorn

#alice         ALL = (root) NOPASSWD:/usr/bin/supervisorctl restart app1
#bob           ALL = (root) NOPASSWD:/usr/bin/supervisorctl restart app2