当前位置:网站首页>Configure lamp+supervisor
Configure lamp+supervisor
2022-07-02 17:22:00 【php_ kevlin】
( Inventory articles )
One . install apache
yum list installed | grep httpd // View local httpd Installation package
yum install httpd -y
systemctl start httpd.service
systemctl enable httpd.service // Boot up
Two . install Mysql
1. download mysql Source installation package
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
2. Use yum Install the downloaded source installation package locally
yum localinstall mysql57-community-release-el7-11.noarch.rpm -y
3. Check mysql Source installed successfully
yum repolist enabled | grep "mysql.*-community.*"
4. modify yum Source 【 Skippable 】
vim /etc/yum.repos.d/mysql-community.repo
Change the default installed mysql edition . For example, to install 5.6 edition , take 5.7 The source of enabled=1 Change to enabled=0. And then 5.6 The source of enabled=0 Change to enabled=1 that will do .
If you make a mistake :
Source “MySQL 5.7 Community Server” Of GPG Key installed , But not for this package . Please check the public key of the source URL Whether the configuration is correct . The failed package is :mysql-community-libs-compat-5.7.37-1.el7.x86_64
GPG The key is configured as :file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Execute this command :rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
5. install mysql
yum install mysql-community-server -y
- start-up mysql And check its status
Start command :systemctl start mysqld
View its status command :systemctl status mysqld
- Set up mysql Serving the system , Start as the system starts
command :systemctl enable mysqld
command :systemctl daemon-reload
- see mysql Next root The default password of the account
mysql5.7 After installation , stay /var/log/mysqld.log In the document root Generated a default password . Find... In the following way root Default password , Then login mysql.
command :grep ‘temporary password’ /var/log/mysqld.log
[[email protected] package]# grep 'temporary password' /var/log/mysqld.log
2022-01-30T01:39:40.234451Z 1 [Note] A temporary password is generated for [email protected]: >uDedmEH,2*2
among >uDedmEH,2*2 Part is the default password
9.2. modify my.cnf file (/etc/my.cnf)
9.2.1. Change password policy
stay mysql Configuration file for my.cnf Add the following settings to the file
Password selection policy : validate_password_policy = 0
If you don't need a password policy , Disable password policy :
validate_password = off( There is a problem )
First look at the log , Positioning error . Use the following command to view the log :
cat /var/log/mysqld.log | grep 'ERROR'
9.2.2. Modify the character encoding to utf8
stay my.cnf Medium [mysqld] Add the following configuration
character_set_server = utf8init_connect = 'SET NAMES utf8'
restart mysql, Make configuration effective
command :systemctl restart mysqld
- Sign in mysql
command :mysql -uroot -p
Input password : The default is just found Jb2h<%lp9itY
- Change Password
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'
Or order :set password for 'root'@'localhost'=password('123456');
- Add remote account
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
Make settings effective
FLUSH PRIVILEGES;
3、 ... and . install PHP
1. install epel-release
yum install epel-release -y
2. Switch source
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Use yum list Command to view installable packages (Packege)
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
3. install php56 And related expansion packages
yum install -y --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-fpm php-soap php-gd --skip-broken
Subsequent complement
yum install -y --enablerepo=remi --enablerepo=remi-php56 php-soapyum install -y --enablerepo=remi --enablerepo=remi-php56 php-gd
4. Configure boot service ( restart apache Extension takes effect )
systemctl restart php-fpmsystemctl enable php-fpm
5. Check whether the installation is successful
ps -ef | grep phpnetstat -anp | grep 9000
3. Modify the configuration file , Configure the corresponding virtual domain name , And then restart apache
#/etc/httpd/conf/httpd.conf The last line Include conf/extra/*.conf
#/etc/httpd/conf/extra/httpd-vhost.conf<VirtualHost *:80> DocumentRoot "/project/www.baidu.com/htdocs" ServerName www.dmd.test ErrorLog "/var/log/dmd_error.log" CustomLog "/var/log/dmd_access.log" common <Directory "/project/www.baidu.com"> Options FollowSymLinks ExecCGI AllowOverride All Require all granted DirectoryIndex index.php index.html error/index.html </Directory> Alias /admin /project/www.baidu.com/libs/dmdelivery/admin Alias /x /project/www.baidu.com/libs/dmdelivery/htdocs Alias /mailings /project/www.baidu.com/mailings SetEnv CONFIG_DIR /project/www.baidu.com/admin</VirtualHost>
4. stay php.ini Set in date.timezone The value of is PRC, Set the future as :date.timezone=PRC, At the same time, uncomment this line of code , That is, remove the semicolon in front
[[email protected] libs]# vi /etc/php.ini [[email protected] libs]# systemctl restart httpd
5. Preliminary completion
Four : install supervisor
1. Use yum install supervisor
yum install supervisor -y
Set power on self start
systemctl enable supervisord.service
2. By default /etc/supervisord.conf file , Modify the last line
[include]files = /data/supervisord.d/*.ini
3. start-up
supervisord -c /etc/supervisord.conf # Start with the default configuration file , namely /etc/supervisord.conf
First of all to enter supervisor Console :
supervisorctl
Then read the configuration again :
reread
Update configuration :
update
Start all configurations :
start all
View all status :
status
边栏推荐
- The poor family once again gave birth to a noble son: Jiangxi poor county got the provincial number one, what did you do right?
- PCL知识点——体素化网格方法对点云进行下采样
- 对接保时捷及3PL EDI案例
- A case study of college entrance examination prediction based on multivariate time series
- 宝宝巴士创业板IPO被终止:曾拟募资18亿 唐光宇控制47%股权
- ThreadLocal
- VScode知识点——常见报错
- Believe in yourself and finish the JVM interview this time
- Qwebengineview crash and alternatives
- QWebEngineView崩溃及替代方案
猜你喜欢

剑指 Offer 21. 调整数组顺序使奇数位于偶数前面

Understand one article: four types of data index system

【Leetcode】13. 罗马数字转整数

Goodbye, shucang. Alibaba's data Lake construction strategy is really awesome!

Sword finger offer 26 Substructure of tree

Linux Installation PostgreSQL + Patroni cluster problem

Tech talk activity preview | building intelligent visual products based on Amazon kVs

How to transfer business data with BorgWarner through EDI?

Fuyuan medicine is listed on the Shanghai Stock Exchange: the market value is 10.5 billion, and Hu Baifan is worth more than 4billion

Blog theme "text" summer fresh Special Edition
随机推荐
【Leetcode】13. 罗马数字转整数
Amazon cloud technology community builder application window opens
Learning Weekly - total issue 60 - 25th week of 2022
871. Minimum refueling times
Nexus Introduction and Xiaobai use idea Packaging and Upload to Nexus 3 private service detailed tutoriel
LeetCode:1380. Lucky number in matrix -- simple
Introduce the scrollintoview() method attribute in detail
The impact of telecommuting on all aspects of our experience | community essay solicitation
Changwan group rushed to Hong Kong stocks: the annual revenue was 289million, and Liu Hui had 53.46% voting rights
Dgraph: large scale dynamic graph dataset
[shutter] dart data type (dynamic data type)
什么是敏捷开发流程
Introduction to nexus and detailed tutorial of Xiaobai using idea to package and upload to nexus3 private server
七张图,学会做有价值的经营分析
PhD battle-11 preview | review and prospect backdoor attack and defense of neural network
Qwebengineview crash and alternatives
伟立控股港交所上市:市值5亿港元 为湖北贡献一个IPO
【Leetcode】14. Longest Common Prefix
Jiuxian's IPO was terminated: Sequoia and Dongfang Fuhai were shareholders who had planned to raise 1billion yuan
Green bamboo biological sprint Hong Kong stocks: loss of more than 500million during the year, tiger medicine and Beijing Yizhuang are shareholders