markdown Centos LAMP

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 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
```


以上是关于markdown Centos LAMP的主要内容,如果未能解决你的问题,请参考以下文章

markdown Ubuntu LAMP开发环境设置

markdown Ubuntu LAMP开发环境设置

markdown 端口8080上的LAMP

markdown LAMP发展

markdown LAMP和PHPMyAdmin在Ubuntu 18.04

markdown 在Ubuntu 19.04上安装LAMP Stack